Merge "Fix issue #23326715: Clarify --checkin/-c options in batterystats" into mnc-dev
diff --git a/docs/html/preview/download.jd b/docs/html/preview/download.jd
index de99d0d..ecc0c7e 100644
--- a/docs/html/preview/download.jd
+++ b/docs/html/preview/download.jd
@@ -247,34 +247,34 @@
   <tr id="hammerhead">
     <td>Nexus 5 (GSM/LTE) <br>"hammerhead"</td>
     <td><a href="#top" onclick="onDownload(this)"
-      >hammerhead-MPA44G-preview-3fff4cf7.tgz</a><br>
-      MD5: ce86cb083174fab9f52483fa0828b23f<br>
-      SHA-1: 3fff4cf707c2ce5a5efbb7238982a41d36bd7dcc
+      >hammerhead-MPA44I-preview-2ebbc049.tgz</a><br>
+      MD5: 91a924fb0c9f8e716e3b4c9954fd0dbb<br>
+      SHA-1: 2ebbc049b68c4da8baeee3e42bb94d7a965ba4a3
     </td>
   </tr>
   <tr id="shamu">
     <td>Nexus 6 <br>"shamu"</td>
     <td><a href="#top" onclick="onDownload(this)"
-      >shamu-MPA44G-preview-6ad5fb56.tgz</a><br>
-      MD5: d1ec118d4b7dc564f048542576885985<br>
-      SHA-1: 6ad5fb561e3ccc7fd8c12f8513984a64a0a265da
+      >shamu-MPA44I-preview-62b9c486.tgz</a><br>
+      MD5: ac6e58da86125073d9c395257fd42664<br>
+      SHA-1: 62b9c486fd7a5020e228d53ca5acd5c1857e48ff
     </td>
   </tr>
   <tr id="volantis">
     <td>Nexus 9 <br>"volantis"</td>
     <td><a href="#top" onclick="onDownload(this)"
-      >volantis-MPA44G-preview-7ff8343a.tgz</a><br>
-      MD5: 2f764a8d0b2c176ab723ed7e26907075<br>
-      SHA-1: 7ff8343a0545a142e6a84023940b75ab328b6ae8
+      >volantis-MPA44I-preview-5c30a6e2.tgz</a><br>
+      MD5: 7f83768757913d3fea945a661020d185<br>
+      SHA-1: 5c30a6e2acd11a81f4105b12d23ff654f534f699
     </td>
   </tr>
 
   <tr id="fugu">
     <td>Nexus Player <br>"fugu"</td>
     <td><a href="#top" onclick="onDownload(this)"
-      >fugu-MPA44G-preview-f9cc2862.tgz</a><br>
-      MD5: 876fdc064836fa7ddf33d34e04fbd772<br>
-      SHA-1: f9cc2862fa5314393ec5780a6a9e08f9a9aacf4d
+      >fugu-MPA44I-preview-2860040a.tgz</a><br>
+      MD5: 438da8d37da9e341a69cfb16a4001ac5<br>
+      SHA-1: 2860040a326582f1ff5f702bf9a1ef002717fc98
     </td>
   </tr>
 
diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd
index 4413eff..cfd9467 100644
--- a/docs/html/preview/support.jd
+++ b/docs/html/preview/support.jd
@@ -57,7 +57,7 @@
     <div class="col-9of16">
       <p>
         <em>Date: August 2015<br>
-        Build: MPA44G<br>
+        Build: MPA44I<br>
         Hardware support: Nexus 5, 6, 9, Player<br>
         Emulator support: x86 &amp; ARM 32/64-bit<br>
         Google Play services: 7.8</em>
@@ -196,9 +196,10 @@
       </li>
       <li>During Hangouts calls, users may experience distorted or low audio on some devices.
       </li>
-      <li>The bundled Google Apps Device Policy app is unable to set up an Android for Work
-        Profile in the MPA44G system images, so you cannot create a new Work Profile with that
-        app. Other apps that provide Android for Work functionality are unaffected.
+      <li>The Google Apps Device Policy app bundled with MPA44G is unable to set up an Android for
+Work Profile, so you cannot create a new Work Profile with that version of the app. This issue is
+resolved in the Google Apps Device Policy app bundled with MPA44I. Other apps that provide Android
+for Work functionality remain unaffected on either build.
       </li>
     </ul>
   </li>
diff --git a/docs/html/tools/building/plugin-for-gradle.jd b/docs/html/tools/building/plugin-for-gradle.jd
index c1ec425..513153d 100644
--- a/docs/html/tools/building/plugin-for-gradle.jd
+++ b/docs/html/tools/building/plugin-for-gradle.jd
@@ -112,7 +112,7 @@
 configuration options common to all application modules in the project. Each application module
 also has its own build.gradle file for build settings specific to that module.</p>
 
-<h3>Project Build File</h3>
+<h3 id="projectBuildFile">Project Build File</h3>
 <p>By default, the project-level Gradle file uses <em>buildscript</em> to define the Gradle
 <em>repositories</em> and <em>dependencies</em>. This allows different projects to use different
 Gradle versions. Supported repositories include JCenter, Maven Central, or Ivy. This example
@@ -144,7 +144,7 @@
 the <em>local.properties</em> file in the <code>sdk.dir<sdk location></code> setting or through an
 <code>ANDROID_HOME</code> environment variable.</p>
 
-<h3>Module Build File</h3>
+<h3 id="moduleBuildFile">Module Build File</h3>
 <p>The application module Gradle build file allows you to configure module build settings,
 including overriding the <code>src/main</code> manifest settings and setting custom packaging
 options. </p>
@@ -378,7 +378,7 @@
 CPU/ABI (x86, ARM, or MIPS). </p>
 
 
-<h3>Source directories</h3>
+<h3 id="sourceDirectories">Source directories</h3>
 
 <p>To build each version of your app, the build system combines source code and
 resources from:</p>
diff --git a/libs/hwui/DisplayListCanvas.cpp b/libs/hwui/DisplayListCanvas.cpp
index aeb1a3d..2dd5278 100644
--- a/libs/hwui/DisplayListCanvas.cpp
+++ b/libs/hwui/DisplayListCanvas.cpp
@@ -255,7 +255,9 @@
         const SkPaint* paint) {
     if (matrix.isIdentity()) {
         drawBitmap(&bitmap, paint);
-    } else if (!(matrix.getType() & ~(SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask))) {
+    } else if (!(matrix.getType() & ~(SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask))
+            && MathUtils::isPositive(matrix.getScaleX())
+            && MathUtils::isPositive(matrix.getScaleY())) {
         // SkMatrix::isScaleTranslate() not available in L
         SkRect src;
         SkRect dst;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index 42a2f90..1a2fa97 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -115,12 +115,10 @@
         @Override
         public void onServiceConnected(ComponentName name, IBinder service) {
             mPrewarmMessenger = new Messenger(service);
-            mPrewarmBound = true;
         }
 
         @Override
         public void onServiceDisconnected(ComponentName name) {
-            mPrewarmBound = false;
             mPrewarmMessenger = null;
         }
     };
@@ -378,7 +376,7 @@
         Intent intent = getCameraIntent();
         ActivityInfo targetInfo = PreviewInflater.getTargetActivityInfo(mContext, intent,
                 KeyguardUpdateMonitor.getCurrentUser());
-        if (targetInfo != null) {
+        if (targetInfo != null && targetInfo.metaData != null) {
             String clazz = targetInfo.metaData.getString(
                     MediaStore.META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE);
             if (clazz != null) {
@@ -386,8 +384,10 @@
                 serviceIntent.setClassName(targetInfo.packageName, clazz);
                 serviceIntent.setAction(CameraPrewarmService.ACTION_PREWARM);
                 try {
-                    getContext().bindServiceAsUser(serviceIntent, mPrewarmConnection,
-                            Context.BIND_AUTO_CREATE, new UserHandle(UserHandle.USER_CURRENT));
+                    if (getContext().bindServiceAsUser(serviceIntent, mPrewarmConnection,
+                            Context.BIND_AUTO_CREATE, new UserHandle(UserHandle.USER_CURRENT))) {
+                        mPrewarmBound = true;
+                    }
                 } catch (SecurityException e) {
                     Log.w(TAG, "Unable to bind to prewarm service package=" + targetInfo.packageName
                             + " class=" + clazz, e);
@@ -398,7 +398,7 @@
 
     public void unbindCameraPrewarmService(boolean launched) {
         if (mPrewarmBound) {
-            if (launched) {
+            if (mPrewarmMessenger != null && launched) {
                 try {
                     mPrewarmMessenger.send(Message.obtain(null /* handler */,
                             CameraPrewarmService.MSG_CAMERA_FIRED));