Merge "PACKAGE_FIRST_LAUNCH intent sent to wrong pkg" into honeycomb-mr1
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java
index 5521e92..d638e70 100644
--- a/core/java/android/view/ScaleGestureDetector.java
+++ b/core/java/android/view/ScaleGestureDetector.java
@@ -156,6 +156,7 @@
     private float mRightSlopEdge;
     private float mBottomSlopEdge;
     private boolean mSloppyGesture;
+    private boolean mInvalidGesture;
 
     // Pointer IDs currently responsible for the two fingers controlling the gesture
     private int mActiveId0;
@@ -177,6 +178,8 @@
             reset(); // Start fresh
         }
 
+        if (mInvalidGesture) return false;
+
         if (!mGestureInProgress) {
             switch (action) {
             case MotionEvent.ACTION_DOWN: {
@@ -518,6 +521,15 @@
         final int currIndex0 = curr.findPointerIndex(mActiveId0);
         final int currIndex1 = curr.findPointerIndex(mActiveId1);
 
+        if (prevIndex0 < 0 || prevIndex1 < 0 || currIndex0 < 0 || currIndex1 < 0) {
+            mInvalidGesture = true;
+            Log.e(TAG, "Invalid MotionEvent stream detected.", new Throwable());
+            if (mGestureInProgress) {
+                mListener.onScaleEnd(this);
+            }
+            return;
+        }
+
         final float px0 = prev.getX(prevIndex0);
         final float py0 = prev.getY(prevIndex0);
         final float px1 = prev.getX(prevIndex1);
@@ -556,6 +568,7 @@
         mGestureInProgress = false;
         mActiveId0 = -1;
         mActiveId1 = -1;
+        mInvalidGesture = false;
     }
 
     /**
diff --git a/core/java/android/webkit/HTML5VideoFullScreen.java b/core/java/android/webkit/HTML5VideoFullScreen.java
new file mode 100644
index 0000000..993d694
--- /dev/null
+++ b/core/java/android/webkit/HTML5VideoFullScreen.java
@@ -0,0 +1,286 @@
+
+package android.webkit;
+
+import android.content.Context;
+import android.media.MediaPlayer;
+import android.media.Metadata;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.MotionEvent;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.View;
+import android.view.ViewGroup;
+import android.webkit.HTML5VideoView;
+import android.webkit.HTML5VideoViewProxy;
+import android.widget.FrameLayout;
+import android.widget.MediaController;
+import android.widget.MediaController.MediaPlayerControl;
+
+
+/**
+ * @hide This is only used by the browser
+ */
+public class HTML5VideoFullScreen extends HTML5VideoView
+    implements MediaPlayerControl, MediaPlayer.OnPreparedListener,
+    View.OnTouchListener {
+
+    private SurfaceView mSurfaceView;
+
+    // We need the full screen state to decide which surface to render to and
+    // when to create the MediaPlayer accordingly.
+    static final int FULLSCREEN_OFF               = 0;
+    static final int FULLSCREEN_SURFACECREATING   = 1;
+    static final int FULLSCREEN_SURFACECREATED    = 2;
+
+    private int mFullScreenMode;
+    // The Media Controller only used for full screen mode
+    private MediaController mMediaController;
+
+    // SurfaceHolder for full screen
+    private SurfaceHolder mSurfaceHolder = null;
+
+    // Data only for MediaController
+    private boolean mCanSeekBack;
+    private boolean mCanSeekForward;
+    private boolean mCanPause;
+    private int mCurrentBufferPercentage;
+
+    // The progress view.
+    private static View mProgressView;
+    // The container for the progress view and video view
+    private static FrameLayout mLayout;
+
+    SurfaceHolder.Callback mSHCallback = new SurfaceHolder.Callback()
+    {
+        public void surfaceChanged(SurfaceHolder holder, int format,
+                                    int w, int h)
+        {
+            if (mPlayer != null && mMediaController != null
+                    && mCurrentState == STATE_PREPARED) {
+                if (mMediaController.isShowing()) {
+                    // ensure the controller will get repositioned later
+                    mMediaController.hide();
+                }
+                mMediaController.show();
+            }
+        }
+
+        public void surfaceCreated(SurfaceHolder holder)
+        {
+            mSurfaceHolder = holder;
+            mFullScreenMode = FULLSCREEN_SURFACECREATED;
+
+            prepareForFullScreen();
+        }
+
+        public void surfaceDestroyed(SurfaceHolder holder)
+        {
+            // after we return from this we can't use the surface any more
+            mSurfaceHolder = null;
+            // The current Video View will be destroy when we play a new video.
+        }
+    };
+
+    public SurfaceView getSurfaceView() {
+        return mSurfaceView;
+    }
+
+    HTML5VideoFullScreen(Context context, int videoLayerId, int position,
+            boolean autoStart) {
+        mSurfaceView = new SurfaceView(context);
+        mFullScreenMode = FULLSCREEN_OFF;
+        init(videoLayerId, position, autoStart);
+    }
+
+    private void setMediaController(MediaController m) {
+        mMediaController  = m;
+        attachMediaController();
+    }
+
+    private void attachMediaController() {
+        if (mPlayer != null && mMediaController != null) {
+            mMediaController.setMediaPlayer(this);
+            mMediaController.setAnchorView(mSurfaceView);
+            //Will be enabled when prepared
+            mMediaController.setEnabled(false);
+        }
+    }
+
+    @Override
+    public void decideDisplayMode() {
+        mPlayer.setDisplay(mSurfaceHolder);
+    }
+
+    @Override
+    public void prepareForFullScreen() {
+        // So in full screen, we reset the MediaPlayer
+        mPlayer.reset();
+        setMediaController(new MediaController(mProxy.getContext()));
+
+        prepareDataAndDisplayMode(mProxy);
+    }
+
+
+    private void toggleMediaControlsVisiblity() {
+        if (mMediaController.isShowing()) {
+            mMediaController.hide();
+        } else {
+            mMediaController.show();
+        }
+    }
+
+    @Override
+    public void onPrepared(MediaPlayer mp) {
+        super.onPrepared(mp);
+
+        mSurfaceView.setOnTouchListener(this);
+        // Get the capabilities of the player for this stream
+        Metadata data = mp.getMetadata(MediaPlayer.METADATA_ALL,
+                MediaPlayer.BYPASS_METADATA_FILTER);
+        if (data != null) {
+            mCanPause = !data.has(Metadata.PAUSE_AVAILABLE)
+                    || data.getBoolean(Metadata.PAUSE_AVAILABLE);
+            mCanSeekBack = !data.has(Metadata.SEEK_BACKWARD_AVAILABLE)
+                    || data.getBoolean(Metadata.SEEK_BACKWARD_AVAILABLE);
+            mCanSeekForward = !data.has(Metadata.SEEK_FORWARD_AVAILABLE)
+                    || data.getBoolean(Metadata.SEEK_FORWARD_AVAILABLE);
+        } else {
+            mCanPause = mCanSeekBack = mCanSeekForward = true;
+        }
+
+        // mMediaController status depends on the Metadata result, so put it
+        // after reading the MetaData
+        if (mMediaController != null) {
+            mMediaController.setEnabled(true);
+            // If paused , should show the controller for ever!
+            if (getAutostart())
+                mMediaController.show();
+            else
+                mMediaController.show(0);
+        }
+
+        if (mProgressView != null) {
+            mProgressView.setVisibility(View.GONE);
+            mLayout.removeView(mProgressView);
+            mProgressView = null;
+        }
+    }
+
+
+    private final WebChromeClient.CustomViewCallback mCallback =
+        new WebChromeClient.CustomViewCallback() {
+            public void onCustomViewHidden() {
+                // It listens to SurfaceHolder.Callback.SurfaceDestroyed event
+                // which happens when the video view is detached from its parent
+                // view. This happens in the WebChromeClient before this method
+                // is invoked.
+                mTimer.cancel();
+                mTimer = null;
+
+                pauseAndDispatch(mProxy);
+
+                mLayout.removeView(getSurfaceView());
+
+                if (mProgressView != null) {
+                    mLayout.removeView(mProgressView);
+                    mProgressView = null;
+                }
+                mLayout = null;
+                // Re enable plugin views.
+                mProxy.getWebView().getViewManager().showAll();
+
+                mProxy = null;
+            }
+        };
+
+    @Override
+    public void enterFullScreenVideoState(int layerId,
+            HTML5VideoViewProxy proxy, WebView webView) {
+        mFullScreenMode = FULLSCREEN_SURFACECREATING;
+        mCurrentBufferPercentage = 0;
+        mPlayer.setOnBufferingUpdateListener(mBufferingUpdateListener);
+        mProxy = proxy;
+
+        mSurfaceView.getHolder().addCallback(mSHCallback);
+        mSurfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
+        mSurfaceView.setFocusable(true);
+        mSurfaceView.setFocusableInTouchMode(true);
+        mSurfaceView.requestFocus();
+
+        // Create a FrameLayout that will contain the VideoView and the
+        // progress view (if any).
+        mLayout = new FrameLayout(mProxy.getContext());
+        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
+                            ViewGroup.LayoutParams.WRAP_CONTENT,
+                            ViewGroup.LayoutParams.WRAP_CONTENT,
+                            Gravity.CENTER);
+
+        mLayout.addView(getSurfaceView(), layoutParams);
+
+        mLayout.setVisibility(View.VISIBLE);
+
+        WebChromeClient client = webView.getWebChromeClient();
+        client.onShowCustomView(mLayout, mCallback);
+        // Plugins like Flash will draw over the video so hide
+        // them while we're playing.
+        mProxy.getWebView().getViewManager().hideAll();
+
+        mProgressView = client.getVideoLoadingProgressView();
+        if (mProgressView != null) {
+            mLayout.addView(mProgressView, layoutParams);
+            mProgressView.setVisibility(View.VISIBLE);
+        }
+
+    }
+
+    /**
+     * @return true when we are in full screen mode, even the surface not fully
+     * created.
+     */
+    public boolean isFullScreenMode() {
+        return true;
+    }
+
+    // MediaController FUNCTIONS:
+    @Override
+    public boolean canPause() {
+        return mCanPause;
+    }
+
+    @Override
+    public boolean canSeekBackward() {
+        return mCanSeekBack;
+    }
+
+    @Override
+    public boolean canSeekForward() {
+        return mCanSeekForward;
+    }
+
+    @Override
+    public int getBufferPercentage() {
+        if (mPlayer != null) {
+            return mCurrentBufferPercentage;
+        }
+    return 0;
+    }
+
+    // Other listeners functions:
+    private MediaPlayer.OnBufferingUpdateListener mBufferingUpdateListener =
+        new MediaPlayer.OnBufferingUpdateListener() {
+        public void onBufferingUpdate(MediaPlayer mp, int percent) {
+            mCurrentBufferPercentage = percent;
+        }
+    };
+
+    @Override
+    public boolean onTouch(View v, MotionEvent event) {
+        if (mFullScreenMode >= FULLSCREEN_SURFACECREATED
+                && mMediaController != null) {
+            toggleMediaControlsVisiblity();
+        }
+        return false;
+    }
+
+}
diff --git a/core/java/android/webkit/HTML5VideoInline.java b/core/java/android/webkit/HTML5VideoInline.java
new file mode 100644
index 0000000..f1d9189
--- /dev/null
+++ b/core/java/android/webkit/HTML5VideoInline.java
@@ -0,0 +1,99 @@
+
+package android.webkit;
+
+import android.graphics.SurfaceTexture;
+import android.media.MediaPlayer;
+import android.webkit.HTML5VideoView;
+import android.webkit.HTML5VideoViewProxy;
+import android.opengl.GLES20;
+
+/**
+ * @hide This is only used by the browser
+ */
+public class HTML5VideoInline extends HTML5VideoView{
+
+    // Due to the fact that SurfaceTexture consume a lot of memory, we make it
+    // as static. m_textureNames is the texture bound with this SurfaceTexture.
+    private static SurfaceTexture mSurfaceTexture = null;
+    private static int[] mTextureNames;
+
+    // Only when the video is prepared, we render using SurfaceTexture.
+    // This in fact is used to avoid showing the obsolete content when
+    // switching videos.
+    private static boolean mReadyToUseSurfTex = false;
+
+    // Video control FUNCTIONS:
+    @Override
+    public void start() {
+        super.start();
+        if (mCurrentState == STATE_PREPARED) {
+            mReadyToUseSurfTex = true;
+        }
+    }
+
+    HTML5VideoInline(int videoLayerId, int position,
+            boolean autoStart) {
+        init(videoLayerId, position, autoStart);
+        mReadyToUseSurfTex = false;
+    }
+
+    @Override
+    public void decideDisplayMode() {
+        mPlayer.setTexture(getSurfaceTextureInstance());
+    }
+
+    // Normally called immediately after setVideoURI. But for full screen,
+    // this should be after surface holder created
+    @Override
+    public void prepareDataAndDisplayMode(HTML5VideoViewProxy proxy) {
+        super.prepareDataAndDisplayMode(proxy);
+        setFrameAvailableListener(proxy);
+    }
+
+    // Pause the play and update the play/pause button
+    @Override
+    public void pauseAndDispatch(HTML5VideoViewProxy proxy) {
+        super.pauseAndDispatch(proxy);
+        mReadyToUseSurfTex = false;
+    }
+
+    // Inline Video specific FUNCTIONS:
+
+    @Override
+    public SurfaceTexture getSurfaceTexture() {
+        return mSurfaceTexture;
+    }
+
+    @Override
+    public void deleteSurfaceTexture() {
+        mSurfaceTexture = null;
+        return;
+    }
+
+    // SurfaceTexture is a singleton here , too
+    private SurfaceTexture getSurfaceTextureInstance() {
+        // Create the surface texture.
+        if (mSurfaceTexture == null)
+        {
+            mTextureNames = new int[1];
+            GLES20.glGenTextures(1, mTextureNames, 0);
+            mSurfaceTexture = new SurfaceTexture(mTextureNames[0]);
+        }
+        return mSurfaceTexture;
+    }
+
+    @Override
+    public int getTextureName() {
+        return mTextureNames[0];
+    }
+
+    @Override
+    public boolean getReadyToUseSurfTex() {
+        return mReadyToUseSurfTex;
+    }
+
+    private void setFrameAvailableListener(SurfaceTexture.OnFrameAvailableListener l) {
+        mSurfaceTexture.setOnFrameAvailableListener(l);
+    }
+
+}
diff --git a/core/java/android/webkit/HTML5VideoView.java b/core/java/android/webkit/HTML5VideoView.java
index 2312160..ade7106 100644
--- a/core/java/android/webkit/HTML5VideoView.java
+++ b/core/java/android/webkit/HTML5VideoView.java
@@ -4,72 +4,93 @@
 import android.graphics.SurfaceTexture;
 import android.media.MediaPlayer;
 import android.util.Log;
+import android.view.SurfaceView;
 import android.webkit.HTML5VideoViewProxy;
-import android.widget.MediaController;
-import android.opengl.GLES20;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
 
 /**
  * @hide This is only used by the browser
  */
 public class HTML5VideoView implements MediaPlayer.OnPreparedListener{
-    // Due to the fact that SurfaceTexture consume a lot of memory, we make it
-    // as static. m_textureNames is the texture bound with this SurfaceTexture.
-    private static SurfaceTexture mSurfaceTexture = null;
-    private static int[] mTextureNames;
 
-    // Only when the video is prepared, we render using SurfaceTexture.
-    // This in fact is used to avoid showing the obsolete content when
-    // switching videos.
-    private static boolean mReadyToUseSurfTex = false;
+    protected static final String LOGTAG = "HTML5VideoView";
+
+    protected static final String COOKIE = "Cookie";
+    protected static final String HIDE_URL_LOGS = "x-hide-urls-from-log";
 
     // For handling the seekTo before prepared, we need to know whether or not
     // the video is prepared. Therefore, we differentiate the state between
     // prepared and not prepared.
     // When the video is not prepared, we will have to save the seekTo time,
     // and use it when prepared to play.
-    private static final int STATE_NOTPREPARED        = 0;
-    private static final int STATE_PREPARED           = 1;
+    protected static final int STATE_NOTPREPARED        = 0;
+    protected static final int STATE_PREPARED           = 1;
 
-    // We only need state for handling seekTo
-    private int mCurrentState;
+    protected int mCurrentState;
 
-    // Basically for calling back the OnPrepared in the proxy
-    private HTML5VideoViewProxy mProxy;
+    protected HTML5VideoViewProxy mProxy;
 
     // Save the seek time when not prepared. This can happen when switching
     // video besides initial load.
-    private int mSaveSeekTime;
+    protected int mSaveSeekTime;
 
     // This is used to find the VideoLayer on the native side.
-    private int mVideoLayerId;
+    protected int mVideoLayerId;
 
     // Every video will have one MediaPlayer. Given the fact we only have one
     // SurfaceTexture, there is only one MediaPlayer in action. Every time we
     // switch videos, a new instance of MediaPlayer will be created in reset().
-    private MediaPlayer mPlayer;
+    // Switching between inline and full screen will also create a new instance.
+    protected MediaPlayer mPlayer;
 
-    private static HTML5VideoView mInstance = new HTML5VideoView();
+    // This will be set up every time we create the Video View object.
+    // Set to true only when switching into full screen while playing
+    protected boolean mAutostart;
 
-    // Video control FUNCTIONS:
+    // We need to save such info.
+    protected String mUri;
+    protected Map<String, String> mHeaders;
+
+    // The timer for timeupate events.
+    // See http://www.whatwg.org/specs/web-apps/current-work/#event-media-timeupdate
+    protected static Timer mTimer;
+
+    // The spec says the timer should fire every 250 ms or less.
+    private static final int TIMEUPDATE_PERIOD = 250;  // ms
+
+    // common Video control FUNCTIONS:
     public void start() {
         if (mCurrentState == STATE_PREPARED) {
             mPlayer.start();
-            mReadyToUseSurfTex = true;
         }
     }
 
     public void pause() {
-        mPlayer.pause();
+        if (mCurrentState == STATE_PREPARED && mPlayer.isPlaying()) {
+            mPlayer.pause();
+        }
+        if (mTimer != null) {
+            mTimer.purge();
+        }
     }
 
     public int getDuration() {
-        return mPlayer.getDuration();
+        if (mCurrentState == STATE_PREPARED) {
+            return mPlayer.getDuration();
+        } else {
+            return -1;
+        }
     }
 
     public int getCurrentPosition() {
-        return mPlayer.getCurrentPosition();
+        if (mCurrentState == STATE_PREPARED) {
+            return mPlayer.getCurrentPosition();
+        }
+        return 0;
     }
 
     public void seekTo(int pos) {
@@ -88,53 +109,50 @@
     }
 
     public void stopPlayback() {
-        mPlayer.stop();
+        if (mCurrentState == STATE_PREPARED) {
+            mPlayer.stop();
+        }
     }
 
-    private void reset(int videoLayerId) {
+    public boolean getAutostart() {
+        return mAutostart;
+    }
+
+    // Every time we start a new Video, we create a VideoView and a MediaPlayer
+    public void init(int videoLayerId, int position, boolean autoStart) {
         mPlayer = new MediaPlayer();
         mCurrentState = STATE_NOTPREPARED;
         mProxy = null;
         mVideoLayerId = videoLayerId;
-        mReadyToUseSurfTex = false;
+        mSaveSeekTime = position;
+        mAutostart = autoStart;
     }
 
-    public static HTML5VideoView getInstance(int videoLayerId) {
-        // Every time we switch between the videos, a new MediaPlayer will be
-        // created. Make sure we call the m_player.release() when it is done.
-        mInstance.reset(videoLayerId);
-        return mInstance;
+    protected HTML5VideoView() {
     }
 
-    private HTML5VideoView() {
-        // This is a singleton across WebViews (i.e. Tabs).
-        // HTML5VideoViewProxy will reset the internal state every time a new
-        // video start.
-    }
-
-    public void setMediaController(MediaController m) {
-        this.setMediaController(m);
-    }
-
-    public void setVideoURI(String uri, Map<String, String> headers) {
-        // When switching players, surface texture will be reused.
-        mPlayer.setTexture(getSurfaceTextureInstance());
-
-        // When there is exception, we could just bail out silently.
-        // No Video will be played though. Write the stack for debug
-        try {
-            mPlayer.setDataSource(uri, headers);
-            mPlayer.prepareAsync();
-        } catch (IllegalArgumentException e) {
-            e.printStackTrace();
-        } catch (IllegalStateException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
+    protected static Map<String, String> generateHeaders(String url,
+            HTML5VideoViewProxy proxy) {
+        boolean isPrivate = proxy.getWebView().isPrivateBrowsingEnabled();
+        String cookieValue = CookieManager.getInstance().getCookie(url, isPrivate);
+        Map<String, String> headers = new HashMap<String, String>();
+        if (cookieValue != null) {
+            headers.put(COOKIE, cookieValue);
         }
+        if (isPrivate) {
+            headers.put(HIDE_URL_LOGS, "true");
+        }
+
+        return headers;
     }
 
-    // TODO [FULL SCREEN SUPPORT]
+    public void setVideoURI(String uri, HTML5VideoViewProxy proxy) {
+        // When switching players, surface texture will be reused.
+        mUri = uri;
+        mHeaders = generateHeaders(uri, proxy);
+
+        mTimer = new Timer();
+    }
 
     // Listeners setup FUNCTIONS:
     public void setOnCompletionListener(HTML5VideoViewProxy proxy) {
@@ -150,43 +168,47 @@
         mPlayer.setOnPreparedListener(this);
     }
 
-    // Inline Video specific FUNCTIONS:
+    // Normally called immediately after setVideoURI. But for full screen,
+    // this should be after surface holder created
+    public void prepareDataAndDisplayMode(HTML5VideoViewProxy proxy) {
+        // SurfaceTexture will be created lazily here for inline mode
+        decideDisplayMode();
 
-    public SurfaceTexture getSurfaceTexture() {
-        return mSurfaceTexture;
-    }
+        setOnCompletionListener(proxy);
+        setOnPreparedListener(proxy);
+        setOnErrorListener(proxy);
 
-    public void deleteSurfaceTexture() {
-        mSurfaceTexture = null;
-        return;
-    }
-
-    // SurfaceTexture is a singleton here , too
-    private SurfaceTexture getSurfaceTextureInstance() {
-        // Create the surface texture.
-        if (mSurfaceTexture == null)
-        {
-            mTextureNames = new int[1];
-            GLES20.glGenTextures(1, mTextureNames, 0);
-            mSurfaceTexture = new SurfaceTexture(mTextureNames[0]);
+        // When there is exception, we could just bail out silently.
+        // No Video will be played though. Write the stack for debug
+        try {
+            mPlayer.setDataSource(mUri, mHeaders);
+            mPlayer.prepareAsync();
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        } catch (IllegalStateException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
         }
-        return mSurfaceTexture;
     }
 
-    public int getTextureName() {
-        return mTextureNames[0];
-    }
 
+    // Common code
     public int getVideoLayerId() {
         return mVideoLayerId;
     }
 
-    public boolean getReadyToUseSurfTex() {
-        return mReadyToUseSurfTex;
-    }
+    private static final class TimeupdateTask extends TimerTask {
+        private HTML5VideoViewProxy mProxy;
 
-    public void setFrameAvailableListener(SurfaceTexture.OnFrameAvailableListener l) {
-        mSurfaceTexture.setOnFrameAvailableListener(l);
+        public TimeupdateTask(HTML5VideoViewProxy proxy) {
+            mProxy = proxy;
+        }
+
+        @Override
+        public void run() {
+            mProxy.onTimeupdate();
+        }
     }
 
     @Override
@@ -195,6 +217,9 @@
         seekTo(mSaveSeekTime);
         if (mProxy != null)
             mProxy.onPrepared(mp);
+
+        mTimer.schedule(new TimeupdateTask(mProxy), TIMEUPDATE_PERIOD, TIMEUPDATE_PERIOD);
+
     }
 
     // Pause the play and update the play/pause button
@@ -205,7 +230,42 @@
                 proxy.dispatchOnPaused();
             }
         }
-        mReadyToUseSurfTex = false;
+    }
+
+    // Below are functions that are different implementation on inline and full-
+    // screen mode. Some are specific to one type, but currently are called
+    // directly from the proxy.
+    public void enterFullScreenVideoState(int layerId,
+            HTML5VideoViewProxy proxy, WebView webView) {
+    }
+
+    public boolean isFullScreenMode() {
+        return false;
+    }
+
+    public SurfaceView getSurfaceView() {
+        return null;
+    }
+
+    public void decideDisplayMode() {
+    }
+
+    public void prepareForFullScreen() {
+    }
+
+    public boolean getReadyToUseSurfTex() {
+        return false;
+    }
+
+    public SurfaceTexture getSurfaceTexture() {
+        return null;
+    }
+
+    public void deleteSurfaceTexture() {
+    }
+
+    public int getTextureName() {
+        return 0;
     }
 
 }
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java
index b614d8f..d3fcfa5 100644
--- a/core/java/android/webkit/HTML5VideoViewProxy.java
+++ b/core/java/android/webkit/HTML5VideoViewProxy.java
@@ -21,29 +21,16 @@
 import android.graphics.BitmapFactory;
 import android.graphics.SurfaceTexture;
 import android.media.MediaPlayer;
-import android.media.MediaPlayer.OnPreparedListener;
-import android.media.MediaPlayer.OnCompletionListener;
-import android.media.MediaPlayer.OnErrorListener;
 import android.net.http.EventHandler;
 import android.net.http.Headers;
 import android.net.http.RequestHandle;
 import android.net.http.RequestQueue;
 import android.net.http.SslCertificate;
 import android.net.http.SslError;
-import android.net.Uri;
-import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
 import android.util.Log;
-import android.view.MotionEvent;
-import android.view.Gravity;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AbsoluteLayout;
-import android.widget.FrameLayout;
-import android.widget.MediaController;
-import android.widget.VideoView;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -51,8 +38,6 @@
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
 
 /**
  * <p>Proxy for HTML5 video views.
@@ -78,9 +63,6 @@
     private static final int POSTER_FETCHED    = 202;
     private static final int PAUSED            = 203;
 
-    private static final String COOKIE = "Cookie";
-    private static final String HIDE_URL_LOGS = "x-hide-urls-from-log";
-
     // Timer thread -> UI thread
     private static final int TIMEUPDATE = 300;
 
@@ -104,38 +86,19 @@
         // The VideoView instance. This is a singleton for now, at least until
         // http://b/issue?id=1973663 is fixed.
         private static HTML5VideoView mHTML5VideoView;
-        // The progress view.
-        private static View mProgressView;
-        // The container for the progress view and video view
-        private static FrameLayout mLayout;
-        // The timer for timeupate events.
-        // See http://www.whatwg.org/specs/web-apps/current-work/#event-media-timeupdate
-        private static Timer mTimer;
-        private static final class TimeupdateTask extends TimerTask {
-            private HTML5VideoViewProxy mProxy;
 
-            public TimeupdateTask(HTML5VideoViewProxy proxy) {
-                mProxy = proxy;
-            }
-
-            public void run() {
-                mProxy.onTimeupdate();
-            }
-        }
-        // The spec says the timer should fire every 250 ms or less.
-        private static final int TIMEUPDATE_PERIOD = 250;  // ms
         private static boolean isVideoSelfEnded = false;
         // By using the baseLayer and the current video Layer ID, we can
         // identify the exact layer on the UI thread to use the SurfaceTexture.
         private static int mBaseLayer = 0;
 
-        // TODO: [FULL SCREEN SUPPORT]
-
         // Every time webView setBaseLayer, this will be called.
         // When we found the Video layer, then we set the Surface Texture to it.
         // Otherwise, we may want to delete the Surface Texture to save memory.
         public static void setBaseLayer(int layer) {
-            if (mHTML5VideoView != null) {
+            // Don't do this for full screen mode.
+            if (mHTML5VideoView != null
+                    && !mHTML5VideoView.isFullScreenMode()) {
                 mBaseLayer = layer;
                 SurfaceTexture surfTexture = mHTML5VideoView.getSurfaceTexture();
                 int textureName = mHTML5VideoView.getTextureName();
@@ -165,16 +128,47 @@
             }
         }
 
+        public static void enterFullScreenVideo(int layerId, String url,
+                HTML5VideoViewProxy proxy, WebView webView) {
+                // Save the inline video info and inherit it in the full screen
+                int savePosition = 0;
+                boolean savedIsPlaying = false;
+                if (mHTML5VideoView != null) {
+                    // If we are playing the same video, then it is better to
+                    // save the current position.
+                    if (layerId == mHTML5VideoView.getVideoLayerId()) {
+                        savePosition = mHTML5VideoView.getCurrentPosition();
+                        savedIsPlaying = mHTML5VideoView.isPlaying();
+                    }
+                    mHTML5VideoView.pauseAndDispatch(mCurrentProxy);
+                    mHTML5VideoView.release();
+                }
+                mHTML5VideoView = new HTML5VideoFullScreen(proxy.getContext(),
+                        layerId, savePosition, savedIsPlaying);
+                mCurrentProxy = proxy;
+
+                mHTML5VideoView.setVideoURI(url, mCurrentProxy);
+
+                mHTML5VideoView.enterFullScreenVideoState(layerId, proxy, webView);
+        }
+
         // This is on the UI thread.
         // When native tell Java to play, we need to check whether or not it is
         // still the same video by using videoLayerId and treat it differently.
         public static void play(String url, int time, HTML5VideoViewProxy proxy,
                 WebChromeClient client, int videoLayerId) {
             int currentVideoLayerId = -1;
-            if (mHTML5VideoView != null)
-                currentVideoLayerId = mHTML5VideoView.getVideoLayerId();
+            boolean backFromFullScreenMode = false;
 
-            if (currentVideoLayerId != videoLayerId
+            if (mHTML5VideoView != null) {
+                currentVideoLayerId = mHTML5VideoView.getVideoLayerId();
+                if (mHTML5VideoView instanceof HTML5VideoFullScreen) {
+                    backFromFullScreenMode = true;
+                }
+            }
+
+            if (backFromFullScreenMode
+                ||  currentVideoLayerId != videoLayerId
                 || mHTML5VideoView.getSurfaceTexture() == null) {
                 // Here, we handle the case when switching to a new video,
                 // either inside a WebView or across WebViews
@@ -186,35 +180,11 @@
                     // release the media player to avoid finalize error
                     mHTML5VideoView.release();
                 }
-                // HTML5VideoView is singleton, however, the internal state will
-                // be reset since we are switching from one video to another.
-                // Then we need to set up all the source/listener etc...
-                mHTML5VideoView = HTML5VideoView.getInstance(videoLayerId);
-
                 mCurrentProxy = proxy;
+                mHTML5VideoView = new HTML5VideoInline(videoLayerId, time, false);
 
-                // TODO: [FULL SCREEN SUPPORT]
-
-                boolean isPrivate = mCurrentProxy.getWebView().isPrivateBrowsingEnabled();
-                String cookieValue = CookieManager.getInstance().getCookie(url, isPrivate);
-                Map<String, String> headers = new HashMap<String, String>();
-                if (cookieValue != null) {
-                    headers.put(COOKIE, cookieValue);
-                }
-                if (isPrivate) {
-                    headers.put(HIDE_URL_LOGS, "true");
-                }
-
-                mHTML5VideoView.setVideoURI(url, headers);
-                mHTML5VideoView.setOnCompletionListener(proxy);
-                mHTML5VideoView.setOnPreparedListener(proxy);
-                mHTML5VideoView.setOnErrorListener(proxy);
-                mHTML5VideoView.setFrameAvailableListener(proxy);
-
-                mHTML5VideoView.seekTo(time);
-
-                mTimer = new Timer();
-
+                mHTML5VideoView.setVideoURI(url, mCurrentProxy);
+                mHTML5VideoView.prepareDataAndDisplayMode(proxy);
             } else if (mCurrentProxy == proxy) {
                 // Here, we handle the case when we keep playing with one video
                 if (!mHTML5VideoView.isPlaying()) {
@@ -222,7 +192,8 @@
                     mHTML5VideoView.start();
                 }
             } else if (mCurrentProxy != null) {
-                // Some other video is already playing. Notify the caller that its playback ended.
+                // Some other video is already playing. Notify the caller that
+                // its playback ended.
                 proxy.dispatchOnEnded();
             }
         }
@@ -249,14 +220,14 @@
         public static void pause(HTML5VideoViewProxy proxy) {
             if (mCurrentProxy == proxy && mHTML5VideoView != null) {
                 mHTML5VideoView.pause();
-                mTimer.purge();
             }
         }
 
         public static void onPrepared() {
-            mHTML5VideoView.start();
-            mTimer.schedule(new TimeupdateTask(mCurrentProxy), TIMEUPDATE_PERIOD, TIMEUPDATE_PERIOD);
-            // TODO: [FULL SCREEN SUPPORT]
+            if (!mHTML5VideoView.isFullScreenMode() ||
+                    mHTML5VideoView.isFullScreenMode() &&
+                    mHTML5VideoView.getAutostart() )
+                mHTML5VideoView.start();
         }
 
         public static void end() {
@@ -349,8 +320,6 @@
                     VideoPlayer.isVideoSelfEnded = true;
                 VideoPlayer.end();
                 break;
-                // TODO: [FULL SCREEN SUPPORT]
-                // For full screen case, end may need hide the view.
             case ERROR: {
                 WebChromeClient client = mWebView.getWebChromeClient();
                 if (client != null) {
@@ -665,7 +634,7 @@
         mPosterDownloader.start();
     }
 
-    // These two function are called from UI thread only by WebView.
+    // These three function are called from UI thread only by WebView.
     public void setBaseLayer(int layer) {
         VideoPlayer.setBaseLayer(layer);
     }
@@ -673,6 +642,11 @@
     public void pauseAndDispatch() {
         VideoPlayer.pauseAndDispatch();
     }
+
+    public void enterFullScreenVideo(int layerId, String url) {
+        VideoPlayer.enterFullScreenVideo(layerId, url, this, mWebView);
+    }
+
     /**
      * The factory for HTML5VideoViewProxy instances.
      * @param webViewCore is the WebViewCore that is requesting the proxy.
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 3fb878c..01c73a8 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4134,8 +4134,11 @@
         if (mNativeClass != 0 && nativeEvaluateLayersAnimations()) {
             UIAnimationsRunning = true;
             // If we have unfinished (or unstarted) animations,
-            // we ask for a repaint.
-            invalidate();
+            // we ask for a repaint. We only need to do this in software
+            // rendering (with hardware rendering we already have a different
+            // method of requesting a repaint)
+            if (!canvas.isHardwareAccelerated())
+                invalidate();
         }
 
         // decide which adornments to draw
@@ -7182,14 +7185,15 @@
     private class TouchEventQueue {
         private long mNextTouchSequence = Long.MIN_VALUE + 1;
         private long mLastHandledTouchSequence = Long.MIN_VALUE;
-        private long mIgnoreUntilSequence = Long.MIN_VALUE;
+        private long mIgnoreUntilSequence = Long.MIN_VALUE + 1;
         private QueuedTouch mTouchEventQueue;
         private QueuedTouch mQueuedTouchRecycleBin;
         private int mQueuedTouchRecycleCount;
+        private long mLastEventTime = Long.MAX_VALUE;
         private static final int MAX_RECYCLED_QUEUED_TOUCH = 15;
 
         // milliseconds until we abandon hope of getting all of a previous gesture
-        private static final int QUEUED_GESTURE_TIMEOUT = 2000;
+        private static final int QUEUED_GESTURE_TIMEOUT = 1000;
 
         private QueuedTouch obtainQueuedTouch() {
             if (mQueuedTouchRecycleBin != null) {
@@ -7223,7 +7227,7 @@
         public void reset() {
             mNextTouchSequence = Long.MIN_VALUE + 1;
             mLastHandledTouchSequence = Long.MIN_VALUE;
-            mIgnoreUntilSequence = Long.MIN_VALUE;
+            mIgnoreUntilSequence = Long.MIN_VALUE + 1;
             while (mTouchEventQueue != null) {
                 QueuedTouch recycleMe = mTouchEventQueue;
                 mTouchEventQueue = mTouchEventQueue.mNext;
@@ -7257,7 +7261,9 @@
                 return;
             }
 
-            dropStaleGestures(ted.mMotionEvent, ted.mSequence);
+            if (dropStaleGestures(ted.mMotionEvent, ted.mSequence)) {
+                return;
+            }
 
             if (mLastHandledTouchSequence + 1 == ted.mSequence) {
                 handleQueuedTouchEventData(ted);
@@ -7292,7 +7298,9 @@
         public void enqueueTouchEvent(MotionEvent ev) {
             final long sequence = nextTouchSequence();
 
-            dropStaleGestures(ev, sequence);
+            if (dropStaleGestures(ev, sequence)) {
+                return;
+            }
 
             if (mLastHandledTouchSequence + 1 == sequence) {
                 handleQueuedMotionEvent(ev);
@@ -7315,16 +7323,30 @@
             }
         }
 
-        private void dropStaleGestures(MotionEvent ev, long sequence) {
-            if (mTouchEventQueue == null) return;
+        private boolean dropStaleGestures(MotionEvent ev, long sequence) {
+            if (ev != null && ev.getAction() == MotionEvent.ACTION_MOVE && !mConfirmMove) {
+                // This is to make sure that we don't attempt to process a tap
+                // or long press when webkit takes too long to get back to us.
+                // The movement will be properly confirmed when we process the
+                // enqueued event later.
+                final int dx = Math.round(ev.getX()) - mLastTouchX;
+                final int dy = Math.round(ev.getY()) - mLastTouchY;
+                if (dx * dx + dy * dy > mTouchSlopSquare) {
+                    mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
+                    mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
+                }
+            }
 
-            MotionEvent nextQueueEvent = mTouchEventQueue.mTed != null ?
-                    mTouchEventQueue.mTed.mMotionEvent : mTouchEventQueue.mEvent;
+            if (mTouchEventQueue == null) {
+                return sequence <= mLastHandledTouchSequence;
+            }
 
-            if (ev != null && ev.getAction() == MotionEvent.ACTION_DOWN && nextQueueEvent != null) {
+            // If we have a new down event and it's been a while since the last event
+            // we saw, just reset and keep going.
+            if (ev != null && ev.getAction() == MotionEvent.ACTION_DOWN) {
                 long eventTime = ev.getEventTime();
-                long nextQueueTime = nextQueueEvent.getEventTime();
-                if (eventTime > nextQueueTime + QUEUED_GESTURE_TIMEOUT) {
+                long lastHandledEventTime = mLastEventTime;
+                if (eventTime > lastHandledEventTime + QUEUED_GESTURE_TIMEOUT) {
                     Log.w(LOGTAG, "Got ACTION_DOWN but still waiting on stale event. " +
                             "Ignoring previous queued events.");
                     QueuedTouch qd = mTouchEventQueue;
@@ -7338,17 +7360,18 @@
                 }
             }
 
-            if (mIgnoreUntilSequence > mLastHandledTouchSequence) {
+            if (mIgnoreUntilSequence - 1 > mLastHandledTouchSequence) {
                 QueuedTouch qd = mTouchEventQueue;
-                while (qd != null && qd.mSequence < mIgnoreUntilSequence &&
-                        qd.mSequence < sequence) {
-                    mLastHandledTouchSequence = qd.mSequence;
+                while (qd != null && qd.mSequence < mIgnoreUntilSequence) {
                     QueuedTouch recycleMe = qd;
                     qd = qd.mNext;
                     recycleQueuedTouch(recycleMe);
                 }
                 mTouchEventQueue = qd;
+                mLastHandledTouchSequence = mIgnoreUntilSequence - 1;
             }
+
+            return sequence <= mLastHandledTouchSequence;
         }
 
         private void handleQueuedTouch(QueuedTouch qt) {
@@ -7361,6 +7384,7 @@
         }
 
         private void handleQueuedMotionEvent(MotionEvent ev) {
+            mLastEventTime = ev.getEventTime();
             int action = ev.getActionMasked();
             if (ev.getPointerCount() > 1) {  // Multi-touch
                 handleMultiTouchInWebView(ev);
@@ -7378,6 +7402,9 @@
         }
 
         private void handleQueuedTouchEventData(TouchEventData ted) {
+            if (ted.mMotionEvent != null) {
+                mLastEventTime = ted.mMotionEvent.getEventTime();
+            }
             if (!ted.mReprocess) {
                 if (ted.mAction == MotionEvent.ACTION_DOWN
                         && mPreventDefault == PREVENT_DEFAULT_MAYBE_YES) {
@@ -7857,7 +7884,11 @@
 
                 case ENTER_FULLSCREEN_VIDEO:
                     int layerId = msg.arg1;
-                    Log.v(LOGTAG, "Display the video layer " + layerId + " fullscreen");
+
+                    String url = (String) msg.obj;
+                    if (mHTML5VideoViewProxy != null) {
+                        mHTML5VideoViewProxy.enterFullScreenVideo(layerId, url);
+                    }
                     break;
 
                 case SHOW_FULLSCREEN: {
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index bed77ef..3b989dc 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -483,10 +483,12 @@
     /**
      * Notify the webview that we want to display the video layer fullscreen.
      */
-    protected void enterFullscreenForVideoLayer(int layerId) {
+    protected void enterFullscreenForVideoLayer(int layerId, String url) {
         if (mWebView == null) return;
-        Message.obtain(mWebView.mPrivateHandler,
-                       WebView.ENTER_FULLSCREEN_VIDEO, layerId, 0).sendToTarget();
+        Message message = Message.obtain(mWebView.mPrivateHandler,
+                       WebView.ENTER_FULLSCREEN_VIDEO, layerId, 0);
+        message.obj = url;
+        message.sendToTarget();
     }
 
     //-------------------------------------------------------------------------
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 818b03c..ca27ac7 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -464,7 +464,7 @@
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"modifier/supprimer le contenu de la carte SD"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6594393334785738252">"Autorise une application à écrire sur la mémoire USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="6643963204976471878">"Autorise une application à écrire sur la carte SD."</string>
-    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modif./suppr. contenu mémoire interne support"</string>
+    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modif./suppr. contenu mémoire interne"</string>
     <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Permet à une application de modifier le contenu de la mémoire de stockage interne du support."</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"accéder au système de fichiers en cache"</string>
     <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"Permet à une application de lire et d\'écrire dans le système de fichiers en cache."</string>
@@ -923,7 +923,7 @@
     <string name="ext_media_badremoval_notification_title" product="default" msgid="6872152882604407837">"Carte SD retirée inopinément"</string>
     <string name="ext_media_badremoval_notification_message" product="nosdcard" msgid="4329848819865594241">"Désinstaller la mémoire de stockage USB avant de la retirer pour éviter toute perte de données."</string>
     <string name="ext_media_badremoval_notification_message" product="default" msgid="7260183293747448241">"Désinstaller la carte SD avant de la retirer pour éviter toute perte de données."</string>
-    <string name="ext_media_safe_unmount_notification_title" product="nosdcard" msgid="3967973893270360230">"La mémoire de stockage USB peut être retirée en toute sécurité."</string>
+    <string name="ext_media_safe_unmount_notification_title" product="nosdcard" msgid="3967973893270360230">"Vous pouvez retirer la mémoire USB."</string>
     <string name="ext_media_safe_unmount_notification_title" product="default" msgid="6729801130790616200">"La carte SD peut être retirée en toute sécurité"</string>
     <string name="ext_media_safe_unmount_notification_message" product="nosdcard" msgid="6142195361606493530">"Vous pouvez retirer la mémoire de stockage USB en toute sécurité."</string>
     <string name="ext_media_safe_unmount_notification_message" product="default" msgid="568841278138377604">"Vous pouvez retirer la carte SD en toute sécurité."</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index b2cedd8..10a2898 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -464,8 +464,8 @@
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"изменять/удалять содержимое SD-карты"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6594393334785738252">"Разрешает приложению запись на USB-накопитель."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="6643963204976471878">"Разрешает приложению запись на SD-карту"</string>
-    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"изм./удал. содерж. мультимедиа"</string>
-    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Позволяет приложению изменять содержание внутреннего хранилища мультимедиа."</string>
+    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"изменение/удаление данных из внутреннего хранилища мультимедиа"</string>
+    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Приложение сможет изменять содержание внутреннего хранилища мультимедиа."</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"получать доступ к кэшу файловой системы"</string>
     <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"Разрешает программам доступ для записи и чтения к кэшу файловой системы."</string>
     <string name="permlab_use_sip" msgid="5986952362795870502">"совершать и принимать интернет-вызовы"</string>
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 1b10c5c..b51279a 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -83,17 +83,17 @@
                  int alphaMin, int alphaPref,
                  int depthMin, int depthPref,
                  int stencilMin, int stencilPref,
-                 int samplesMin, int samplesPref, float samplesQ);
+                 int samplesMin, int samplesPref, float samplesQ, int dpi);
     synchronized int nContextCreateGL(int dev, int ver,
                  int colorMin, int colorPref,
                  int alphaMin, int alphaPref,
                  int depthMin, int depthPref,
                  int stencilMin, int stencilPref,
-                 int samplesMin, int samplesPref, float samplesQ) {
+                 int samplesMin, int samplesPref, float samplesQ, int dpi) {
         return rsnContextCreateGL(dev, ver, colorMin, colorPref,
                                   alphaMin, alphaPref, depthMin, depthPref,
                                   stencilMin, stencilPref,
-                                  samplesMin, samplesPref, samplesQ);
+                                  samplesMin, samplesPref, samplesQ, dpi);
     }
     native int  rsnContextCreate(int dev, int ver);
     synchronized int nContextCreate(int dev, int ver) {
diff --git a/graphics/java/android/renderscript/RenderScriptGL.java b/graphics/java/android/renderscript/RenderScriptGL.java
index 4359795..d4b5434 100644
--- a/graphics/java/android/renderscript/RenderScriptGL.java
+++ b/graphics/java/android/renderscript/RenderScriptGL.java
@@ -165,13 +165,14 @@
         mWidth = 0;
         mHeight = 0;
         mDev = nDeviceCreate();
+        int dpi = ctx.getResources().getDisplayMetrics().densityDpi;
         mContext = nContextCreateGL(mDev, 0,
                                     mSurfaceConfig.mColorMin, mSurfaceConfig.mColorPref,
                                     mSurfaceConfig.mAlphaMin, mSurfaceConfig.mAlphaPref,
                                     mSurfaceConfig.mDepthMin, mSurfaceConfig.mDepthPref,
                                     mSurfaceConfig.mStencilMin, mSurfaceConfig.mStencilPref,
                                     mSurfaceConfig.mSamplesMin, mSurfaceConfig.mSamplesPref,
-                                    mSurfaceConfig.mSamplesQ);
+                                    mSurfaceConfig.mSamplesQ, dpi);
         if (mContext == 0) {
             throw new RSDriverException("Failed to create RS context.");
         }
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index f86343a..2afd74c 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -164,7 +164,8 @@
                  int alphaMin, int alphaPref,
                  int depthMin, int depthPref,
                  int stencilMin, int stencilPref,
-                 int samplesMin, int samplesPref, float samplesQ)
+                 int samplesMin, int samplesPref, float samplesQ,
+                 int dpi)
 {
     RsSurfaceConfig sc;
     sc.alphaMin = alphaMin;
@@ -178,7 +179,7 @@
     sc.samplesQ = samplesQ;
 
     LOG_API("nContextCreateGL");
-    return (jint)rsContextCreateGL((RsDevice)dev, ver, sc);
+    return (jint)rsContextCreateGL((RsDevice)dev, ver, sc, dpi);
 }
 
 static void
@@ -1213,7 +1214,7 @@
 
 // All methods below are thread protected in java.
 {"rsnContextCreate",                 "(II)I",                                 (void*)nContextCreate },
-{"rsnContextCreateGL",               "(IIIIIIIIIIIIF)I",                      (void*)nContextCreateGL },
+{"rsnContextCreateGL",               "(IIIIIIIIIIIIFI)I",                     (void*)nContextCreateGL },
 {"rsnContextFinish",                 "(I)V",                                  (void*)nContextFinish },
 {"rsnContextSetPriority",            "(II)V",                                 (void*)nContextSetPriority },
 {"rsnContextSetSurface",             "(IIILandroid/view/Surface;)V",          (void*)nContextSetSurface },
diff --git a/include/utils/Functor.h b/include/utils/Functor.h
index 565f4a3..e24ded4 100644
--- a/include/utils/Functor.h
+++ b/include/utils/Functor.h
@@ -25,8 +25,7 @@
 public:
     Functor() {}
     virtual ~Functor() {}
-    virtual status_t operator ()() { return true; }
-    virtual status_t operator ()(float* data, uint32_t len) { return true; }
+    virtual status_t operator ()(int what, void* data) { return NO_ERROR; }
 };
 
 }; // namespace android
diff --git a/include/utils/Vector.h b/include/utils/Vector.h
index ec851bd..6fd307f 100644
--- a/include/utils/Vector.h
+++ b/include/utils/Vector.h
@@ -162,6 +162,9 @@
      inline status_t        sort(compar_t cmp);
      inline status_t        sort(compar_r_t cmp, void* state);
 
+     // for debugging only
+     inline size_t getItemSize() const { return itemSize(); }
+
 protected:
     virtual void    do_construct(void* storage, size_t num) const;
     virtual void    do_destroy(void* storage, size_t num) const;
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index e01e072..d265804 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -216,21 +216,41 @@
         setScissorFromClip();
     }
 
+    Rect clip(*mSnapshot->clipRect);
+    clip.snapToPixelBoundaries();
+
 #if RENDER_LAYERS_AS_REGIONS
     // Since we don't know what the functor will draw, let's dirty
     // tne entire clip region
     if (hasLayer()) {
-        Rect clip(*mSnapshot->clipRect);
-        clip.snapToPixelBoundaries();
         dirtyLayerUnchecked(clip, getRegion());
     }
 #endif
 
-    float bounds[4];
-    status_t result = (*functor)(&bounds[0], 4);
+    struct {
+        // Input: current clip rect
+        int clipLeft;
+        int clipTop;
+        int clipRight;
+        int clipBottom;
+
+        // Output: dirty region to redraw
+        float dirtyLeft;
+        float dirtyTop;
+        float dirtyRight;
+        float dirtyBottom;
+    } constraints;
+
+    constraints.clipLeft = clip.left;
+    constraints.clipTop = clip.top;
+    constraints.clipRight = clip.right;
+    constraints.clipBottom = clip.bottom;
+
+    status_t result = (*functor)(0, &constraints);
 
     if (result != 0) {
-        Rect localDirty(bounds[0], bounds[1], bounds[2], bounds[3]);
+        Rect localDirty(constraints.dirtyLeft, constraints.dirtyTop,
+                constraints.dirtyRight, constraints.dirtyBottom);
         dirty.unionWith(localDirty);
     }
 
diff --git a/libs/rs/RenderScript.h b/libs/rs/RenderScript.h
index bb5e4aa..ffa9a8c 100644
--- a/libs/rs/RenderScript.h
+++ b/libs/rs/RenderScript.h
@@ -76,7 +76,8 @@
 void rsDeviceSetConfig(RsDevice, RsDeviceParam, int32_t value);
 
 RsContext rsContextCreate(RsDevice, uint32_t version);
-RsContext rsContextCreateGL(RsDevice, uint32_t version, RsSurfaceConfig sc);
+RsContext rsContextCreateGL(RsDevice, uint32_t version,
+                            RsSurfaceConfig sc, uint32_t dpi);
 void rsContextDestroy(RsContext);
 
 enum RsMessageToClientType {
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp
index f9e29f1..c63d183 100644
--- a/libs/rs/rsContext.cpp
+++ b/libs/rs/rsContext.cpp
@@ -630,6 +630,7 @@
     mPaused = false;
     mObjHead = NULL;
     mError = RS_ERROR_NONE;
+    mDPI = 96;
 }
 
 Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc) {
@@ -1078,10 +1079,12 @@
     return rsc;
 }
 
-RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, RsSurfaceConfig sc) {
+RsContext rsContextCreateGL(RsDevice vdev, uint32_t version,
+                            RsSurfaceConfig sc, uint32_t dpi) {
     LOGV("rsContextCreateGL %p", vdev);
     Device * dev = static_cast<Device *>(vdev);
     Context *rsc = Context::createContext(dev, &sc);
+    rsc->setDPI(dpi);
     LOGV("rsContextCreateGL ret %p ", rsc);
     return rsc;
 }
diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h
index c5e32a6..50f63df 100644
--- a/libs/rs/rsContext.h
+++ b/libs/rs/rsContext.h
@@ -218,6 +218,8 @@
 
     void launchThreads(WorkerCallback_t cbk, void *data);
     uint32_t getWorkerPoolSize() const {return (uint32_t)mWorkers.mCount;}
+    uint32_t getDPI() const {return mDPI;}
+    void setDPI(uint32_t dpi) {mDPI = dpi;}
 
 protected:
     Device *mDev;
@@ -258,6 +260,7 @@
         float EXT_texture_max_aniso;
     } mGL;
 
+    uint32_t mDPI;
     uint32_t mWidth;
     uint32_t mHeight;
     int32_t mThreadPriority;
diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp
index 1c1bc98..01dbab8 100644
--- a/libs/rs/rsFont.cpp
+++ b/libs/rs/rsFont.cpp
@@ -733,7 +733,7 @@
             String8 fullPath(getenv("ANDROID_ROOT"));
             fullPath += fontsDir;
 
-            mDefault.set(Font::create(mRSC, fullPath.string(), 16, 96));
+            mDefault.set(Font::create(mRSC, fullPath.string(), 8, mRSC->getDPI()));
         }
         currentFont = mDefault.get();
     }
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index 1994f6a..a060a5f 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -56,6 +56,9 @@
 Region::Region(const Region& rhs)
     : mBounds(rhs.mBounds), mStorage(rhs.mStorage)
 {
+#if VALIDATE_REGIONS
+    validate(rhs, "rhs copy-ctor");
+#endif
 }
 
 Region::Region(const Rect& rhs)
@@ -76,7 +79,8 @@
 Region& Region::operator = (const Region& rhs)
 {
 #if VALIDATE_REGIONS
-    validate(rhs, "operator=");
+    validate(*this, "this->operator=");
+    validate(rhs, "rhs.operator=");
 #endif
     mBounds = rhs.mBounds;
     mStorage = rhs.mStorage;
@@ -366,6 +370,12 @@
         const Region& lhs,
         const Region& rhs, int dx, int dy)
 {
+#if VALIDATE_REGIONS
+    validate(lhs, "boolean_operation (before): lhs");
+    validate(rhs, "boolean_operation (before): rhs");
+    validate(dst, "boolean_operation (before): dst");
+#endif
+
     size_t lhs_count;
     Rect const * const lhs_rects = lhs.getArray(&lhs_count);
 
diff --git a/media/java/android/media/videoeditor/VideoEditorImpl.java b/media/java/android/media/videoeditor/VideoEditorImpl.java
index 78557ee..2105deb 100755
--- a/media/java/android/media/videoeditor/VideoEditorImpl.java
+++ b/media/java/android/media/videoeditor/VideoEditorImpl.java
@@ -904,6 +904,10 @@
             throw new IllegalArgumentException("Surface could not be retrieved from Surface holder");
         }
 
+        if (surface.isValid() == false) {
+            throw new IllegalStateException("Surface is not valid");
+        }
+
         if (timeMs < 0) {
             throw new IllegalArgumentException("requested time not correct");
         } else if (timeMs > mDurationMs) {
@@ -1627,6 +1631,10 @@
             throw new IllegalArgumentException("Surface could not be retrieved from surface holder");
         }
 
+        if (surface.isValid() == false) {
+            throw new IllegalStateException("Surface is not valid");
+        }
+
         if (listener == null) {
             throw new IllegalArgumentException();
         }
@@ -1863,6 +1871,10 @@
             throw new IllegalArgumentException("Surface could not be retrieved from surface holder");
         }
 
+        if (surface.isValid() == false) {
+            throw new IllegalStateException("Surface is not valid");
+        }
+
         if (mMANativeHelper != null) {
             mMANativeHelper.clearPreviewSurface(surface);
         } else {
diff --git a/media/java/android/mtp/MtpServer.java b/media/java/android/mtp/MtpServer.java
index fe734e1..006fa6d 100644
--- a/media/java/android/mtp/MtpServer.java
+++ b/media/java/android/mtp/MtpServer.java
@@ -24,6 +24,9 @@
  */
 public class MtpServer {
 
+    private final Object mLock = new Object();
+    private boolean mStarted;
+
     private static final String TAG = "MtpServer";
 
     static {
@@ -35,11 +38,19 @@
     }
 
     public void start() {
-        native_start();
+        synchronized (mLock) {
+            native_start();
+            mStarted = true;
+        }
     }
 
     public void stop() {
-        native_stop();
+        synchronized (mLock) {
+            if (mStarted) {
+                native_stop();
+                mStarted = false;
+            }
+        }
     }
 
     public void sendObjectAdded(int handle) {
diff --git a/media/jni/mediaeditor/VideoEditorMain.cpp b/media/jni/mediaeditor/VideoEditorMain.cpp
index 8cda14e..11e2a5e 100755
--- a/media/jni/mediaeditor/VideoEditorMain.cpp
+++ b/media/jni/mediaeditor/VideoEditorMain.cpp
@@ -557,6 +557,10 @@
 
     Surface* const p = (Surface*)pEnv->GetIntField(surface, surface_native);
     sp<Surface> previewSurface = sp<Surface>(p);
+    // Validate the mSurface's mNativeSurface field
+    videoEditJava_checkAndThrowIllegalStateException(&needToBeLoaded, pEnv,
+                                                (NULL == previewSurface.get()),
+                                                "mNativeSurface is null");
 
     frameStr.pBuffer = M4OSA_NULL;
     frameStr.timeMs = 0;
@@ -634,6 +638,10 @@
 
     Surface* const p = (Surface*)pEnv->GetIntField(mSurface, surface_native);
     sp<Surface> previewSurface = sp<Surface>(p);
+    // Validate the mSurface's mNativeSurface field
+    videoEditJava_checkAndThrowIllegalStateException(&needToBeLoaded, pEnv,
+                                                (NULL == previewSurface.get()),
+                                                "mNativeSurface is null");
 
     /* Determine the total number of clips, total duration*/
     uiNumberOfClipsInStoryBoard = pContext->pEditSettings->uiClipNumber;
@@ -2058,6 +2066,10 @@
     Surface* const p = (Surface*)pEnv->GetIntField(mSurface, surface_native);
 
     sp<Surface> previewSurface = sp<Surface>(p);
+    // Validate the mSurface's mNativeSurface field
+    videoEditJava_checkAndThrowIllegalStateException(&needToBeLoaded, pEnv,
+                                                (NULL == previewSurface.get()),
+                                                "mNativeSurface is null");
 
     result =  pContext->mPreviewController->setSurface(previewSurface);
     videoEditJava_checkAndThrowRuntimeException(&needToBeLoaded, pEnv,
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java
index 0183b5d..beb2927 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java
@@ -17,9 +17,13 @@
 package com.android.mediaframeworktest;
 
 import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Writer;
 
 import android.os.Debug;
 import android.os.Environment;
+import android.util.Log;
 
 /**
  *
@@ -30,10 +34,13 @@
     private MediaTestUtil(){
     }
 
+    private static String TAG = "MediaTestUtil";
     private static final String STORAGE_PATH =
         Environment.getExternalStorageDirectory().toString();
+    private static int mMediaStartMemory = 0;
+    private static int mDrmStartMemory = 0;
 
-    //Catpure the heapdump for memory leaksage analysis\
+    //Catpure the heapdump for memory leaksage analysis
     public static void getNativeHeapDump (String name) throws Exception {
         System.gc();
         System.runFinalization();
@@ -42,4 +49,103 @@
         Debug.dumpNativeHeap(o.getFD());
         o.close();
     }
-}
\ No newline at end of file
+
+    public static String captureMemInfo(String type) {
+        String cm = "ps ";
+        cm += type;
+        String memoryUsage = null;
+
+        int ch;
+        try {
+            Process p = Runtime.getRuntime().exec(cm);
+            InputStream in = p.getInputStream();
+            StringBuffer sb = new StringBuffer(512);
+            while ((ch = in.read()) != -1) {
+                sb.append((char) ch);
+            }
+            memoryUsage = sb.toString();
+        } catch (IOException e) {
+            Log.v(TAG, e.toString());
+        }
+        String[] poList = memoryUsage.split("\r|\n|\r\n");
+        String memusage = poList[1].concat("\n");
+        return memusage;
+    }
+
+    public static int getMediaServerVsize() {
+        String memoryUsage = captureMemInfo("mediaserver");
+        String[] poList2 = memoryUsage.split("\t|\\s+");
+        String vsize = poList2[3];
+        int vsizevalue = Integer.parseInt(vsize);
+        Log.v(TAG, "VSIZE = " + vsizevalue);
+        return vsizevalue;
+    }
+
+    public static int getDrmServerVsize() {
+        String memoryUsage = captureMemInfo("drmserver");
+        String[] poList2 = memoryUsage.split("\t|\\s+");
+        String vsize = poList2[3];
+        int vsizevalue = Integer.parseInt(vsize);
+        Log.v(TAG, "VSIZE = " + vsizevalue);
+        return vsizevalue;
+    }
+
+    // Write the ps mediaserver output to the file
+    public static void getMediaServerMemoryLog(Writer output, int writeCount, int totalCount)
+            throws Exception {
+        String memusage = null;
+
+        if (writeCount == 0) {
+            mMediaStartMemory = getMediaServerVsize();
+            output.write("Start memory : " + mMediaStartMemory + "\n");
+        }
+        memusage = captureMemInfo("mediaserver");
+        output.write(memusage);
+    }
+
+    // Write the ps drmserver output to the file
+    public static void getDrmServerMemoryLog(Writer output, int writeCount, int totalCount)
+            throws Exception {
+        String memusage = null;
+
+        if (writeCount == 0) {
+            mDrmStartMemory = getDrmServerVsize();
+            output.write("Start memory : " + mDrmStartMemory + "\n");
+        }
+        memusage = captureMemInfo("drmserver");
+        output.write(memusage);
+    }
+
+    // Write the ps drmserver output to the file
+    public static void getDrmServerMemorySummary(Writer output, String tag) throws Exception {
+
+        getTestMemorySummary(output, tag, "drmMem");
+    }
+
+    // Write the ps drmserver output to the file
+    public static void getMediaServerMemorySummary(Writer output, String tag) throws Exception {
+
+        getTestMemorySummary(output, tag, "mediaMem");
+    }
+
+    public static void getTestMemorySummary(Writer output, String tag, String type)
+            throws Exception {
+
+        int endMemory = 0;
+        int memDiff = 0;
+
+        if (type == "mediaMem") {
+            endMemory = getMediaServerVsize();
+            memDiff = endMemory - mMediaStartMemory;
+        } else if (type == "drmMem") {
+            endMemory = getDrmServerVsize();
+            memDiff = endMemory - mDrmStartMemory;
+        }
+        output.write("End Memory :" + endMemory + "\n");
+        if (memDiff < 0) {
+            memDiff = 0;
+        }
+        output.write(tag + " total diff = " + memDiff);
+        output.write("\n\n");
+    }
+}
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/VideoEditorExportTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/VideoEditorExportTest.java
index 37b1f54..74d4766 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/VideoEditorExportTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/VideoEditorExportTest.java
@@ -44,6 +44,7 @@
 
 import com.android.mediaframeworktest.MediaFrameworkTest;
 import android.test.suitebuilder.annotation.LargeTest;
+import android.test.suitebuilder.annotation.Suppress;
 import com.android.mediaframeworktest.VideoEditorHelper;
 
 public class VideoEditorExportTest extends
@@ -701,6 +702,7 @@
      *
      * @throws Exception
      */
+    @Suppress
     @LargeTest
     public void testExportDuration1Hour() throws Exception {
         final String videoItemFilename1 = INPUT_FILE_PATH +
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index f4a1650..e13af1c 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -2077,14 +2077,15 @@
     if (!validate_display_context(dpy, ctx))
         return EGL_FALSE;
 
+    EGLBoolean result = EGL_FALSE;
     egl_context_t * const c = get_context(ctx);
-
     if (c->cnx->egl.eglDestroySyncKHR) {
-        return c->cnx->egl.eglDestroySyncKHR(
+        result = c->cnx->egl.eglDestroySyncKHR(
                 dp->disp[c->impl].dpy, syncObject->sync);
+        if (result)
+            _s.terminate();
     }
-
-    return EGL_FALSE;
+    return result;
 }
 
 EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout)
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index 94af40b5..0660a17 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"تم إنشاء الاتصال بالإنترنت عن طريق البلوتوث."</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"تهيئة طرق الإدخال"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"استخدام لوحة المفاتيح الفعلية"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 40faf7b..4c9ecfc 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth има връзка с тетъринг"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Конфигуриране на въвеждането"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Използване на физ. клав."</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 89b35a0..9a4a360 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth sense fil"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configura mètodes d\'entrada"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Utilitza un teclat físic"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 12a8452..31aa1a7 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Datové připojení Bluetooth se sdílí"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Nakonfigurovat metody vstupu"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Použít fyz. klávesnici"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index 624c7c6..ddbcf25 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth-tethering anvendt"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfigurer inputmetoder"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Brug fysisk tastatur"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 97835b9..c7d9502 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth-Tethering aktiv"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Eingabemethoden konfigurieren"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Physische Tastatur"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 799d0cc..7e15f7f 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Έγινε σύνδεση μέσω Bluetooth"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Διαμόρφωση μεθόδων εισαγωγής"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Χρήση κανονικού πληκτρολ."</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 3d7cd9d..350913a 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth tethered"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configure input methods"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Use physical keyboard"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 7b28c3f..43d9337 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth anclado"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configurar métodos de entrada"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Usar teclado físico"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 877b12a..e6c1ce2 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth anclado"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configurar métodos de introducción"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Utilizar teclado físico"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index e9778a8..9e70d5a 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"اتصال اینترنتی با بلوتوث تلفن همراه"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"پیکربندی روش های ورودی"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"از صفحه کلید فیزیکی استفاده کنید"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index 5590066..47b3220 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth yhdistetty"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Määritä syöttötavat"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Käytä fyysistä näppäimistöä"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 5e578e8..a4a287e 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Connexion Bluetooth partagée"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configurer les modes de saisie"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Utiliser clavier physique"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 8e4071d..680a3e3 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth posredno povezan"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfiguriraj načine ulaza"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Rabi fizičku tipkovnicu"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 1fbb2d4..9a103f7 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth megosztva"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Beviteli módok konfigurálása"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Valódi bill. használata"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index b645fba..e7fbbbe 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth tertambat"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfigurasikan metode masukan"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Gunakan keyboard fisik"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 2052a3d..b541374 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth con tethering"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configura metodi di input"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Utilizza tastiera fisica"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index f9e638f..3194cf5 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth קשור"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"הגדר שיטות קלט"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"השתמש במקלדת הפיזית"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index 4a42c09c..ac82ed4 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetoothテザリング接続"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"入力方法の設定"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"物理キーボードを使用"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index eb2d9b7..2d4786d 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"블루투스 테더링됨"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"입력 방법 구성"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"물리적 키보드 사용"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index c4aba8e..db06596 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"„Bluetooth“ susieta"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfigūruoti įvesties metodus"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Naudoti fizinę klaviatūrą"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index ac1ed1e..079591e 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth piesaiste"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfigurēt ievades metodes"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Izmantot fizisku tastatūru"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index c78eecb..b7e7711 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth tilknyttet"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfigurer inndatametoder"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Bruk fysisk tastatur"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 944f1a8..cc9e7a3 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth getetherd"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Invoermethoden configureren"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Fysiek toetsenbord gebruiken"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 71f1b7b..67d9cc1 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth – podłączono"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfiguruj metody wprowadzania"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Używaj klawiatury fizycznej"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index 19596827..5ee79a0 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth ligado"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configurar métodos de entrada"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Utilizar teclado físico"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index 59684ab..a91d406 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth vinculado"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configurar métodos de entrada"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Usar o teclado físico"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-rm/strings.xml b/packages/SystemUI/res/values-rm/strings.xml
index ea1926c..b41b9bd 100644
--- a/packages/SystemUI/res/values-rm/strings.xml
+++ b/packages/SystemUI/res/values-rm/strings.xml
@@ -61,15 +61,15 @@
     <skip />
     <!-- no translation found for status_bar_use_physical_keyboard (3695516942412442936) -->
     <skip />
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 944b5d1..36628aa 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Conectat prin tethering prin Bluetooth"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configuraţi metode de intrare"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Utilizaţi tastat. fizică"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index 34b5395..13da8a3 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Общий модем доступен через Bluetooth"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Настроить способ ввода"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Использовать физическую клавиатуру"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index 0d91813..c08eb21 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Zdieľané dátové pripojenie cez Bluetooth"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfigurovať metódy vstupu"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Použiť fyzickú klávesnicu"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index 0e5ad13..d7cb726 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Internetna povezava prek Bluetootha"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Nastavitev načinov vnosa"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Uporabi fizično tipkovn."</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index 69b3777..6e67293 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Веза преко Bluetooth-а"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Конфигуриши методе уноса"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Користи физичку тастатуру"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index fcf752a..e2905b6 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Internetdelning via Bluetooth"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Konfigurera inmatningsmetoder"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Använd fysiska tangenter"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 8ebc998..1e7af69 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"บลูทูธที่ปล่อยสัญญาณ"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"กำหนดค่าวิธีการป้อนข้อมูล"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"ใช้แป้นพิมพ์จริง"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 8d30859..9fadf73 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Na-tether ang bluetooth"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"I-configure paraan ng input"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Gamitin ang pisikal na keyboard"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index 98da3e9..7c3585a 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth paylaşımı tamam"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Giriş yöntemlerini yapılandır"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Fiziksel klavyeyi kullan"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 111b50a..a17e59d 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Створено прив\'язку Bluetooth"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Налаштувати методи введення"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Викор. реальну клавіатуру"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index ab31201..a994ee0 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth được dùng làm điểm truy cập Internet"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Định cấu hình phương pháp nhập liệu"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"Sử dụng bàn phím vật lý"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index ad88c19..baae9e1 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"蓝牙已绑定"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"配置输入法"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"使用物理键盘"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index aec5d3f..0d83d44 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -44,15 +44,15 @@
     <string name="bluetooth_tethered" msgid="7094101612161133267">"已透過藍牙進行網際網路共用"</string>
     <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"設定輸入方式"</string>
     <string name="status_bar_use_physical_keyboard" msgid="3695516942412442936">"使用實體鍵盤"</string>
-    <!-- no translation found for usb_device_permission_prompt (5340926456453429244) -->
+    <!-- no translation found for usb_device_permission_prompt (3816016361969816903) -->
     <skip />
-    <!-- no translation found for usb_accessory_permission_prompt (3969745913539898765) -->
+    <!-- no translation found for usb_accessory_permission_prompt (6888598803988889959) -->
     <skip />
-    <!-- no translation found for usb_device_confirm_prompt (2727793581411868504) -->
+    <!-- no translation found for usb_device_confirm_prompt (5161205258635253206) -->
     <skip />
-    <!-- no translation found for usb_accessory_confirm_prompt (3947430407252730383) -->
+    <!-- no translation found for usb_accessory_confirm_prompt (3808984931830229888) -->
     <skip />
-    <!-- no translation found for usb_accessory_uri_prompt (3536509438459769165) -->
+    <!-- no translation found for usb_accessory_uri_prompt (6332150684964235705) -->
     <skip />
     <!-- no translation found for title_usb_accessory (4966265263465181372) -->
     <skip />
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 69585ab..a693e60 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -808,7 +808,9 @@
 
         // the data direction overlay
         if (mLastDataDirectionOverlayIconId != dataDirectionOverlayIconId) {
-            Slog.d(TAG, "changing data overlay icon id to " + dataDirectionOverlayIconId);
+            if (DEBUG) {
+                Slog.d(TAG, "changing data overlay icon id to " + dataDirectionOverlayIconId);
+            }
             mLastDataDirectionOverlayIconId = dataDirectionOverlayIconId;
             N = mDataDirectionOverlayIconViews.size();
             for (int i=0; i<N; i++) {
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index e2da740..853dda4 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -1074,8 +1074,34 @@
     mDevices.removeAt(index);
     device->close();
 
-    device->next = mClosingDevices;
-    mClosingDevices = device;
+    // Unlink for opening devices list if it is present.
+    Device* pred = NULL;
+    bool found = false;
+    for (Device* entry = mOpeningDevices; entry != NULL; ) {
+        if (entry == device) {
+            found = true;
+            break;
+        }
+        pred = entry;
+        entry = entry->next;
+    }
+    if (found) {
+        // Unlink the device from the opening devices list then delete it.
+        // We don't need to tell the client that the device was closed because
+        // it does not even know it was opened in the first place.
+        LOGI("Device %s was immediately closed after opening.", device->path.string());
+        if (pred) {
+            pred->next = device->next;
+        } else {
+            mOpeningDevices = device->next;
+        }
+        delete device;
+    } else {
+        // Link into closing devices list.
+        // The device will be deleted later after we have informed the client.
+        device->next = mClosingDevices;
+        mClosingDevices = device;
+    }
     return 0;
 }
 
diff --git a/services/java/com/android/server/AppWidgetService.java b/services/java/com/android/server/AppWidgetService.java
index f28e2b1..a4a95a0 100644
--- a/services/java/com/android/server/AppWidgetService.java
+++ b/services/java/com/android/server/AppWidgetService.java
@@ -135,7 +135,7 @@
                 IRemoteViewsAdapterConnection.Stub.asInterface(mConnectionCb);
             try {
                 cb.onServiceConnected(service);
-            } catch (RemoteException e) {
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }
@@ -147,7 +147,7 @@
                 IRemoteViewsAdapterConnection.Stub.asInterface(mConnectionCb);
             try {
                 cb.onServiceDisconnected();
-            } catch (RemoteException e) {
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }
@@ -541,7 +541,7 @@
                     IRemoteViewsFactory.Stub.asInterface(service);
                 try {
                     cb.onDestroy(intent);
-                } catch (RemoteException e) {
+                } catch (Exception e) {
                     e.printStackTrace();
                 }
                 mContext.unbindService(this);
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 1297363..cd24478 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -858,11 +858,13 @@
     Mutex::Autolock _l(mLock);
 
     if (size < mNumBuffers) {
-        // Move the active texture into slot 0
-        BufferData activeBufferData = mBufferData[mActiveBufferIndex];
-        mBufferData[mActiveBufferIndex] = mBufferData[0];
-        mBufferData[0] = activeBufferData;
-        mActiveBufferIndex = 0;
+        // If there is an active texture, move it into slot 0 if needed
+        if (mActiveBufferIndex > 0) {
+            BufferData activeBufferData = mBufferData[mActiveBufferIndex];
+            mBufferData[mActiveBufferIndex] = mBufferData[0];
+            mBufferData[0] = activeBufferData;
+            mActiveBufferIndex = 0;
+        }
 
         // Free the buffers that are no longer needed.
         for (size_t i = size; i < mNumBuffers; i++) {