Merge "OO NOT MERGE allow connected location providers location access" into jb-mr2-dev
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java
index 3307a8c..e53cb5e 100644
--- a/core/java/android/os/Trace.java
+++ b/core/java/android/os/Trace.java
@@ -65,6 +65,8 @@
     public static final long TRACE_TAG_APP = 1L << 12;
     /** @hide */
     public static final long TRACE_TAG_RESOURCES = 1L << 13;
+    /** @hide */
+    public static final long TRACE_TAG_DALVIK = 1L << 14;
 
     private static final long TRACE_TAG_NOT_READY = 1L << 63;
     private static final int MAX_SECTION_NAME_LEN = 127;
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 7ecb52e..3862c32 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -2709,7 +2709,6 @@
 
             AccessibilityNodeInfo focusNode = mAccessibilityFocusedVirtualView;
             View focusHost = mAccessibilityFocusedHost;
-            focusHost.clearAccessibilityFocusNoCallbacks();
 
             // Wipe the state of the current accessibility focus since
             // the call into the provider to clear accessibility focus
@@ -2719,6 +2718,10 @@
             mAccessibilityFocusedHost = null;
             mAccessibilityFocusedVirtualView = null;
 
+            // Clear accessibility focus on the host after clearing state since
+            // this method may be reentrant.
+            focusHost.clearAccessibilityFocusNoCallbacks();
+
             AccessibilityNodeProvider provider = focusHost.getAccessibilityNodeProvider();
             if (provider != null) {
                 // Invalidate the area of the cleared accessibility focus.
diff --git a/media/java/android/media/MediaDrm.java b/media/java/android/media/MediaDrm.java
index be2d9bc..7677d8a1 100644
--- a/media/java/android/media/MediaDrm.java
+++ b/media/java/android/media/MediaDrm.java
@@ -363,11 +363,16 @@
 
     /**
      * A key response is received from the license server by the app, then it is
-     * provided to the DRM engine plugin using provideKeyResponse. The byte array
-     * returned is a keySetId that can be used to later restore the keys to a new
-     * session with the method {@link #restoreKeys}, enabling offline key use.
+     * provided to the DRM engine plugin using provideKeyResponse.  When the
+     * response is for an offline key request, a keySetId is returned that can be
+     * used to later restore the keys to a new session with the method
+     * {@link #restoreKeys}.
+     * When the response is for a streaming or release request, null is returned.
      *
-     * @param sessionId the session ID for the DRM session
+     * @param scope may be a sessionId or keySetId depending on the type of the
+     * response.  Scope should be set to the sessionId when the response is for either
+     * streaming or offline key requests.  Scope should be set to the keySetId when
+     * the response is for a release request.
      * @param response the byte array response from the server
      *
      * @throws NotProvisionedException if the response indicates that
@@ -375,7 +380,7 @@
      * @throws DeniedByServerException if the response indicates that the
      * server rejected the request
      */
-    public native byte[] provideKeyResponse(byte[] sessionId, byte[] response)
+    public native byte[] provideKeyResponse(byte[] scope, byte[] response)
         throws NotProvisionedException, DeniedByServerException;