Merge "Import translations. DO NOT MERGE"
diff --git a/Android.mk b/Android.mk
index 1683bdb..76d3a13 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1024,13 +1024,9 @@
 	../../external/nist-sip/java \
 	../../external/apache-http/src \
 	../../external/tagsoup/src \
-	../../external/libphonenumber/java/src
 
 ext_src_files := $(call all-java-files-under,$(ext_dirs))
 
-ext_res_dirs := \
-	../../external/libphonenumber/java/src
-
 # ====  the library  =========================================
 include $(CLEAR_VARS)
 
@@ -1038,7 +1034,7 @@
 
 LOCAL_NO_STANDARD_LIBRARIES := true
 LOCAL_JAVA_LIBRARIES := core-libart
-LOCAL_JAVA_RESOURCE_DIRS := $(ext_res_dirs)
+LOCAL_STATIC_JAVA_LIBRARIES := libphonenumber-platform
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := ext
 
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 33d1640..149d7bc 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -525,8 +525,6 @@
     JavaVMInitArgs initArgs;
     char propBuf[PROPERTY_VALUE_MAX];
     char stackTraceFileBuf[sizeof("-Xstacktracefile:")-1 + PROPERTY_VALUE_MAX];
-    char dexoptFlagsBuf[PROPERTY_VALUE_MAX];
-    char enableAssertBuf[sizeof("-ea:")-1 + PROPERTY_VALUE_MAX];
     char jniOptsBuf[sizeof("-Xjniopts:")-1 + PROPERTY_VALUE_MAX];
     char heapstartsizeOptsBuf[sizeof("-Xms")-1 + PROPERTY_VALUE_MAX];
     char heapsizeOptsBuf[sizeof("-Xmx")-1 + PROPERTY_VALUE_MAX];
@@ -536,8 +534,6 @@
     char gctypeOptsBuf[sizeof("-Xgc:")-1 + PROPERTY_VALUE_MAX];
     char backgroundgcOptsBuf[sizeof("-XX:BackgroundGC=")-1 + PROPERTY_VALUE_MAX];
     char heaptargetutilizationOptsBuf[sizeof("-XX:HeapTargetUtilization=")-1 + PROPERTY_VALUE_MAX];
-    char jitcodecachesizeOptsBuf[sizeof("-Xjitcodecachesize:")-1 + PROPERTY_VALUE_MAX];
-    char dalvikVmLibBuf[PROPERTY_VALUE_MAX];
     char dex2oatXmsImageFlagsBuf[sizeof("-Xms")-1 + PROPERTY_VALUE_MAX];
     char dex2oatXmxImageFlagsBuf[sizeof("-Xmx")-1 + PROPERTY_VALUE_MAX];
     char dex2oatXmsFlagsBuf[sizeof("-Xms")-1 + PROPERTY_VALUE_MAX];
@@ -566,8 +562,6 @@
     char langOption[sizeof("-Duser.language=") + 3];
     char regionOption[sizeof("-Duser.region=") + 3];
     char lockProfThresholdBuf[sizeof("-Xlockprofthreshold:")-1 + PROPERTY_VALUE_MAX];
-    char jitOpBuf[sizeof("-Xjitop:")-1 + PROPERTY_VALUE_MAX];
-    char jitMethodBuf[sizeof("-Xjitmethod:")-1 + PROPERTY_VALUE_MAX];
     char nativeBridgeLibrary[sizeof("-XX:NativeBridge=") + PROPERTY_VALUE_MAX];
 
     bool checkJni = false;
@@ -586,9 +580,6 @@
         /* extended JNI checking */
         addOption("-Xcheck:jni");
 
-        /* set a cap on JNI global references */
-        addOption("-Xjnigreflimit:2000");
-
         /* with -Xcheck:jni, this provides a JNI function call trace */
         //addOption("-verbose:jni");
     }
@@ -604,30 +595,6 @@
 
     parseRuntimeOption("dalvik.vm.stack-trace-file", stackTraceFileBuf, "-Xstacktracefile:");
 
-    property_get("dalvik.vm.check-dex-sum", propBuf, "");
-    if (strcmp(propBuf, "true") == 0) {
-        /* perform additional DEX checksum tests */
-        addOption("-Xcheckdexsum");
-    }
-
-    property_get("log.redirect-stdio", propBuf, "");
-    if (strcmp(propBuf, "true") == 0) {
-        /* convert stdout/stderr to log messages */
-        addOption("-Xlog-stdio");
-    }
-
-    strcpy(enableAssertBuf, "-ea:");
-    property_get("dalvik.vm.enableassertions", enableAssertBuf+sizeof("-ea:")-1, "");
-    if (enableAssertBuf[sizeof("-ea:")-1] != '\0') {
-        /* accept "all" to mean "all classes and packages" */
-        if (strcmp(enableAssertBuf+sizeof("-ea:")-1, "all") == 0)
-            enableAssertBuf[3] = '\0'; // truncate to "-ea"
-        ALOGI("Assertions enabled: '%s'\n", enableAssertBuf);
-        addOption(enableAssertBuf);
-    } else {
-        ALOGV("Assertions disabled\n");
-    }
-
     strcpy(jniOptsBuf, "-Xjniopts:");
     if (parseRuntimeOption("dalvik.vm.jniopts", jniOptsBuf, "-Xjniopts:")) {
         ALOGI("JNI options: '%s'\n", jniOptsBuf);
@@ -654,14 +621,6 @@
     parseRuntimeOption("dalvik.vm.heapstartsize", heapstartsizeOptsBuf, "-Xms", "4m");
     parseRuntimeOption("dalvik.vm.heapsize", heapsizeOptsBuf, "-Xmx", "16m");
 
-    // Increase the main thread's interpreter stack size for bug 6315322.
-    addOption("-XX:mainThreadStackSize=24K");
-
-    // Set the max jit code cache size.  Note: size of 0 will disable the JIT.
-    parseRuntimeOption("dalvik.vm.jit.codecachesize",
-                       jitcodecachesizeOptsBuf,
-                       "-Xjitcodecachesize:");
-
     parseRuntimeOption("dalvik.vm.heapgrowthlimit", heapgrowthlimitOptsBuf, "-XX:HeapGrowthLimit=");
     parseRuntimeOption("dalvik.vm.heapminfree", heapminfreeOptsBuf, "-XX:HeapMinFree=");
     parseRuntimeOption("dalvik.vm.heapmaxfree", heapmaxfreeOptsBuf, "-XX:HeapMaxFree=");
@@ -677,53 +636,6 @@
     parseRuntimeOption("dalvik.vm.gctype", gctypeOptsBuf, "-Xgc:");
     parseRuntimeOption("dalvik.vm.backgroundgctype", backgroundgcOptsBuf, "-XX:BackgroundGC=");
 
-    /*
-     * Enable or disable dexopt features, such as bytecode verification and
-     * calculation of register maps for precise GC.
-     */
-    property_get("dalvik.vm.dexopt-flags", dexoptFlagsBuf, "");
-    if (dexoptFlagsBuf[0] != '\0') {
-        const char* opc;
-        const char* val;
-
-        opc = strstr(dexoptFlagsBuf, "v=");     /* verification */
-        if (opc != NULL) {
-            switch (*(opc+2)) {
-            case 'n':   val = "-Xverify:none";      break;
-            case 'r':   val = "-Xverify:remote";    break;
-            case 'a':   val = "-Xverify:all";       break;
-            default:    val = NULL;                 break;
-            }
-
-            if (val != NULL) {
-                addOption(val);
-            }
-        }
-
-        opc = strstr(dexoptFlagsBuf, "o=");     /* optimization */
-        if (opc != NULL) {
-            switch (*(opc+2)) {
-            case 'n':   val = "-Xdexopt:none";      break;
-            case 'v':   val = "-Xdexopt:verified";  break;
-            case 'a':   val = "-Xdexopt:all";       break;
-            case 'f':   val = "-Xdexopt:full";      break;
-            default:    val = NULL;                 break;
-            }
-
-            if (val != NULL) {
-                addOption(val);
-            }
-        }
-
-        opc = strstr(dexoptFlagsBuf, "m=y");    /* register map */
-        if (opc != NULL) {
-            addOption("-Xgenregmap");
-
-            /* turn on precise GC while we're at it */
-            addOption("-Xgc:precise");
-        }
-    }
-
     /* enable debugging; set suspend=y to pause during VM init */
     /* use android ADB transport */
     addOption("-agentlib:jdwp=transport=dt_android_adb,suspend=n,server=y");
@@ -732,12 +644,6 @@
                        lockProfThresholdBuf,
                        "-Xlockprofthreshold:");
 
-    /* Force interpreter-only mode for selected opcodes. Eg "1-0a,3c,f1-ff" */
-    parseRuntimeOption("dalvik.vm.jit.op", jitOpBuf, "-Xjitop:");
-
-    /* Force interpreter-only mode for selected methods */
-    parseRuntimeOption("dalvik.vm.jit.method", jitMethodBuf, "-Xjitmethod:");
-
     if (executionMode == kEMIntPortable) {
         addOption("-Xint:portable");
     } else if (executionMode == kEMIntFast) {
@@ -746,64 +652,57 @@
         addOption("-Xint:jit");
     }
 
-    // libart tolerates libdvm flags, but not vice versa, so only pass some options if libart.
-    property_get("persist.sys.dalvik.vm.lib.2", dalvikVmLibBuf, "libart.so");
-    bool libart = (strncmp(dalvikVmLibBuf, "libart", 6) == 0);
+    // If we are booting without the real /data, don't spend time compiling.
+    property_get("vold.decrypt", voldDecryptBuf, "");
+    bool skip_compilation = ((strcmp(voldDecryptBuf, "trigger_restart_min_framework") == 0) ||
+                             (strcmp(voldDecryptBuf, "1") == 0));
 
-    if (libart) {
-        // If we booting without the real /data, don't spend time compiling.
-        property_get("vold.decrypt", voldDecryptBuf, "");
-        bool skip_compilation = ((strcmp(voldDecryptBuf, "trigger_restart_min_framework") == 0) ||
-                                 (strcmp(voldDecryptBuf, "1") == 0));
-
-        // Extra options for boot.art/boot.oat image generation.
-        parseCompilerRuntimeOption("dalvik.vm.image-dex2oat-Xms", dex2oatXmsImageFlagsBuf,
-                                   "-Xms", "-Ximage-compiler-option");
-        parseCompilerRuntimeOption("dalvik.vm.image-dex2oat-Xmx", dex2oatXmxImageFlagsBuf,
-                                   "-Xmx", "-Ximage-compiler-option");
-        if (skip_compilation) {
-            addOption("-Ximage-compiler-option");
-            addOption("--compiler-filter=verify-none");
-        } else {
-            parseCompilerOption("dalvik.vm.image-dex2oat-filter", dex2oatImageCompilerFilterBuf,
-                                "--compiler-filter=", "-Ximage-compiler-option");
-        }
-
-        // Make sure there is a preloaded-classes file.
-        if (!hasFile("/system/etc/preloaded-classes")) {
-            ALOGE("Missing preloaded-classes file, /system/etc/preloaded-classes not found: %s\n",
-                  strerror(errno));
-            goto bail;
-        }
+    // Extra options for boot.art/boot.oat image generation.
+    parseCompilerRuntimeOption("dalvik.vm.image-dex2oat-Xms", dex2oatXmsImageFlagsBuf,
+                               "-Xms", "-Ximage-compiler-option");
+    parseCompilerRuntimeOption("dalvik.vm.image-dex2oat-Xmx", dex2oatXmxImageFlagsBuf,
+                               "-Xmx", "-Ximage-compiler-option");
+    if (skip_compilation) {
         addOption("-Ximage-compiler-option");
-        addOption("--image-classes=/system/etc/preloaded-classes");
-
-        // If there is a compiled-classes file, push it.
-        if (hasFile("/system/etc/compiled-classes")) {
-            addOption("-Ximage-compiler-option");
-            addOption("--compiled-classes=/system/etc/compiled-classes");
-        }
-
-        property_get("dalvik.vm.image-dex2oat-flags", dex2oatImageFlagsBuf, "");
-        parseExtraOpts(dex2oatImageFlagsBuf, "-Ximage-compiler-option");
-
-        // Extra options for DexClassLoader.
-        parseCompilerRuntimeOption("dalvik.vm.dex2oat-Xms", dex2oatXmsFlagsBuf,
-                                   "-Xms", "-Xcompiler-option");
-        parseCompilerRuntimeOption("dalvik.vm.dex2oat-Xmx", dex2oatXmxFlagsBuf,
-                                   "-Xmx", "-Xcompiler-option");
-        if (skip_compilation) {
-            addOption("-Xcompiler-option");
-            addOption("--compiler-filter=verify-none");
-        } else {
-            parseCompilerOption("dalvik.vm.dex2oat-filter", dex2oatCompilerFilterBuf,
-                                "--compiler-filter=", "-Xcompiler-option");
-        }
-        property_get("dalvik.vm.dex2oat-flags", dex2oatFlagsBuf, "");
-        parseExtraOpts(dex2oatFlagsBuf, "-Xcompiler-option");
-
+        addOption("--compiler-filter=verify-none");
+    } else {
+        parseCompilerOption("dalvik.vm.image-dex2oat-filter", dex2oatImageCompilerFilterBuf,
+                            "--compiler-filter=", "-Ximage-compiler-option");
     }
 
+    // Make sure there is a preloaded-classes file.
+    if (!hasFile("/system/etc/preloaded-classes")) {
+        ALOGE("Missing preloaded-classes file, /system/etc/preloaded-classes not found: %s\n",
+              strerror(errno));
+        goto bail;
+    }
+    addOption("-Ximage-compiler-option");
+    addOption("--image-classes=/system/etc/preloaded-classes");
+
+    // If there is a compiled-classes file, push it.
+    if (hasFile("/system/etc/compiled-classes")) {
+        addOption("-Ximage-compiler-option");
+        addOption("--compiled-classes=/system/etc/compiled-classes");
+    }
+
+    property_get("dalvik.vm.image-dex2oat-flags", dex2oatImageFlagsBuf, "");
+    parseExtraOpts(dex2oatImageFlagsBuf, "-Ximage-compiler-option");
+
+    // Extra options for DexClassLoader.
+    parseCompilerRuntimeOption("dalvik.vm.dex2oat-Xms", dex2oatXmsFlagsBuf,
+                               "-Xms", "-Xcompiler-option");
+    parseCompilerRuntimeOption("dalvik.vm.dex2oat-Xmx", dex2oatXmxFlagsBuf,
+                               "-Xmx", "-Xcompiler-option");
+    if (skip_compilation) {
+        addOption("-Xcompiler-option");
+        addOption("--compiler-filter=verify-none");
+    } else {
+        parseCompilerOption("dalvik.vm.dex2oat-filter", dex2oatCompilerFilterBuf,
+                            "--compiler-filter=", "-Xcompiler-option");
+    }
+    property_get("dalvik.vm.dex2oat-flags", dex2oatFlagsBuf, "");
+    parseExtraOpts(dex2oatFlagsBuf, "-Xcompiler-option");
+
     /* extra options; parse this late so it overrides others */
     property_get("dalvik.vm.extra-opts", extraOptsBuf, "");
     parseExtraOpts(extraOptsBuf, NULL);
@@ -820,67 +719,65 @@
     /*
      * Set profiler options
      */
-    if (libart) {
-        // Whether or not the profiler should be enabled.
-        property_get("dalvik.vm.profiler", propBuf, "0");
-        if (propBuf[0] == '1') {
-            addOption("-Xenable-profiler");
-        }
+    // Whether or not the profiler should be enabled.
+    property_get("dalvik.vm.profiler", propBuf, "0");
+    if (propBuf[0] == '1') {
+        addOption("-Xenable-profiler");
+    }
 
-        // Whether the profile should start upon app startup or be delayed by some random offset
-        // (in seconds) that is bound between 0 and a fixed value.
-        property_get("dalvik.vm.profile.start-immed", propBuf, "0");
-        if (propBuf[0] == '1') {
-            addOption("-Xprofile-start-immediately");
-        }
+    // Whether the profile should start upon app startup or be delayed by some random offset
+    // (in seconds) that is bound between 0 and a fixed value.
+    property_get("dalvik.vm.profile.start-immed", propBuf, "0");
+    if (propBuf[0] == '1') {
+        addOption("-Xprofile-start-immediately");
+    }
 
-        // Number of seconds during profile runs.
-        parseRuntimeOption("dalvik.vm.profile.period-secs", profilePeriod, "-Xprofile-period:");
+    // Number of seconds during profile runs.
+    parseRuntimeOption("dalvik.vm.profile.period-secs", profilePeriod, "-Xprofile-period:");
 
-        // Length of each profile run (seconds).
-        parseRuntimeOption("dalvik.vm.profile.duration-secs",
-                           profileDuration,
-                           "-Xprofile-duration:");
+    // Length of each profile run (seconds).
+    parseRuntimeOption("dalvik.vm.profile.duration-secs",
+                       profileDuration,
+                       "-Xprofile-duration:");
 
-        // Polling interval during profile run (microseconds).
-        parseRuntimeOption("dalvik.vm.profile.interval-us", profileInterval, "-Xprofile-interval:");
+    // Polling interval during profile run (microseconds).
+    parseRuntimeOption("dalvik.vm.profile.interval-us", profileInterval, "-Xprofile-interval:");
 
-        // Coefficient for period backoff.  The the period is multiplied
-        // by this value after each profile run.
-        parseRuntimeOption("dalvik.vm.profile.backoff-coeff", profileBackoff, "-Xprofile-backoff:");
+    // Coefficient for period backoff.  The the period is multiplied
+    // by this value after each profile run.
+    parseRuntimeOption("dalvik.vm.profile.backoff-coeff", profileBackoff, "-Xprofile-backoff:");
 
-        // Top K% of samples that are considered relevant when
-        // deciding if the app should be recompiled.
-        parseRuntimeOption("dalvik.vm.profile.top-k-thr",
-                           profileTopKThreshold,
-                           "-Xprofile-top-k-threshold:");
+    // Top K% of samples that are considered relevant when
+    // deciding if the app should be recompiled.
+    parseRuntimeOption("dalvik.vm.profile.top-k-thr",
+                       profileTopKThreshold,
+                       "-Xprofile-top-k-threshold:");
 
-        // The threshold after which a change in the structure of the
-        // top K% profiled samples becomes significant and triggers
-        // recompilation. A change in profile is considered
-        // significant if X% (top-k-change-threshold) of the top K%
-        // (top-k-threshold property) samples has changed.
-        parseRuntimeOption("dalvik.vm.profile.top-k-ch-thr",
-                           profileTopKChangeThreshold,
-                           "-Xprofile-top-k-change-threshold:");
+    // The threshold after which a change in the structure of the
+    // top K% profiled samples becomes significant and triggers
+    // recompilation. A change in profile is considered
+    // significant if X% (top-k-change-threshold) of the top K%
+    // (top-k-threshold property) samples has changed.
+    parseRuntimeOption("dalvik.vm.profile.top-k-ch-thr",
+                       profileTopKChangeThreshold,
+                       "-Xprofile-top-k-change-threshold:");
 
-        // Type of profile data.
-        parseRuntimeOption("dalvik.vm.profiler.type", profileType, "-Xprofile-type:");
+    // Type of profile data.
+    parseRuntimeOption("dalvik.vm.profiler.type", profileType, "-Xprofile-type:");
 
-        // Depth of bounded stack data
-        parseRuntimeOption("dalvik.vm.profile.stack-depth",
-                           profileMaxStackDepth,
-                           "-Xprofile-max-stack-depth:");
+    // Depth of bounded stack data
+    parseRuntimeOption("dalvik.vm.profile.stack-depth",
+                       profileMaxStackDepth,
+                       "-Xprofile-max-stack-depth:");
 
-        // Native bridge library. "0" means that native bridge is disabled.
-        property_get("ro.dalvik.vm.native.bridge", propBuf, "");
-        if (propBuf[0] == '\0') {
-            ALOGW("ro.dalvik.vm.native.bridge is not expected to be empty");
-        } else if (strcmp(propBuf, "0") != 0) {
-            snprintf(nativeBridgeLibrary, sizeof("-XX:NativeBridge=") + PROPERTY_VALUE_MAX,
-                     "-XX:NativeBridge=%s", propBuf);
-            addOption(nativeBridgeLibrary);
-        }
+    // Native bridge library. "0" means that native bridge is disabled.
+    property_get("ro.dalvik.vm.native.bridge", propBuf, "");
+    if (propBuf[0] == '\0') {
+        ALOGW("ro.dalvik.vm.native.bridge is not expected to be empty");
+    } else if (strcmp(propBuf, "0") != 0) {
+        snprintf(nativeBridgeLibrary, sizeof("-XX:NativeBridge=") + PROPERTY_VALUE_MAX,
+                 "-XX:NativeBridge=%s", propBuf);
+        addOption(nativeBridgeLibrary);
     }
 
     initArgs.version = JNI_VERSION_1_4;
diff --git a/libs/hwui/Android.common.mk b/libs/hwui/Android.common.mk
index 536912a..fba7254 100644
--- a/libs/hwui/Android.common.mk
+++ b/libs/hwui/Android.common.mk
@@ -1,7 +1,6 @@
 # getConfig in external/skia/include/core/SkBitmap.h is deprecated.
 # Allow Gnu extension: in-class initializer of static 'const float' member.
 LOCAL_CLANG_CFLAGS += \
-    -Wno-unused-parameter \
     -Wno-deprecated-declarations \
     -Wno-gnu-static-float-init
 
@@ -77,7 +76,6 @@
     external/skia/src/core
 
 LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
-LOCAL_CFLAGS += -Wno-unused-parameter
 LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libEGL libGLESv2 libskia libui libgui
 
 ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
@@ -102,4 +100,4 @@
 # Defaults for ATRACE_TAG and LOG_TAG for libhwui
 LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\"
 
-LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
\ No newline at end of file
+LOCAL_CFLAGS += -Wall -Werror -Wno-unused-parameter -Wunused -Wunreachable-code
diff --git a/libs/hwui/AssetAtlas.h b/libs/hwui/AssetAtlas.h
index dba9e62..1772eff 100644
--- a/libs/hwui/AssetAtlas.h
+++ b/libs/hwui/AssetAtlas.h
@@ -106,7 +106,7 @@
         friend class AssetAtlas;
     };
 
-    AssetAtlas(): mTexture(NULL), mImage(NULL),
+    AssetAtlas(): mTexture(nullptr), mImage(nullptr),
             mBlendKey(true), mOpaqueKey(false) { }
     ~AssetAtlas() { terminate(); }
 
diff --git a/libs/hwui/CanvasState.h b/libs/hwui/CanvasState.h
index 6883d0a4..9e6a9c3 100644
--- a/libs/hwui/CanvasState.h
+++ b/libs/hwui/CanvasState.h
@@ -161,7 +161,7 @@
     int getHeight() { return mHeight; }
 
     inline const Snapshot* currentSnapshot() const {
-        return mSnapshot != NULL ? mSnapshot.get() : mFirstSnapshot.get();
+        return mSnapshot != nullptr ? mSnapshot.get() : mFirstSnapshot.get();
     }
     inline Snapshot* writableSnapshot() { return mSnapshot.get(); }
     inline const Snapshot* firstSnapshot() const { return mFirstSnapshot.get(); }
diff --git a/libs/hwui/DeferredDisplayList.h b/libs/hwui/DeferredDisplayList.h
index b6309ff..c92ab91 100644
--- a/libs/hwui/DeferredDisplayList.h
+++ b/libs/hwui/DeferredDisplayList.h
@@ -69,7 +69,7 @@
 class OpStatePair {
 public:
     OpStatePair()
-            : op(NULL), state(NULL) {}
+            : op(nullptr), state(nullptr) {}
     OpStatePair(DrawOp* newOp, const DeferredDisplayState* newState)
             : op(newOp), state(newState) {}
     OpStatePair(const OpStatePair& other)
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index e168786..26637a7 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -67,7 +67,7 @@
 /**
  * Holds data used in the playback a tree of DisplayLists.
  */
-class PlaybackStateStruct {
+struct PlaybackStateStruct {
 protected:
     PlaybackStateStruct(OpenGLRenderer& renderer, int replayFlags, LinearAllocator* allocator)
             : mRenderer(renderer)
@@ -96,8 +96,7 @@
     DeferredDisplayList& mDeferredList;
 };
 
-class ReplayStateStruct : public PlaybackStateStruct {
-public:
+struct ReplayStateStruct : public PlaybackStateStruct {
     ReplayStateStruct(OpenGLRenderer& renderer, Rect& dirty, int replayFlags)
             : PlaybackStateStruct(renderer, replayFlags, &mReplayAllocator),
             mDirty(dirty) {}
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index 6646da7..0bfcb16b 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -74,48 +74,51 @@
 // ----------------------------------------------------------------------------
 // Frame state operations
 // ----------------------------------------------------------------------------
-    virtual void prepareDirty(float left, float top, float right, float bottom, bool opaque);
-    virtual void prepare(bool opaque) {
+    virtual void prepareDirty(float left, float top, float right,
+            float bottom, bool opaque) override;
+    virtual void prepare(bool opaque) override {
         prepareDirty(0.0f, 0.0f, mState.getWidth(), mState.getHeight(), opaque);
     }
-    virtual bool finish();
+    virtual bool finish() override;
     virtual void interrupt();
     virtual void resume();
 
 // ----------------------------------------------------------------------------
 // Canvas state operations
 // ----------------------------------------------------------------------------
-    virtual void setViewport(int width, int height) { mState.setViewport(width, height); }
+    virtual void setViewport(int width, int height) override { mState.setViewport(width, height); }
 
     // Save (layer)
-    virtual int getSaveCount() const { return mState.getSaveCount(); }
-    virtual int save(int flags);
-    virtual void restore();
-    virtual void restoreToCount(int saveCount);
+    virtual int getSaveCount() const override { return mState.getSaveCount(); }
+    virtual int save(int flags) override;
+    virtual void restore() override;
+    virtual void restoreToCount(int saveCount) override;
     virtual int saveLayer(float left, float top, float right, float bottom,
-            const SkPaint* paint, int flags);
+            const SkPaint* paint, int flags) override;
 
     // Matrix
-    virtual void getMatrix(SkMatrix* outMatrix) const { mState.getMatrix(outMatrix); }
+    virtual void getMatrix(SkMatrix* outMatrix) const override { mState.getMatrix(outMatrix); }
 
-    virtual void translate(float dx, float dy, float dz = 0.0f);
-    virtual void rotate(float degrees);
-    virtual void scale(float sx, float sy);
-    virtual void skew(float sx, float sy);
+    virtual void translate(float dx, float dy, float dz = 0.0f) override;
+    virtual void rotate(float degrees) override;
+    virtual void scale(float sx, float sy) override;
+    virtual void skew(float sx, float sy) override;
 
-    virtual void setMatrix(const SkMatrix& matrix);
-    virtual void concatMatrix(const SkMatrix& matrix);
+    virtual void setMatrix(const SkMatrix& matrix) override;
+    virtual void concatMatrix(const SkMatrix& matrix) override;
 
     // Clip
-    virtual bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op);
-    virtual bool clipPath(const SkPath* path, SkRegion::Op op);
-    virtual bool clipRegion(const SkRegion* region, SkRegion::Op op);
+    virtual bool clipRect(float left, float top, float right, float bottom,
+            SkRegion::Op op) override;
+    virtual bool clipPath(const SkPath* path, SkRegion::Op op) override;
+    virtual bool clipRegion(const SkRegion* region, SkRegion::Op op) override;
 
     // Misc
-    virtual void setDrawFilter(SkDrawFilter* filter);
-    virtual const Rect& getLocalClipBounds() const { return mState.getLocalClipBounds(); }
+    virtual void setDrawFilter(SkDrawFilter* filter) override;
+    virtual const Rect& getLocalClipBounds() const override { return mState.getLocalClipBounds(); }
     const Rect& getRenderTargetClipBounds() const { return mState.getRenderTargetClipBounds(); }
-    virtual bool quickRejectConservative(float left, float top, float right, float bottom) const {
+    virtual bool quickRejectConservative(float left, float top,
+            float right, float bottom) const override {
         return mState.quickRejectConservative(left, top, right, bottom);
     }
 
@@ -126,57 +129,57 @@
 // ----------------------------------------------------------------------------
 // Canvas draw operations
 // ----------------------------------------------------------------------------
-    virtual void drawColor(int color, SkXfermode::Mode mode);
+    virtual void drawColor(int color, SkXfermode::Mode mode) override;
 
     // Bitmap-based
-    virtual void drawBitmap(const SkBitmap* bitmap, const SkPaint* paint);
+    virtual void drawBitmap(const SkBitmap* bitmap, const SkPaint* paint) override;
     virtual void drawBitmap(const SkBitmap* bitmap, float srcLeft, float srcTop,
             float srcRight, float srcBottom, float dstLeft, float dstTop,
-            float dstRight, float dstBottom, const SkPaint* paint);
-    virtual void drawBitmapData(const SkBitmap* bitmap, const SkPaint* paint);
+            float dstRight, float dstBottom, const SkPaint* paint) override;
+    virtual void drawBitmapData(const SkBitmap* bitmap, const SkPaint* paint) override;
     virtual void drawBitmapMesh(const SkBitmap* bitmap, int meshWidth, int meshHeight,
-            const float* vertices, const int* colors, const SkPaint* paint);
+            const float* vertices, const int* colors, const SkPaint* paint) override;
     virtual void drawPatch(const SkBitmap* bitmap, const Res_png_9patch* patch,
-            float left, float top, float right, float bottom, const SkPaint* paint);
+            float left, float top, float right, float bottom, const SkPaint* paint) override;
 
     // Shapes
     virtual void drawRect(float left, float top, float right, float bottom,
-            const SkPaint* paint);
-    virtual void drawRects(const float* rects, int count, const SkPaint* paint);
+            const SkPaint* paint) override;
+    virtual void drawRects(const float* rects, int count, const SkPaint* paint) override;
     virtual void drawRoundRect(float left, float top, float right, float bottom,
-            float rx, float ry, const SkPaint* paint);
+            float rx, float ry, const SkPaint* paint) override;
     virtual void drawRoundRect(CanvasPropertyPrimitive* left, CanvasPropertyPrimitive* top,
                 CanvasPropertyPrimitive* right, CanvasPropertyPrimitive* bottom,
                 CanvasPropertyPrimitive* rx, CanvasPropertyPrimitive* ry,
                 CanvasPropertyPaint* paint);
-    virtual void drawCircle(float x, float y, float radius, const SkPaint* paint);
+    virtual void drawCircle(float x, float y, float radius, const SkPaint* paint) override;
     virtual void drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPrimitive* y,
                 CanvasPropertyPrimitive* radius, CanvasPropertyPaint* paint);
     virtual void drawOval(float left, float top, float right, float bottom,
-            const SkPaint* paint);
+            const SkPaint* paint) override;
     virtual void drawArc(float left, float top, float right, float bottom,
-            float startAngle, float sweepAngle, bool useCenter, const SkPaint* paint);
-    virtual void drawPath(const SkPath* path, const SkPaint* paint);
-    virtual void drawLines(const float* points, int count, const SkPaint* paint);
-    virtual void drawPoints(const float* points, int count, const SkPaint* paint);
+            float startAngle, float sweepAngle, bool useCenter, const SkPaint* paint) override;
+    virtual void drawPath(const SkPath* path, const SkPaint* paint) override;
+    virtual void drawLines(const float* points, int count, const SkPaint* paint) override;
+    virtual void drawPoints(const float* points, int count, const SkPaint* paint) override;
 
     // Text
     virtual void drawText(const char* text, int bytesCount, int count, float x, float y,
             const float* positions, const SkPaint* paint, float totalAdvance, const Rect& bounds,
-            DrawOpMode drawOpMode = kDrawOpMode_Immediate);
+            DrawOpMode drawOpMode = kDrawOpMode_Immediate) override;
     virtual void drawTextOnPath(const char* text, int bytesCount, int count, const SkPath* path,
-            float hOffset, float vOffset, const SkPaint* paint);
+            float hOffset, float vOffset, const SkPaint* paint) override;
     virtual void drawPosText(const char* text, int bytesCount, int count,
-            const float* positions, const SkPaint* paint);
+            const float* positions, const SkPaint* paint) override;
 
 // ----------------------------------------------------------------------------
 // Canvas draw operations - special
 // ----------------------------------------------------------------------------
     virtual void drawLayer(DeferredLayerUpdater* layerHandle, float x, float y);
-    virtual void drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t replayFlags);
+    virtual void drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t replayFlags) override;
 
     // TODO: rename for consistency
-    virtual void callDrawGLFunction(Functor* functor, Rect& dirty);
+    virtual void callDrawGLFunction(Functor* functor, Rect& dirty) override;
 
     void setHighContrastText(bool highContrastText) {
         mHighContrastText = highContrastText;
@@ -185,9 +188,9 @@
 // ----------------------------------------------------------------------------
 // CanvasState callbacks
 // ----------------------------------------------------------------------------
-    virtual void onViewportInitialized() { }
-    virtual void onSnapshotRestored(const Snapshot& removed, const Snapshot& restored) { }
-    virtual GLuint onGetTargetFbo() const { return -1; }
+    virtual void onViewportInitialized() override { }
+    virtual void onSnapshotRestored(const Snapshot& removed, const Snapshot& restored) override { }
+    virtual GLuint onGetTargetFbo() const override { return -1; }
 
 private:
 
@@ -217,7 +220,7 @@
 
     template<class T>
     inline const T* refBuffer(const T* srcBuffer, int32_t count) {
-        if (!srcBuffer) return NULL;
+        if (!srcBuffer) return nullptr;
 
         T* dstBuffer = (T*) mDisplayListData->allocator.alloc(count * sizeof(T));
         memcpy(dstBuffer, srcBuffer, count * sizeof(T));
@@ -229,10 +232,10 @@
     }
 
     inline const SkPath* refPath(const SkPath* path) {
-        if (!path) return NULL;
+        if (!path) return nullptr;
 
         const SkPath* pathCopy = mPathMap.valueFor(path);
-        if (pathCopy == NULL || pathCopy->getGenerationID() != path->getGenerationID()) {
+        if (pathCopy == nullptr || pathCopy->getGenerationID() != path->getGenerationID()) {
             SkPath* newPathCopy = new SkPath(*path);
             newPathCopy->setSourcePath(path);
 
@@ -249,7 +252,7 @@
     }
 
     inline const SkPaint* refPaint(const SkPaint* paint) {
-        if (!paint) return NULL;
+        if (!paint) return nullptr;
 
         // If there is a draw filter apply it here and store the modified paint
         // so that we don't need to modify the paint every time we access it.
@@ -264,7 +267,7 @@
         const SkPaint* cachedPaint = mPaintMap.valueFor(key);
         // In the unlikely event that 2 unique paints have the same hash we do a
         // object equality check to ensure we don't erroneously dedup them.
-        if (cachedPaint == NULL || *cachedPaint != *paint) {
+        if (cachedPaint == nullptr || *cachedPaint != *paint) {
             cachedPaint =  new SkPaint(*paint);
             // replaceValueFor() performs an add if the entry doesn't exist
             mPaintMap.replaceValueFor(key, cachedPaint);
@@ -275,7 +278,7 @@
     }
 
     inline SkPaint* copyPaint(const SkPaint* paint) {
-        if (!paint) return NULL;
+        if (!paint) return nullptr;
         SkPaint* paintCopy = new SkPaint(*paint);
         mDisplayListData->paints.add(paintCopy);
 
@@ -289,7 +292,7 @@
 
         const SkRegion* regionCopy = mRegionMap.valueFor(region);
         // TODO: Add generation ID to SkRegion
-        if (regionCopy == NULL) {
+        if (regionCopy == nullptr) {
             regionCopy = new SkRegion(*region);
             // replaceValueFor() performs an add if the entry doesn't exist
             mRegionMap.replaceValueFor(region, regionCopy);
diff --git a/libs/hwui/Fence.h b/libs/hwui/Fence.h
index f175e98..fc29f7ac1 100644
--- a/libs/hwui/Fence.h
+++ b/libs/hwui/Fence.h
@@ -43,7 +43,7 @@
     Fence() {
         mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
         if (mDisplay != EGL_NO_DISPLAY) {
-            mFence = eglCreateSyncKHR(mDisplay, EGL_SYNC_FENCE_KHR, NULL);
+            mFence = eglCreateSyncKHR(mDisplay, EGL_SYNC_FENCE_KHR, nullptr);
         } else {
             mFence = EGL_NO_SYNC_KHR;
         }
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index e11128c..668ee64 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -66,7 +66,7 @@
     }
     ~TextSetupFunctor() { }
 
-    status_t operator ()(int what, void* data);
+    status_t operator ()(int what, void* data) override;
 
     OpenGLRenderer* renderer;
     float x;
diff --git a/libs/hwui/GammaFontRenderer.h b/libs/hwui/GammaFontRenderer.h
index 46cfd04..623df1f 100644
--- a/libs/hwui/GammaFontRenderer.h
+++ b/libs/hwui/GammaFontRenderer.h
@@ -59,36 +59,36 @@
         delete mRenderer;
     }
 
-    void clear() {
+    void clear() override {
         delete mRenderer;
-        mRenderer = NULL;
+        mRenderer = nullptr;
     }
 
-    void flush() {
+    void flush() override {
         if (mRenderer) {
             mRenderer->flushLargeCaches();
         }
     }
 
-    FontRenderer& getFontRenderer(const SkPaint* paint) {
+    FontRenderer& getFontRenderer(const SkPaint* paint) override {
         if (!mRenderer) {
             mRenderer = new FontRenderer;
         }
         return *mRenderer;
     }
 
-    uint32_t getFontRendererCount() const {
+    uint32_t getFontRendererCount() const override {
         return 1;
     }
 
-    uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const {
+    uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const override {
         return mRenderer ? mRenderer->getCacheSize(format) : 0;
     }
 
-    void describe(ProgramDescription& description, const SkPaint* paint) const;
-    void setupProgram(ProgramDescription& description, Program* program) const;
+    void describe(ProgramDescription& description, const SkPaint* paint) const override;
+    void setupProgram(ProgramDescription& description, Program* program) const override;
 
-    void endPrecaching();
+    void endPrecaching() override;
 
 private:
     ShaderGammaFontRenderer(bool multiGamma);
@@ -105,18 +105,18 @@
         delete mRenderer;
     }
 
-    void clear() {
+    void clear() override {
         delete mRenderer;
-        mRenderer = NULL;
+        mRenderer = nullptr;
     }
 
-    void flush() {
+    void flush() override {
         if (mRenderer) {
             mRenderer->flushLargeCaches();
         }
     }
 
-    FontRenderer& getFontRenderer(const SkPaint* paint) {
+    FontRenderer& getFontRenderer(const SkPaint* paint) override {
         if (!mRenderer) {
             mRenderer = new FontRenderer;
             mRenderer->setGammaTable(&mGammaTable[0]);
@@ -124,21 +124,21 @@
         return *mRenderer;
     }
 
-    uint32_t getFontRendererCount() const {
+    uint32_t getFontRendererCount() const override {
         return 1;
     }
 
-    uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const {
+    uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const override {
         return mRenderer ? mRenderer->getCacheSize(format) : 0;
     }
 
-    void describe(ProgramDescription& description, const SkPaint* paint) const {
+    void describe(ProgramDescription& description, const SkPaint* paint) const override {
     }
 
-    void setupProgram(ProgramDescription& description, Program* program) const {
+    void setupProgram(ProgramDescription& description, Program* program) const override {
     }
 
-    void endPrecaching();
+    void endPrecaching() override;
 
 private:
     LookupGammaFontRenderer();
@@ -153,16 +153,16 @@
 public:
     ~Lookup3GammaFontRenderer();
 
-    void clear();
-    void flush();
+    void clear() override;
+    void flush() override;
 
-    FontRenderer& getFontRenderer(const SkPaint* paint);
+    FontRenderer& getFontRenderer(const SkPaint* paint) override;
 
-    uint32_t getFontRendererCount() const {
+    uint32_t getFontRendererCount() const override {
         return kGammaCount;
     }
 
-    uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const {
+    uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const override {
         if (fontRenderer >= kGammaCount) return 0;
 
         FontRenderer* renderer = mRenderers[fontRenderer];
@@ -171,13 +171,13 @@
         return renderer->getCacheSize(format);
     }
 
-    void describe(ProgramDescription& description, const SkPaint* paint) const {
+    void describe(ProgramDescription& description, const SkPaint* paint) const override {
     }
 
-    void setupProgram(ProgramDescription& description, Program* program) const {
+    void setupProgram(ProgramDescription& description, Program* program) const override {
     }
 
-    void endPrecaching();
+    void endPrecaching() override;
 
 private:
     Lookup3GammaFontRenderer();
diff --git a/libs/hwui/GradientCache.h b/libs/hwui/GradientCache.h
index c94b6f0..ef4e0cd 100644
--- a/libs/hwui/GradientCache.h
+++ b/libs/hwui/GradientCache.h
@@ -33,8 +33,8 @@
 struct GradientCacheEntry {
     GradientCacheEntry() {
         count = 0;
-        colors = NULL;
-        positions = NULL;
+        colors = nullptr;
+        positions = nullptr;
     }
 
     GradientCacheEntry(uint32_t* colors, float* positions, uint32_t count) {
@@ -118,7 +118,7 @@
      * Used as a callback when an entry is removed from the cache.
      * Do not invoke directly.
      */
-    void operator()(GradientCacheEntry& shader, Texture*& texture);
+    void operator()(GradientCacheEntry& shader, Texture*& texture) override;
 
     /**
      * Returns the texture associated with the specified shader.
diff --git a/libs/hwui/Interpolator.cpp b/libs/hwui/Interpolator.cpp
index 0e62d77..2623f53 100644
--- a/libs/hwui/Interpolator.cpp
+++ b/libs/hwui/Interpolator.cpp
@@ -14,12 +14,6 @@
  * limitations under the License.
  */
 
-// LOG_TAG is being provided by the Makefile, reset.
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "Interpolator"
-
 #include "Interpolator.h"
 
 #include <cmath>
diff --git a/libs/hwui/LayerCache.cpp b/libs/hwui/LayerCache.cpp
index 3216cd2..d6703f2 100644
--- a/libs/hwui/LayerCache.cpp
+++ b/libs/hwui/LayerCache.cpp
@@ -80,10 +80,8 @@
 
 void LayerCache::deleteLayer(Layer* layer) {
     if (layer) {
-        if (kDebugLayers) {
-            ALOGD("Destroying layer %dx%d, fbo %d", layer->getWidth(), layer->getHeight(),
-                    layer->getFbo());
-        }
+        LAYER_LOGD("Destroying layer %dx%d, fbo %d", layer->getWidth(), layer->getHeight(),
+                layer->getFbo());
         mSize -= layer->getWidth() * layer->getHeight() * 4;
         layer->state = Layer::kState_DeletedFromCache;
         layer->decStrong(0);
@@ -112,13 +110,9 @@
         layer->state = Layer::kState_RemovedFromCache;
         mSize -= layer->getWidth() * layer->getHeight() * 4;
 
-        if (kDebugLayers) {
-            ALOGD("Reusing layer %dx%d", layer->getWidth(), layer->getHeight());
-        }
+        LAYER_LOGD("Reusing layer %dx%d", layer->getWidth(), layer->getHeight());
     } else {
-        if (kDebugLayers) {
-            ALOGD("Creating new layer %dx%d", entry.mWidth, entry.mHeight);
-        }
+        LAYER_LOGD("Creating new layer %dx%d", entry.mWidth, entry.mHeight);
 
         layer = new Layer(Layer::kType_DisplayList, renderState, entry.mWidth, entry.mHeight);
         layer->setBlend(true);
@@ -143,9 +137,7 @@
     size_t size = mCache.size();
     for (size_t i = 0; i < size; i++) {
         const LayerEntry& entry = mCache.itemAt(i);
-        if (kDebugLayers) {
-            ALOGD("  Layer size %dx%d", entry.mWidth, entry.mHeight);
-        }
+        ALOGD("  Layer size %dx%d", entry.mWidth, entry.mHeight);
     }
 }
 
@@ -165,10 +157,8 @@
             deleteLayer(victim);
             mCache.removeAt(position);
 
-            if (kDebugLayers) {
-                ALOGD("  Deleting layer %.2fx%.2f", victim->layer.getWidth(),
-                        victim->layer.getHeight());
-            }
+            LAYER_LOGD("  Deleting layer %.2fx%.2f", victim->layer.getWidth(),
+                    victim->layer.getHeight());
         }
 
         layer->cancelDefer();
diff --git a/libs/hwui/LayerCache.h b/libs/hwui/LayerCache.h
index 81810ac..7d17b9b 100644
--- a/libs/hwui/LayerCache.h
+++ b/libs/hwui/LayerCache.h
@@ -26,11 +26,14 @@
 
 class RenderState;
 
-// Debug
+///////////////////////////////////////////////////////////////////////////////
+// Defines
+///////////////////////////////////////////////////////////////////////////////
+
 #if DEBUG_LAYERS
-static const bool kDebugLayers = true;
+    #define LAYER_LOGD(...) ALOGD(__VA_ARGS__)
 #else
-static const bool kDebugLayers = false;
+    #define LAYER_LOGD(...)
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -93,10 +96,10 @@
 private:
     struct LayerEntry {
         LayerEntry():
-            mLayer(NULL), mWidth(0), mHeight(0) {
+            mLayer(nullptr), mWidth(0), mHeight(0) {
         }
 
-        LayerEntry(const uint32_t layerWidth, const uint32_t layerHeight): mLayer(NULL) {
+        LayerEntry(const uint32_t layerWidth, const uint32_t layerHeight): mLayer(nullptr) {
             mWidth = Layer::computeIdealWidth(layerWidth);
             mHeight = Layer::computeIdealHeight(layerHeight);
         }
diff --git a/libs/hwui/Matrix.h b/libs/hwui/Matrix.h
index 1c5c578..a760135 100644
--- a/libs/hwui/Matrix.h
+++ b/libs/hwui/Matrix.h
@@ -210,7 +210,7 @@
 
     void decomposeScale(float& sx, float& sy) const;
 
-    void dump(const char* label = NULL) const;
+    void dump(const char* label = nullptr) const;
 
     static const Matrix4& identity();
 
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 3f67f54..1c4c327 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -680,7 +680,7 @@
             writableSnapshot()->resetTransform(-bounds.left, -bounds.top, 0.0f);
             writableSnapshot()->resetClip(clip.left, clip.top, clip.right, clip.bottom);
             writableSnapshot()->initializeViewport(bounds.getWidth(), bounds.getHeight());
-            writableSnapshot()->roundRectClipState = NULL;
+            writableSnapshot()->roundRectClipState = nullptr;
         }
     }
 
@@ -740,10 +740,8 @@
  */
 bool OpenGLRenderer::createLayer(float left, float top, float right, float bottom,
         const SkPaint* paint, int flags, const SkPath* convexMask) {
-    if (kDebugLayers) {
-        ALOGD("Requesting layer %.2fx%.2f", right - left, bottom - top);
-        ALOGD("Layer cache size = %d", mCaches.layerCache.getSize());
-    }
+    LAYER_LOGD("Requesting layer %.2fx%.2f", right - left, bottom - top);
+    LAYER_LOGD("Layer cache size = %d", mCaches.layerCache.getSize());
 
     const bool fboLayer = flags & SkCanvas::kClipToLayer_SaveFlag;
 
@@ -793,7 +791,7 @@
                 // Unfortunately some drivers will turn the entire target texture black
                 // when reading outside of the window.
                 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, layer->getWidth(), layer->getHeight(),
-                        0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+                        0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
                 layer->setEmpty(false);
             }
 
@@ -819,7 +817,7 @@
     writableSnapshot()->resetTransform(-bounds.left, -bounds.top, 0.0f);
     writableSnapshot()->resetClip(clip.left, clip.top, clip.right, clip.bottom);
     writableSnapshot()->initializeViewport(bounds.getWidth(), bounds.getHeight());
-    writableSnapshot()->roundRectClipState = NULL;
+    writableSnapshot()->roundRectClipState = nullptr;
 
     endTiling();
     debugOverdraw(false, false);
@@ -867,7 +865,7 @@
 
     bool clipRequired = false;
     mState.calculateQuickRejectForScissor(rect.left, rect.top, rect.right, rect.bottom,
-            &clipRequired, NULL, false); // safely ignore return, should never be rejected
+            &clipRequired, nullptr, false); // safely ignore return, should never be rejected
     mCaches.setScissorEnabled(mScissorOptimizationDisabled || clipRequired);
 
     if (fboLayer) {
@@ -919,12 +917,10 @@
     dirtyClip();
 
     // Failing to add the layer to the cache should happen only if the layer is too large
-    layer->setConvexMask(NULL);
+    layer->setConvexMask(nullptr);
     if (!mCaches.layerCache.put(layer)) {
-        if (kDebugLayers) {
-            ALOGD("Deleting layer");
-        }
-        layer->decStrong(0);
+        LAYER_LOGD("Deleting layer");
+        layer->decStrong(nullptr);
     }
 }
 
@@ -1041,14 +1037,14 @@
     , mLayer(layer) {
     }
 
-    virtual bool asACustomShader(void** data) const {
+    virtual bool asACustomShader(void** data) const override {
         if (data) {
             *data = static_cast<void*>(mLayer);
         }
         return true;
     }
 
-    virtual bool isOpaque() const {
+    virtual bool isOpaque() const override {
         return !mLayer->isBlend();
     }
 
@@ -1057,13 +1053,13 @@
         LOG_ALWAYS_FATAL("LayerShader should never be drawn with raster backend.");
     }
 
-    virtual void flatten(SkWriteBuffer&) const {
+    virtual void flatten(SkWriteBuffer&) const override {
         LOG_ALWAYS_FATAL("LayerShader should never be flattened.");
     }
 
-    virtual Factory getFactory() const {
+    virtual Factory getFactory() const override {
         LOG_ALWAYS_FATAL("LayerShader should never be created from a stream.");
-        return NULL;
+        return nullptr;
     }
 private:
     // Unowned.
@@ -1096,7 +1092,7 @@
         const SkPath* maskPath = layer->getConvexMask();
         DRAW_DOUBLE_STENCIL(drawConvexPath(*maskPath, &paint));
 
-        paint.setShader(NULL);
+        paint.setShader(nullptr);
         restore();
 
         return;
@@ -1177,7 +1173,7 @@
 
         if (numQuads >= gMaxNumberOfQuads) {
             DRAW_DOUBLE_STENCIL(glDrawElements(GL_TRIANGLES, numQuads * 6,
-                            GL_UNSIGNED_SHORT, NULL));
+                    GL_UNSIGNED_SHORT, nullptr));
             numQuads = 0;
             mesh = mCaches.getRegionMesh();
         }
@@ -1185,7 +1181,7 @@
 
     if (numQuads > 0) {
         DRAW_DOUBLE_STENCIL(glDrawElements(GL_TRIANGLES, numQuads * 6,
-                        GL_UNSIGNED_SHORT, NULL));
+                GL_UNSIGNED_SHORT, nullptr));
     }
 
 #if DEBUG_LAYERS_AS_REGIONS
@@ -1271,7 +1267,7 @@
         GLsizei drawCount = min(elementsCount, (GLsizei) gMaxNumberOfQuads * 6);
 
         setupDrawIndexedVertices(&mesh[0].x);
-        glDrawElements(GL_TRIANGLES, drawCount, GL_UNSIGNED_SHORT, NULL);
+        glDrawElements(GL_TRIANGLES, drawCount, GL_UNSIGNED_SHORT, nullptr);
 
         elementsCount -= drawCount;
         // Though there are 4 vertices in a quad, we use 6 indices per
@@ -1412,13 +1408,13 @@
  * This method should be called when restoreDisplayState() won't be restoring the clip
  */
 void OpenGLRenderer::setupMergedMultiDraw(const Rect* clipRect) {
-    if (clipRect != NULL) {
+    if (clipRect != nullptr) {
         writableSnapshot()->setClip(clipRect->left, clipRect->top, clipRect->right, clipRect->bottom);
     } else {
         writableSnapshot()->setClip(0, 0, mState.getWidth(), mState.getHeight());
     }
     dirtyClip();
-    mCaches.setScissorEnabled(clipRect != NULL || mScissorOptimizationDisabled);
+    mCaches.setScissorEnabled(clipRect != nullptr || mScissorOptimizationDisabled);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1647,21 +1643,21 @@
 }
 
 void OpenGLRenderer::setupDrawShader(const SkShader* shader) {
-    if (shader != NULL) {
+    if (shader != nullptr) {
         SkiaShader::describe(&mCaches, mDescription, mExtensions, *shader);
     }
 }
 
 void OpenGLRenderer::setupDrawColorFilter(const SkColorFilter* filter) {
-    if (filter == NULL) {
+    if (filter == nullptr) {
         return;
     }
 
     SkXfermode::Mode mode;
-    if (filter->asColorMode(NULL, &mode)) {
+    if (filter->asColorMode(nullptr, &mode)) {
         mDescription.colorOp = ProgramDescription::kColorBlend;
         mDescription.colorMode = mode;
-    } else if (filter->asColorMatrix(NULL)) {
+    } else if (filter->asColorMatrix(nullptr)) {
         mDescription.colorOp = ProgramDescription::kColorMatrix;
     }
 }
@@ -1728,7 +1724,8 @@
 
     bool dirty = right - left > 0.0f && bottom - top > 0.0f;
     const Matrix4& transformMatrix = ignoreTransform ? Matrix4::identity() : *currentTransform();
-    mCaches.currentProgram->set(writableSnapshot()->getOrthoMatrix(), mModelViewMatrix, transformMatrix, offset);
+    mCaches.currentProgram->set(writableSnapshot()->getOrthoMatrix(),
+            mModelViewMatrix, transformMatrix, offset);
     if (dirty && mTrackDirtyRegions) {
         if (!ignoreTransform) {
             dirtyLayer(left, top, right, bottom, *currentTransform());
@@ -1751,7 +1748,7 @@
 }
 
 void OpenGLRenderer::setupDrawShaderUniforms(const SkShader* shader, bool ignoreTransform) {
-    if (shader == NULL) {
+    if (shader == nullptr) {
         return;
     }
 
@@ -1769,7 +1766,7 @@
 }
 
 void OpenGLRenderer::setupDrawColorFilterUniforms(const SkColorFilter* filter) {
-    if (NULL == filter) {
+    if (nullptr == filter) {
         return;
     }
 
@@ -1817,7 +1814,7 @@
 
 void OpenGLRenderer::setupDrawSimpleMesh() {
     bool force = mCaches.bindMeshBuffer();
-    mCaches.bindPositionVertexPointer(force, 0);
+    mCaches.bindPositionVertexPointer(force, nullptr);
     mCaches.unbindIndicesBuffer();
 }
 
@@ -1937,7 +1934,8 @@
     }
 }
 
-void OpenGLRenderer::drawAlphaBitmap(Texture* texture, float left, float top, const SkPaint* paint) {
+void OpenGLRenderer::drawAlphaBitmap(Texture* texture, float left, float top,
+        const SkPaint* paint) {
     float x = left;
     float y = top;
 
@@ -1957,7 +1955,7 @@
     // No need to check for a UV mapper on the texture object, only ARGB_8888
     // bitmaps get packed in the atlas
     drawAlpha8TextureMesh(x, y, x + texture->width, y + texture->height, texture->id,
-            paint, (GLvoid*) NULL, (GLvoid*) gMeshTextureOffset,
+            paint, (GLvoid*) nullptr, (GLvoid*) gMeshTextureOffset,
             GL_TRIANGLE_STRIP, gMeshCount, ignoreTransform);
 }
 
@@ -2378,14 +2376,16 @@
         glDrawArrays(GL_TRIANGLE_STRIP, 0, vertexBuffer.getVertexCount());
     } else if (mode == VertexBuffer::kOnePolyRingShadow) {
         mCaches.bindShadowIndicesBuffer();
-        glDrawElements(GL_TRIANGLE_STRIP, ONE_POLY_RING_SHADOW_INDEX_COUNT, GL_UNSIGNED_SHORT, 0);
+        glDrawElements(GL_TRIANGLE_STRIP, ONE_POLY_RING_SHADOW_INDEX_COUNT,
+                GL_UNSIGNED_SHORT, nullptr);
     } else if (mode == VertexBuffer::kTwoPolyRingShadow) {
         mCaches.bindShadowIndicesBuffer();
-        glDrawElements(GL_TRIANGLE_STRIP, TWO_POLY_RING_SHADOW_INDEX_COUNT, GL_UNSIGNED_SHORT, 0);
+        glDrawElements(GL_TRIANGLE_STRIP, TWO_POLY_RING_SHADOW_INDEX_COUNT,
+                GL_UNSIGNED_SHORT, nullptr);
     } else if (mode == VertexBuffer::kIndices) {
         mCaches.unbindIndicesBuffer();
-        glDrawElements(GL_TRIANGLE_STRIP, vertexBuffer.getIndexCount(), GL_UNSIGNED_SHORT,
-                vertexBuffer.getIndices());
+        glDrawElements(GL_TRIANGLE_STRIP, vertexBuffer.getIndexCount(),
+                GL_UNSIGNED_SHORT, vertexBuffer.getIndices());
     }
 
     if (isAA) {
@@ -2495,7 +2495,7 @@
         return;
     }
 
-    if (p->getPathEffect() != 0) {
+    if (p->getPathEffect() != nullptr) {
         mCaches.activeTexture(0);
         const PathTexture* texture = mCaches.pathCache.getRoundRect(
                 right - left, bottom - top, rx, ry, p);
@@ -2513,7 +2513,7 @@
             || paintWillNotDraw(*p)) {
         return;
     }
-    if (p->getPathEffect() != 0) {
+    if (p->getPathEffect() != nullptr) {
         mCaches.activeTexture(0);
         const PathTexture* texture = mCaches.pathCache.getCircle(radius, p);
         drawShape(x - radius, y - radius, texture, p);
@@ -2536,7 +2536,7 @@
         return;
     }
 
-    if (p->getPathEffect() != 0) {
+    if (p->getPathEffect() != nullptr) {
         mCaches.activeTexture(0);
         const PathTexture* texture = mCaches.pathCache.getOval(right - left, bottom - top, p);
         drawShape(left, top, texture, p);
@@ -2560,7 +2560,7 @@
     }
 
     // TODO: support fills (accounting for concavity if useCenter && sweepAngle > 180)
-    if (p->getStyle() != SkPaint::kStroke_Style || p->getPathEffect() != 0 || useCenter) {
+    if (p->getStyle() != SkPaint::kStroke_Style || p->getPathEffect() != nullptr || useCenter) {
         mCaches.activeTexture(0);
         const PathTexture* texture = mCaches.pathCache.getArc(right - left, bottom - top,
                 startAngle, sweepAngle, useCenter, p);
@@ -2596,7 +2596,7 @@
 
     if (p->getStyle() != SkPaint::kFill_Style) {
         // only fill style is supported by drawConvexPath, since others have to handle joins
-        if (p->getPathEffect() != 0 || p->getStrokeJoin() != SkPaint::kMiter_Join ||
+        if (p->getPathEffect() != nullptr || p->getStrokeJoin() != SkPaint::kMiter_Join ||
                 p->getStrokeMiter() != SkPaintDefaults_MiterLimit) {
             mCaches.activeTexture(0);
             const PathTexture* texture =
@@ -2665,7 +2665,7 @@
     setupDrawPureColorUniforms();
     setupDrawColorFilterUniforms(getColorFilter(paint));
     setupDrawShaderUniforms(getShader(paint));
-    setupDrawMesh(NULL, (GLvoid*) gMeshTextureOffset);
+    setupDrawMesh(nullptr, (GLvoid*) gMeshTextureOffset);
 
     glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
 }
@@ -2677,7 +2677,7 @@
 
 void OpenGLRenderer::drawPosText(const char* text, int bytesCount, int count,
         const float* positions, const SkPaint* paint) {
-    if (text == NULL || count == 0 || mState.currentlyIgnored() || canSkipText(paint)) {
+    if (text == nullptr || count == 0 || mState.currentlyIgnored() || canSkipText(paint)) {
         return;
     }
 
@@ -2722,7 +2722,7 @@
 
     TextSetupFunctor functor(this, x, y, pureTranslate, alpha, mode, paint);
     if (fontRenderer.renderPosText(paint, clip, text, 0, bytesCount, count, x, y,
-            positions, hasActiveLayer ? &bounds : NULL, &functor)) {
+            positions, hasActiveLayer ? &bounds : nullptr, &functor)) {
         if (hasActiveLayer) {
             if (!pureTranslate) {
                 currentTransform()->mapRect(bounds);
@@ -2825,7 +2825,7 @@
     if (drawOpMode == kDrawOpMode_Immediate) {
         // The checks for corner-case ignorable text and quick rejection is only done for immediate
         // drawing as ops from DeferredDisplayList are already filtered for these
-        if (text == NULL || count == 0 || mState.currentlyIgnored() || canSkipText(paint) ||
+        if (text == nullptr || count == 0 || mState.currentlyIgnored() || canSkipText(paint) ||
                 quickRejectSetupScissor(bounds)) {
             return;
         }
@@ -2875,7 +2875,7 @@
     fontRenderer.setTextureFiltering(linearFilter);
 
     // TODO: Implement better clipping for scaled/rotated text
-    const Rect* clip = !pureTranslate ? NULL : mState.currentClipRect();
+    const Rect* clip = !pureTranslate ? nullptr : mState.currentClipRect();
     Rect layerBounds(FLT_MAX / 2.0f, FLT_MAX / 2.0f, FLT_MIN / 2.0f, FLT_MIN / 2.0f);
 
     bool status;
@@ -2887,10 +2887,10 @@
         SkPaint paintCopy(*paint);
         paintCopy.setTextAlign(SkPaint::kLeft_Align);
         status = fontRenderer.renderPosText(&paintCopy, clip, text, 0, bytesCount, count, x, y,
-                positions, hasActiveLayer ? &layerBounds : NULL, &functor, forceFinish);
+                positions, hasActiveLayer ? &layerBounds : nullptr, &functor, forceFinish);
     } else {
         status = fontRenderer.renderPosText(paint, clip, text, 0, bytesCount, count, x, y,
-                positions, hasActiveLayer ? &layerBounds : NULL, &functor, forceFinish);
+                positions, hasActiveLayer ? &layerBounds : nullptr, &functor, forceFinish);
     }
 
     if ((status || drawOpMode != kDrawOpMode_Immediate) && hasActiveLayer) {
@@ -2907,7 +2907,7 @@
 
 void OpenGLRenderer::drawTextOnPath(const char* text, int bytesCount, int count,
         const SkPath* path, float hOffset, float vOffset, const SkPaint* paint) {
-    if (text == NULL || count == 0 || mState.currentlyIgnored() || canSkipText(paint)) {
+    if (text == nullptr || count == 0 || mState.currentlyIgnored() || canSkipText(paint)) {
         return;
     }
 
@@ -2929,7 +2929,7 @@
     const bool hasActiveLayer = hasLayer();
 
     if (fontRenderer.renderTextOnPath(paint, clip, text, 0, bytesCount, count, path,
-            hOffset, vOffset, hasActiveLayer ? &bounds : NULL, &functor)) {
+            hOffset, vOffset, hasActiveLayer ? &bounds : nullptr, &functor)) {
         if (hasActiveLayer) {
             currentTransform()->mapRect(bounds);
             dirtyLayerUnchecked(bounds, getRegion());
@@ -2960,7 +2960,7 @@
         return;
     }
 
-    mat4* transform = NULL;
+    mat4* transform = nullptr;
     if (layer->isTextureLayer()) {
         transform = &layer->getTransform();
         if (!transform->isIdentity()) {
@@ -2970,8 +2970,9 @@
     }
 
     bool clipRequired = false;
-    const bool rejected = mState.calculateQuickRejectForScissor(x, y,
-            x + layer->layer.getWidth(), y + layer->layer.getHeight(), &clipRequired, NULL, false);
+    const bool rejected = mState.calculateQuickRejectForScissor(
+            x, y, x + layer->layer.getWidth(), y + layer->layer.getHeight(),
+            &clipRequired, nullptr, false);
 
     if (rejected) {
         if (transform && !transform->isIdentity()) {
@@ -3025,7 +3026,7 @@
 
                 setupDrawMeshIndices(&mesh[0].x, &mesh[0].u);
                 DRAW_DOUBLE_STENCIL_IF(!layer->hasDrawnSinceUpdate,
-                        glDrawElements(GL_TRIANGLES, drawCount, GL_UNSIGNED_SHORT, NULL));
+                        glDrawElements(GL_TRIANGLES, drawCount, GL_UNSIGNED_SHORT, nullptr));
 
                 elementsCount -= drawCount;
                 // Though there are 4 vertices in a quad, we use 6 indices per
@@ -3099,7 +3100,7 @@
     setupDrawPureColorUniforms();
     setupDrawColorFilterUniforms(getColorFilter(paint));
     setupDrawShaderUniforms(getShader(paint));
-    setupDrawMesh(NULL, (GLvoid*) gMeshTextureOffset);
+    setupDrawMesh(nullptr, (GLvoid*) gMeshTextureOffset);
 
     glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
 }
@@ -3287,7 +3288,7 @@
         Texture* texture, const SkPaint* paint) {
     texture->setWrap(GL_CLAMP_TO_EDGE, true);
 
-    GLvoid* vertices = (GLvoid*) NULL;
+    GLvoid* vertices = (GLvoid*) nullptr;
     GLvoid* texCoords = (GLvoid*) gMeshTextureOffset;
 
     if (texture->uvMapper) {
@@ -3370,7 +3371,7 @@
     setupDrawColorFilterUniforms(getColorFilter(paint));
     setupDrawMeshIndices(vertices, texCoords, vbo);
 
-    glDrawElements(drawMode, elementsCount, GL_UNSIGNED_SHORT, NULL);
+    glDrawElements(drawMode, elementsCount, GL_UNSIGNED_SHORT, nullptr);
 }
 
 void OpenGLRenderer::drawAlpha8TextureMesh(float left, float top, float right, float bottom,
@@ -3378,14 +3379,14 @@
         GLvoid* vertices, GLvoid* texCoords, GLenum drawMode, GLsizei elementsCount,
         bool ignoreTransform, ModelViewMode modelViewMode, bool dirty) {
 
-    int color = paint != NULL ? paint->getColor() : 0;
+    int color = paint != nullptr ? paint->getColor() : 0;
     int alpha;
     SkXfermode::Mode mode;
     getAlphaAndMode(paint, &alpha, &mode);
 
     setupDraw();
     setupDrawWithTexture(true);
-    if (paint != NULL) {
+    if (paint != nullptr) {
         setupDrawAlpha8Color(color, alpha);
     }
     setupDrawColorFilter(getColorFilter(paint));
@@ -3406,7 +3407,7 @@
 void OpenGLRenderer::chooseBlending(bool blend, SkXfermode::Mode mode,
         ProgramDescription& description, bool swapSrcDst) {
 
-    if (writableSnapshot()->roundRectClipState != NULL /*&& !mSkipOutlineClip*/) {
+    if (writableSnapshot()->roundRectClipState != nullptr /*&& !mSkipOutlineClip*/) {
         blend = true;
         mDescription.hasRoundRectClip = true;
     }
@@ -3456,7 +3457,7 @@
 
 bool OpenGLRenderer::useProgram(Program* program) {
     if (!program->isInUse()) {
-        if (mCaches.currentProgram != NULL) mCaches.currentProgram->remove();
+        if (mCaches.currentProgram != nullptr) mCaches.currentProgram->remove();
         program->use();
         mCaches.currentProgram = program;
         return false;
@@ -3472,7 +3473,8 @@
     TextureVertex::setUV(v++, u2, v2);
 }
 
-void OpenGLRenderer::getAlphaAndMode(const SkPaint* paint, int* alpha, SkXfermode::Mode* mode) const {
+void OpenGLRenderer::getAlphaAndMode(const SkPaint* paint, int* alpha,
+        SkXfermode::Mode* mode) const {
     getAlphaAndModeDirect(paint, alpha,  mode);
     if (mDrawModifiers.mOverrideLayerAlpha < 1.0f) {
         // if drawing a layer, ignore the paint's alpha
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index d3c35a8..fbb90a7 100755
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -126,13 +126,14 @@
     void initLight(const Vector3& lightCenter, float lightRadius,
             uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha);
 
-    virtual void prepareDirty(float left, float top, float right, float bottom, bool opaque);
-    virtual void prepare(bool opaque) {
+    virtual void prepareDirty(float left, float top, float right, float bottom,
+            bool opaque) override;
+    virtual void prepare(bool opaque) override {
         prepareDirty(0.0f, 0.0f, mState.getWidth(), mState.getHeight(), opaque);
     }
-    virtual bool finish();
+    virtual bool finish() override;
 
-    virtual void callDrawGLFunction(Functor* functor, Rect& dirty);
+    virtual void callDrawGLFunction(Functor* functor, Rect& dirty) override;
 
     void pushLayerUpdate(Layer* layer);
     void cancelLayerUpdate(Layer* layer);
@@ -140,8 +141,8 @@
     void markLayersAsBuildLayers();
 
     virtual int saveLayer(float left, float top, float right, float bottom,
-            const SkPaint* paint, int flags) {
-        return saveLayer(left, top, right, bottom, paint, flags, NULL);
+            const SkPaint* paint, int flags) override {
+        return saveLayer(left, top, right, bottom, paint, flags, nullptr);
     }
 
     // Specialized saveLayer implementation, which will pass the convexMask to an FBO layer, if
@@ -152,49 +153,51 @@
     int saveLayerDeferred(float left, float top, float right, float bottom,
             const SkPaint* paint, int flags);
 
-    virtual void drawRenderNode(RenderNode* displayList, Rect& dirty, int32_t replayFlags = 1);
+    virtual void drawRenderNode(RenderNode* displayList, Rect& dirty,
+            int32_t replayFlags = 1) override;
     virtual void drawLayer(Layer* layer, float x, float y);
-    virtual void drawBitmap(const SkBitmap* bitmap, const SkPaint* paint);
+    virtual void drawBitmap(const SkBitmap* bitmap, const SkPaint* paint) override;
     void drawBitmaps(const SkBitmap* bitmap, AssetAtlas::Entry* entry, int bitmapCount,
             TextureVertex* vertices, bool pureTranslate, const Rect& bounds, const SkPaint* paint);
     virtual void drawBitmap(const SkBitmap* bitmap, float srcLeft, float srcTop,
             float srcRight, float srcBottom, float dstLeft, float dstTop,
-            float dstRight, float dstBottom, const SkPaint* paint);
-    virtual void drawBitmapData(const SkBitmap* bitmap, const SkPaint* paint);
+            float dstRight, float dstBottom, const SkPaint* paint) override;
+    virtual void drawBitmapData(const SkBitmap* bitmap, const SkPaint* paint) override;
     virtual void drawBitmapMesh(const SkBitmap* bitmap, int meshWidth, int meshHeight,
-            const float* vertices, const int* colors, const SkPaint* paint);
+            const float* vertices, const int* colors, const SkPaint* paint) override;
     void drawPatches(const SkBitmap* bitmap, AssetAtlas::Entry* entry,
             TextureVertex* vertices, uint32_t indexCount, const SkPaint* paint);
     virtual void drawPatch(const SkBitmap* bitmap, const Res_png_9patch* patch,
-            float left, float top, float right, float bottom, const SkPaint* paint);
+            float left, float top, float right, float bottom, const SkPaint* paint) override;
     void drawPatch(const SkBitmap* bitmap, const Patch* mesh, AssetAtlas::Entry* entry,
             float left, float top, float right, float bottom, const SkPaint* paint);
-    virtual void drawColor(int color, SkXfermode::Mode mode);
+    virtual void drawColor(int color, SkXfermode::Mode mode) override;
     virtual void drawRect(float left, float top, float right, float bottom,
-            const SkPaint* paint);
+            const SkPaint* paint) override;
     virtual void drawRoundRect(float left, float top, float right, float bottom,
-            float rx, float ry, const SkPaint* paint);
-    virtual void drawCircle(float x, float y, float radius, const SkPaint* paint);
+            float rx, float ry, const SkPaint* paint) override;
+    virtual void drawCircle(float x, float y, float radius, const SkPaint* paint) override;
     virtual void drawOval(float left, float top, float right, float bottom,
-            const SkPaint* paint);
+            const SkPaint* paint) override;
     virtual void drawArc(float left, float top, float right, float bottom,
-            float startAngle, float sweepAngle, bool useCenter, const SkPaint* paint);
-    virtual void drawPath(const SkPath* path, const SkPaint* paint);
-    virtual void drawLines(const float* points, int count, const SkPaint* paint);
-    virtual void drawPoints(const float* points, int count, const SkPaint* paint);
+            float startAngle, float sweepAngle, bool useCenter, const SkPaint* paint) override;
+    virtual void drawPath(const SkPath* path, const SkPaint* paint) override;
+    virtual void drawLines(const float* points, int count, const SkPaint* paint) override;
+    virtual void drawPoints(const float* points, int count, const SkPaint* paint) override;
     virtual void drawTextOnPath(const char* text, int bytesCount, int count, const SkPath* path,
-            float hOffset, float vOffset, const SkPaint* paint);
+            float hOffset, float vOffset, const SkPaint* paint) override;
     virtual void drawPosText(const char* text, int bytesCount, int count,
-            const float* positions, const SkPaint* paint);
+            const float* positions, const SkPaint* paint) override;
     virtual void drawText(const char* text, int bytesCount, int count, float x, float y,
             const float* positions, const SkPaint* paint, float totalAdvance, const Rect& bounds,
-            DrawOpMode drawOpMode = kDrawOpMode_Immediate);
-    virtual void drawRects(const float* rects, int count, const SkPaint* paint);
+            DrawOpMode drawOpMode = kDrawOpMode_Immediate) override;
+    virtual void drawRects(const float* rects, int count, const SkPaint* paint) override;
 
     void drawShadow(float casterAlpha,
-            const VertexBuffer* ambientShadowVertexBuffer, const VertexBuffer* spotShadowVertexBuffer);
+            const VertexBuffer* ambientShadowVertexBuffer,
+            const VertexBuffer* spotShadowVertexBuffer);
 
-    virtual void setDrawFilter(SkDrawFilter* filter);
+    virtual void setDrawFilter(SkDrawFilter* filter) override;
 
     // If this value is set to < 1.0, it overrides alpha set on layer (see drawBitmap, drawLayer)
     void setOverrideLayerAlpha(float alpha) { mDrawModifiers.mOverrideLayerAlpha = alpha; }
@@ -264,7 +267,8 @@
      * @param alpha Where to store the resulting alpha
      * @param mode Where to store the resulting xfermode
      */
-    static inline void getAlphaAndModeDirect(const SkPaint* paint, int* alpha, SkXfermode::Mode* mode) {
+    static inline void getAlphaAndModeDirect(const SkPaint* paint, int* alpha,
+            SkXfermode::Mode* mode) {
         *mode = getXfermodeDirect(paint);
         *alpha = getAlphaDirect(paint);
     }
@@ -301,7 +305,7 @@
     }
 
     static inline bool hasTextShadow(const SkPaint* paint) {
-        return getTextShadow(paint, NULL);
+        return getTextShadow(paint, nullptr);
     }
 
     /**
@@ -335,34 +339,36 @@
     ///////////////////////////////////////////////////////////////////
     /// State manipulation
 
-    virtual void setViewport(int width, int height) { mState.setViewport(width, height); }
+    virtual void setViewport(int width, int height) override { mState.setViewport(width, height); }
 
-    virtual int getSaveCount() const;
-    virtual int save(int flags);
-    virtual void restore();
-    virtual void restoreToCount(int saveCount);
+    virtual int getSaveCount() const override;
+    virtual int save(int flags) override;
+    virtual void restore() override;
+    virtual void restoreToCount(int saveCount) override;
 
-    virtual void getMatrix(SkMatrix* outMatrix) const { mState.getMatrix(outMatrix); }
-    virtual void setMatrix(const SkMatrix& matrix) { mState.setMatrix(matrix); }
-    virtual void concatMatrix(const SkMatrix& matrix) { mState.concatMatrix(matrix); }
+    virtual void getMatrix(SkMatrix* outMatrix) const override { mState.getMatrix(outMatrix); }
+    virtual void setMatrix(const SkMatrix& matrix) override { mState.setMatrix(matrix); }
+    virtual void concatMatrix(const SkMatrix& matrix) override { mState.concatMatrix(matrix); }
 
-    virtual void translate(float dx, float dy, float dz = 0.0f);
-    virtual void rotate(float degrees);
-    virtual void scale(float sx, float sy);
-    virtual void skew(float sx, float sy);
+    virtual void translate(float dx, float dy, float dz = 0.0f) override;
+    virtual void rotate(float degrees) override;
+    virtual void scale(float sx, float sy) override;
+    virtual void skew(float sx, float sy) override;
 
     void setMatrix(const Matrix4& matrix); // internal only convenience method
     void concatMatrix(const Matrix4& matrix); // internal only convenience method
 
-    virtual const Rect& getLocalClipBounds() const { return mState.getLocalClipBounds(); }
+    virtual const Rect& getLocalClipBounds() const override { return mState.getLocalClipBounds(); }
     const Rect& getRenderTargetClipBounds() const { return mState.getRenderTargetClipBounds(); }
-    virtual bool quickRejectConservative(float left, float top, float right, float bottom) const {
+    virtual bool quickRejectConservative(float left, float top,
+            float right, float bottom) const override {
         return mState.quickRejectConservative(left, top, right, bottom);
     }
 
-    virtual bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op);
-    virtual bool clipPath(const SkPath* path, SkRegion::Op op);
-    virtual bool clipRegion(const SkRegion* region, SkRegion::Op op);
+    virtual bool clipRect(float left, float top,
+            float right, float bottom, SkRegion::Op op) override;
+    virtual bool clipPath(const SkPath* path, SkRegion::Op op) override;
+    virtual bool clipRegion(const SkRegion* region, SkRegion::Op op) override;
 
     /**
      * Does not support different clipping Ops (that is, every call to setClippingOutline is
@@ -380,9 +386,9 @@
     ///////////////////////////////////////////////////////////////////
     /// CanvasStateClient interface
 
-    virtual void onViewportInitialized();
-    virtual void onSnapshotRestored(const Snapshot& removed, const Snapshot& restored);
-    virtual GLuint onGetTargetFbo() const { return 0; }
+    virtual void onViewportInitialized() override;
+    virtual void onSnapshotRestored(const Snapshot& removed, const Snapshot& restored) override;
+    virtual GLuint onGetTargetFbo() const override { return 0; }
 
     SkPath* allocPathForFrame() {
         SkPath* path = new SkPath();
@@ -427,8 +433,8 @@
     void attachStencilBufferToLayer(Layer* layer);
 
     bool quickRejectSetupScissor(float left, float top, float right, float bottom,
-            const SkPaint* paint = NULL);
-    bool quickRejectSetupScissor(const Rect& bounds, const SkPaint* paint = NULL) {
+            const SkPaint* paint = nullptr);
+    bool quickRejectSetupScissor(const Rect& bounds, const SkPaint* paint = nullptr) {
         return quickRejectSetupScissor(bounds.left, bounds.top,
                 bounds.right, bounds.bottom, paint);
     }
@@ -495,7 +501,7 @@
      * null then null is returned.
      */
     static inline SkColorFilter* getColorFilter(const SkPaint* paint) {
-        return paint ? paint->getColorFilter() : NULL;
+        return paint ? paint->getColorFilter() : nullptr;
     }
 
     /**
@@ -503,7 +509,7 @@
      * null then null is returned.
      */
     static inline const SkShader* getShader(const SkPaint* paint) {
-        return paint ? paint->getShader() : NULL;
+        return paint ? paint->getShader() : nullptr;
     }
 
     /**
@@ -903,8 +909,8 @@
      * space must be scaled up and translated to fill the quad provided in (l,t,r,b). These
      * transformations are stored in the modelView matrix and uploaded to the shader.
      *
-     * @param offset Set to true if the the matrix should be fudged (translated) slightly to disambiguate
-     * geometry pixel positioning. See Vertex::GeometryFudgeFactor().
+     * @param offset Set to true if the the matrix should be fudged (translated) slightly to
+     * disambiguate geometry pixel positioning. See Vertex::GeometryFudgeFactor().
      *
      * @param ignoreTransform Set to true if l,t,r,b coordinates already in layer space,
      * currentTransform() will be ignored. (e.g. when drawing clip in layer coordinates to stencil,
@@ -930,7 +936,7 @@
     void setupDrawTextureTransform();
     void setupDrawTextureTransformUniforms(mat4& transform);
     void setupDrawTextGammaUniforms();
-    void setupDrawMesh(const GLvoid* vertices, const GLvoid* texCoords = NULL, GLuint vbo = 0);
+    void setupDrawMesh(const GLvoid* vertices, const GLvoid* texCoords = nullptr, GLuint vbo = 0);
     void setupDrawMesh(const GLvoid* vertices, const GLvoid* texCoords, const GLvoid* colors);
     void setupDrawMeshIndices(const GLvoid* vertices, const GLvoid* texCoords, GLuint vbo = 0);
     void setupDrawIndexedVertices(GLvoid* vertices);
diff --git a/libs/hwui/Outline.h b/libs/hwui/Outline.h
index 6dacd5ed..5e9b213 100644
--- a/libs/hwui/Outline.h
+++ b/libs/hwui/Outline.h
@@ -95,7 +95,7 @@
     }
 
     const SkPath* getPath() const {
-        if (mType == kOutlineType_None || mType == kOutlineType_Empty) return NULL;
+        if (mType == kOutlineType_None || mType == kOutlineType_Empty) return nullptr;
 
         return &mPath;
     }
diff --git a/libs/hwui/Patch.h b/libs/hwui/Patch.h
index d5bbfa6..1af4bb7 100644
--- a/libs/hwui/Patch.h
+++ b/libs/hwui/Patch.h
@@ -31,7 +31,7 @@
 namespace android {
 namespace uirenderer {
 
-class TextureVertex;
+struct TextureVertex;
 
 ///////////////////////////////////////////////////////////////////////////////
 // 9-patch structures
diff --git a/libs/hwui/PatchCache.h b/libs/hwui/PatchCache.h
index 1e40997..4cb5338 100644
--- a/libs/hwui/PatchCache.h
+++ b/libs/hwui/PatchCache.h
@@ -91,7 +91,7 @@
 
 private:
     struct PatchDescription {
-        PatchDescription(): mPatch(NULL), mBitmapWidth(0), mBitmapHeight(0),
+        PatchDescription(): mPatch(nullptr), mBitmapWidth(0), mBitmapHeight(0),
                 mPixelWidth(0), mPixelHeight(0) {
         }
 
@@ -146,7 +146,7 @@
      * to track available regions of memory in the VBO.
      */
     struct BufferBlock {
-        BufferBlock(uint32_t offset, uint32_t size): offset(offset), size(size), next(NULL) {
+        BufferBlock(uint32_t offset, uint32_t size): offset(offset), size(size), next(nullptr) {
         }
 
         uint32_t offset;
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index b0f00c7..ecd3712 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -87,7 +87,7 @@
     }
 
     void clearTask() {
-        if (mTask != NULL) {
+        if (mTask != nullptr) {
             mTask.clear();
         }
     }
@@ -165,7 +165,7 @@
      * Used as a callback when an entry is removed from the cache.
      * Do not invoke directly.
      */
-    void operator()(PathDescription& path, PathTexture*& texture);
+    void operator()(PathDescription& path, PathTexture*& texture) override;
 
     /**
      * Clears the cache. This causes all textures to be deleted.
@@ -292,7 +292,7 @@
         PathProcessor(Caches& caches);
         ~PathProcessor() { }
 
-        virtual void onProcess(const sp<Task<SkBitmap*> >& task);
+        virtual void onProcess(const sp<Task<SkBitmap*> >& task) override;
 
     private:
         uint32_t mMaxTextureSize;
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 7b9459a..a0312e1 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -255,7 +255,7 @@
 
 static inline DebugLevel readDebugLevel() {
     char property[PROPERTY_VALUE_MAX];
-    if (property_get(PROPERTY_DEBUG, property, NULL) > 0) {
+    if (property_get(PROPERTY_DEBUG, property, nullptr) > 0) {
         return (DebugLevel) atoi(property);
     }
     return kDebugDisabled;
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index 13265a9..b046b6f 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -248,7 +248,7 @@
         bottom = fmaxf(bottom, y);
     }
 
-    void dump(const char* label = NULL) const {
+    void dump(const char* label = nullptr) const {
         ALOGD("%s[l=%f t=%f r=%f b=%f]", label ? label : "Rect", left, top, right, bottom);
     }
 
diff --git a/libs/hwui/RenderBufferCache.h b/libs/hwui/RenderBufferCache.h
index af8060f..6c668b0 100644
--- a/libs/hwui/RenderBufferCache.h
+++ b/libs/hwui/RenderBufferCache.h
@@ -78,11 +78,11 @@
 private:
     struct RenderBufferEntry {
         RenderBufferEntry():
-            mBuffer(NULL), mWidth(0), mHeight(0) {
+            mBuffer(nullptr), mWidth(0), mHeight(0) {
         }
 
         RenderBufferEntry(GLenum format, const uint32_t width, const uint32_t height):
-            mBuffer(NULL), mFormat(format), mWidth(width), mHeight(height) {
+            mBuffer(nullptr), mFormat(format), mWidth(width), mHeight(height) {
         }
 
         RenderBufferEntry(RenderBuffer* buffer):
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index be43e60..f0e22d6 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -188,7 +188,7 @@
         if (matrix) {
             mStaticMatrix = new SkMatrix(*matrix);
         } else {
-            mStaticMatrix = NULL;
+            mStaticMatrix = nullptr;
         }
         return true;
     }
@@ -203,7 +203,7 @@
         if (matrix) {
             mAnimationMatrix = new SkMatrix(*matrix);
         } else {
-            mAnimationMatrix = NULL;
+            mAnimationMatrix = nullptr;
         }
         return true;
     }
@@ -571,7 +571,7 @@
 
     bool hasShadow() const {
         return getZ() > 0.0f
-                && getOutline().getPath() != NULL
+                && getOutline().getPath() != nullptr
                 && getOutline().getAlpha() != 0.0f;
     }
 
diff --git a/libs/hwui/Renderer.h b/libs/hwui/Renderer.h
index 2b7b567..ee44d7a 100644
--- a/libs/hwui/Renderer.h
+++ b/libs/hwui/Renderer.h
@@ -79,13 +79,13 @@
     // TODO: move to a method on android:Paint
     static inline bool paintWillNotDrawText(const SkPaint& paint) {
         return paint.getAlpha() == 0
-                && paint.getLooper() == NULL
+                && paint.getLooper() == nullptr
                 && !paint.getColorFilter()
                 && getXfermode(paint.getXfermode()) == SkXfermode::kSrcOver_Mode;
     }
 
     static bool isBlendedColorFilter(const SkColorFilter* filter) {
-        if (filter == NULL) {
+        if (filter == nullptr) {
             return false;
         }
         return (filter->getFlags() & SkColorFilter::kAlphaUnchanged_Flag) == 0;
diff --git a/libs/hwui/RevealClip.h b/libs/hwui/RevealClip.h
index a9600f1..0084a8e 100644
--- a/libs/hwui/RevealClip.h
+++ b/libs/hwui/RevealClip.h
@@ -54,7 +54,7 @@
     float getRadius() const { return mRadius; }
 
     const SkPath* getPath() const {
-        if (!mShouldClip) return NULL;
+        if (!mShouldClip) return nullptr;
 
         return &mPath;
     }
diff --git a/libs/hwui/TessellationCache.h b/libs/hwui/TessellationCache.h
index a7c50eb..3efeaf6 100644
--- a/libs/hwui/TessellationCache.h
+++ b/libs/hwui/TessellationCache.h
@@ -166,7 +166,7 @@
     sp<TaskProcessor<VertexBuffer*> > mProcessor;
     LruCache<Description, Buffer*> mCache;
     class BufferRemovedListener : public OnEntryRemoved<Description, Buffer*> {
-        void operator()(Description& description, Buffer*& buffer);
+        void operator()(Description& description, Buffer*& buffer) override;
     };
     BufferRemovedListener mBufferRemovedListener;
 
@@ -178,8 +178,8 @@
     // holds a pointer, and implicit strong ref to each shadow task of the frame
     LruCache<ShadowDescription, Task<vertexBuffer_pair_t*>*> mShadowCache;
     class BufferPairRemovedListener : public OnEntryRemoved<ShadowDescription, Task<vertexBuffer_pair_t*>*> {
-        void operator()(ShadowDescription& description, Task<vertexBuffer_pair_t*>*& bufferPairTask) {
-            bufferPairTask->decStrong(NULL);
+        void operator()(ShadowDescription& description, Task<vertexBuffer_pair_t*>*& bufferPairTask) override {
+            bufferPairTask->decStrong(nullptr);
         }
     };
     BufferPairRemovedListener mBufferPairRemovedListener;
diff --git a/libs/hwui/TextDropShadowCache.h b/libs/hwui/TextDropShadowCache.h
index bb53a23..caf089f 100644
--- a/libs/hwui/TextDropShadowCache.h
+++ b/libs/hwui/TextDropShadowCache.h
@@ -34,8 +34,8 @@
 class FontRenderer;
 
 struct ShadowText {
-    ShadowText(): len(0), radius(0.0f), textSize(0.0f), typeface(NULL),
-            flags(0), italicStyle(0.0f), scaleX(0), text(NULL), positions(NULL) {
+    ShadowText(): len(0), radius(0.0f), textSize(0.0f), typeface(nullptr),
+            flags(0), italicStyle(0.0f), scaleX(0), text(nullptr), positions(nullptr) {
     }
 
     // len is the number of bytes in text
@@ -76,7 +76,7 @@
         uint32_t charCount = len / sizeof(char16_t);
         str.setTo((const char16_t*) text, charCount);
         text = str.string();
-        if (positions != NULL) {
+        if (positions != nullptr) {
             positionsCopy.clear();
             positionsCopy.appendArray(positions, charCount * 2);
             positions = positionsCopy.array();
@@ -134,7 +134,7 @@
      * Used as a callback when an entry is removed from the cache.
      * Do not invoke directly.
      */
-    void operator()(ShadowText& text, ShadowTexture*& texture);
+    void operator()(ShadowText& text, ShadowTexture*& texture) override;
 
     ShadowTexture* get(const SkPaint* paint, const char* text, uint32_t len,
             int numGlyphs, float radius, const float* positions);
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h
index d7d51a1..0e33e4c 100644
--- a/libs/hwui/TextureCache.h
+++ b/libs/hwui/TextureCache.h
@@ -62,7 +62,7 @@
      * Used as a callback when an entry is removed from the cache.
      * Do not invoke directly.
      */
-    void operator()(uint32_t&, Texture*& texture);
+    void operator()(uint32_t&, Texture*& texture) override;
 
     /**
      * Resets all Textures to not be marked as in use
diff --git a/libs/hwui/VertexBuffer.h b/libs/hwui/VertexBuffer.h
index 8c3a272..d81dd42 100644
--- a/libs/hwui/VertexBuffer.h
+++ b/libs/hwui/VertexBuffer.h
@@ -32,17 +32,17 @@
     };
 
     VertexBuffer()
-            : mBuffer(0)
-            , mIndices(0)
+            : mBuffer(nullptr)
+            , mIndices(nullptr)
             , mVertexCount(0)
             , mIndexCount(0)
             , mAllocatedVertexCount(0)
             , mAllocatedIndexCount(0)
             , mByteCount(0)
             , mMode(kStandard)
-            , mReallocBuffer(0)
-            , mCleanupMethod(NULL)
-            , mCleanupIndexMethod(NULL)
+            , mReallocBuffer(nullptr)
+            , mCleanupMethod(nullptr)
+            , mCleanupIndexMethod(nullptr)
     {}
 
     ~VertexBuffer() {
diff --git a/libs/hwui/font/CacheTexture.h b/libs/hwui/font/CacheTexture.h
index a107c7a..5d3f959 100644
--- a/libs/hwui/font/CacheTexture.h
+++ b/libs/hwui/font/CacheTexture.h
@@ -54,7 +54,7 @@
     CacheBlock* mPrev;
 
     CacheBlock(uint16_t x, uint16_t y, uint16_t width, uint16_t height):
-            mX(x), mY(y), mWidth(width), mHeight(height), mNext(NULL), mPrev(NULL) {
+            mX(x), mY(y), mWidth(width), mHeight(height), mNext(nullptr), mPrev(nullptr) {
     }
 
     static CacheBlock* insertBlock(CacheBlock* head, CacheBlock* newBlock);
@@ -146,7 +146,7 @@
     }
 
     uint16_t* indices() const {
-        return (uint16_t*) 0;
+        return (uint16_t*) nullptr;
     }
 
     void resetMesh() {
diff --git a/libs/hwui/font/Font.h b/libs/hwui/font/Font.h
index d54bc44..3119d73 100644
--- a/libs/hwui/font/Font.h
+++ b/libs/hwui/font/Font.h
@@ -38,7 +38,7 @@
 // Font
 ///////////////////////////////////////////////////////////////////////////////
 
-class CachedGlyphInfo;
+struct CachedGlyphInfo;
 class CacheTexture;
 class FontRenderer;
 
@@ -120,7 +120,7 @@
     void measure(const SkPaint* paint, const char* text, uint32_t start, uint32_t len,
             int numGlyphs, Rect *bounds, const float* positions);
 
-    void invalidateTextureCache(CacheTexture* cacheTexture = NULL);
+    void invalidateTextureCache(CacheTexture* cacheTexture = nullptr);
 
     CachedGlyphInfo* cacheGlyph(const SkPaint* paint, glyph_t glyph, bool precaching);
     void updateGlyphCache(const SkPaint* paint, const SkGlyph& skiaGlyph,
diff --git a/libs/hwui/renderthread/RenderTask.cpp b/libs/hwui/renderthread/RenderTask.cpp
index 13970ba..b14f580 100644
--- a/libs/hwui/renderthread/RenderTask.cpp
+++ b/libs/hwui/renderthread/RenderTask.cpp
@@ -14,15 +14,8 @@
  * limitations under the License.
  */
 
-// LOG_TAG is being provided by the Makefile, reset.
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "RenderTask"
-
 #include "RenderTask.h"
 
-#include <utils/Log.h>
 #include <utils/Condition.h>
 #include <utils/Mutex.h>
 
diff --git a/libs/hwui/thread/TaskManager.h b/libs/hwui/thread/TaskManager.h
index 5a933ab..10e8b9e 100644
--- a/libs/hwui/thread/TaskManager.h
+++ b/libs/hwui/thread/TaskManager.h
@@ -84,8 +84,8 @@
         void exit();
 
     private:
-        virtual status_t readyToRun();
-        virtual bool threadLoop();
+        virtual status_t readyToRun() override;
+        virtual bool threadLoop() override;
 
         // Lock for the list of tasks
         mutable Mutex mLock;
diff --git a/libs/hwui/thread/TaskProcessor.h b/libs/hwui/thread/TaskProcessor.h
index d1269f0..eb4ab64 100644
--- a/libs/hwui/thread/TaskProcessor.h
+++ b/libs/hwui/thread/TaskProcessor.h
@@ -47,7 +47,7 @@
     virtual void onProcess(const sp<Task<T> >& task) = 0;
 
 private:
-    virtual void process(const sp<TaskBase>& task) {
+    virtual void process(const sp<TaskBase>& task) override {
         sp<Task<T> > realTask = static_cast<Task<T>* >(task.get());
         // This is the right way to do it but sp<> doesn't play nice
         // sp<Task<T> > realTask = static_cast<sp<Task<T> > >(task);
diff --git a/libs/hwui/utils/SortedList.h b/libs/hwui/utils/SortedList.h
index 2fa890a..a2c8c52 100644
--- a/libs/hwui/utils/SortedList.h
+++ b/libs/hwui/utils/SortedList.h
@@ -93,13 +93,13 @@
     }
 
 protected:
-    virtual void do_construct(void* storage, size_t num) const;
-    virtual void do_destroy(void* storage, size_t num) const;
-    virtual void do_copy(void* dest, const void* from, size_t num) const;
-    virtual void do_splat(void* dest, const void* item, size_t num) const;
-    virtual void do_move_forward(void* dest, const void* from, size_t num) const;
-    virtual void do_move_backward(void* dest, const void* from, size_t num) const;
-    virtual int do_compare(const void* lhs, const void* rhs) const;
+    virtual void do_construct(void* storage, size_t num) const override;
+    virtual void do_destroy(void* storage, size_t num) const override;
+    virtual void do_copy(void* dest, const void* from, size_t num) const override;
+    virtual void do_splat(void* dest, const void* item, size_t num) const override;
+    virtual void do_move_forward(void* dest, const void* from, size_t num) const override;
+    virtual void do_move_backward(void* dest, const void* from, size_t num) const override;
+    virtual int do_compare(const void* lhs, const void* rhs) const override;
 }; // class SortedList
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/utils/SortedListImpl.h b/libs/hwui/utils/SortedListImpl.h
index dc385b5..b101826 100644
--- a/libs/hwui/utils/SortedListImpl.h
+++ b/libs/hwui/utils/SortedListImpl.h
@@ -41,7 +41,7 @@
     virtual int do_compare(const void* lhs, const void* rhs) const = 0;
 
 private:
-    ssize_t _indexOrderOf(const void* item, size_t* order = 0) const;
+    ssize_t _indexOrderOf(const void* item, size_t* order = nullptr) const;
 
     // these are made private, because they can't be used on a SortedVector
     // (they don't have an implementation either)
diff --git a/packages/BackupRestoreConfirmation/res/values-my-rMM/strings.xml b/packages/BackupRestoreConfirmation/res/values-my-rMM/strings.xml
index 6e276ec..d499771 100644
--- a/packages/BackupRestoreConfirmation/res/values-my-rMM/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-my-rMM/strings.xml
@@ -16,21 +16,21 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="backup_confirm_title" msgid="827563724209303345">"အရံ သိမ်းဆည်းမှု အပြည့်လုပ်ရန်"</string>
+    <string name="backup_confirm_title" msgid="827563724209303345">"အရံ သိမ်းဆည်းမှု အပြည့်လုပ်ရန်"</string>
     <string name="restore_confirm_title" msgid="5469365809567486602">"အားလုံးပြန်လည်ရယူရန်"</string>
-    <string name="backup_confirm_text" msgid="1878021282758896593">"ချိတ်ဆက်ထားသောကွန်ပြုတာသို့ ဒေတာအားလုံးအား အရန်သိမ်းဆည်းရန် တောင်းခံပါသည်။ သင်ခွင့်ပြုမည်လား။ \n\nအကယ်၍ သင်သည်အရန်သိမ်းဆည်းရန် မတောင်းခံခဲ့ပါက ဤဆောင်ရွက်ချက်အား ရှေ့ဆက်ရန်ခွင့်မပြုပါနှင့်။"</string>
+    <string name="backup_confirm_text" msgid="1878021282758896593">"ချိတ်ဆက်ထားသောကွန်ပြုတာသို့ ဒေတာအားလုံးအား အရန်သိမ်းဆည်းရန် တောင်းခံပါသည်။ သင်ခွင့်ပြုမည်လား။ \n\nအကယ်၍ သင်သည်အရန်သိမ်းဆည်းရန် မတောင်းခံခဲ့ပါက ဤဆောင်ရွက်ချက်အား ရှေ့ဆက်ရန်ခွင့်မပြုပါနှင့်။"</string>
     <string name="allow_backup_button_label" msgid="4217228747769644068">"ကျွန်ုပ်၏ဒေတာများကို အရန်ထားခြင်း"</string>
-    <string name="deny_backup_button_label" msgid="6009119115581097708">"အရံသိမ်းဆည်းမှု မလုပ်ပါနှင့်"</string>
-    <string name="restore_confirm_text" msgid="7499866728030461776">"ချိတ်ဆက်ထားသောကွန်ပြုတာသို့ ဒေတာအားလုံးအား ပြန်လည်ရယူရန် တောင်းခံပါသည်။ သင်ခွင့်ပြုမည်လား။ \n\nအကယ်၍ သင်သည် ပြန်လည်ရယူရန် ဤဆောင်ရွက်ချက်အား ရှေ့ဆက်ရန်ခွင့်မပြုပါနှင့်။ လက်ရှိစက်ထဲ၌ရှိသောဒေတာအား အစားထိုးမည်ဖြစ်သည်။"</string>
+    <string name="deny_backup_button_label" msgid="6009119115581097708">"အရံသိမ်းဆည်းမှု မလုပ်ပါနှင့်"</string>
+    <string name="restore_confirm_text" msgid="7499866728030461776">"ချိတ်ဆက်ထားသောကွန်ပြုတာသို့ ဒေတာအားလုံးအား ပြန်လည်ရယူရန် တောင်းခံပါသည်။ သင်ခွင့်ပြုမည်လား။ \n\nအကယ်၍ သင်သည် ပြန်လည်ရယူရန် ဤဆောင်ရွက်ချက်အား ရှေ့ဆက်ရန်ခွင့်မပြုပါနှင့်။ လက်ရှိစက်ထဲ၌ရှိသောဒေတာအား အစားထိုးမည်ဖြစ်သည်။"</string>
     <string name="allow_restore_button_label" msgid="3081286752277127827">"ကျွန်ုပ်၏ဒေတာများကို ပြန်လည်ရယူရန်"</string>
-    <string name="deny_restore_button_label" msgid="1724367334453104378">"ပြန်လည်ရယူခြင်းအား မပြုလုပ်ပါနှင့်"</string>
-    <string name="current_password_text" msgid="8268189555578298067">"သင့်လက်ရှိ အရံသိမ်းဆည်းမှု လျှို့ဝှက်စကားဝှက်အား ထည့်သွင်းပါ။"</string>
-    <string name="device_encryption_restore_text" msgid="1570864916855208992">"သင့်စက်၏ လျှို့ဝှက်အသွင်ပြောင်းခြင်းအတွက်စကားဝှက်ကို ထည့်သွင်းပါ။"</string>
-    <string name="device_encryption_backup_text" msgid="5866590762672844664">"သင့်စက်၏လျှို့ဝှက်အသွင်ပြောင်းခြင်းအတွက် လျှို့ဝှက်စကားဝှက်အားထည့်ပါ။ အရံသိမ်းဆည်းမှု သိမ်းဆည်းနေရာတွင်လည်း အသုံးပြုမည်ဖြစ်သည်။"</string>
-    <string name="backup_enc_password_text" msgid="4981585714795233099">"ဒေတာအားလုံးအားအရန်သိမ်းဆည်းခြင်းပြီးလျှို့ဝှက်အသွင်ပြောင်းခြင်းအတွက် လျှို့ဝှက်နံပါတ်/စာကိုထည့်ပါ။ အကယ်၍ ကွက်လပ်ထားပါက ယခုသင့်လက်ရှိလျှို့ဝှက်စကားဝှက်အား အသုံးပြုပါမည်။"</string>
-    <string name="backup_enc_password_optional" msgid="1350137345907579306">"အကယ်၍ ဒေတာအားလုံးအားအရန်သိမ်းဆည်းခြင်းကို ဝှက်လိုပါက အောက်တွင်လျှို့ဝှက်နံပါတ်/စာကိုထည့်ပါ။"</string>
-    <string name="backup_enc_password_required" msgid="7889652203371654149">"သင်၏ ကိရိယာကို လျှို့ဝျက်ကုဒ် သွင်းထားရာ၊ သင်သည် သင်၏ ဘက်အာပ်ကိုပါ  လျှို့ဝျက်ကုဒ် သွင်းရန် လိုအပ်သည်။ ကျေးဇူးပြုပြီး အောက်မှာ စကားဝှက်ကို ထည့်သွင်းပါ:"</string>
-    <string name="restore_enc_password_text" msgid="6140898525580710823">"အကယ်၍ ပြန်လည်ရယူမည့်ဒေတာမှာလျှို့ဝှက်အသွင်ပြောင်းထားပါက အောက်တွင်စကားဝှက်ကိုထည့်ပါ-"</string>
+    <string name="deny_restore_button_label" msgid="1724367334453104378">"ပြန်လည်ရယူခြင်းအား မပြုလုပ်ပါနှင့်"</string>
+    <string name="current_password_text" msgid="8268189555578298067">"သင့်လက်ရှိ အရံသိမ်းဆည်းမှု လျှို့ဝှက်စကားဝှက်အား ထည့်သွင်းပါ။"</string>
+    <string name="device_encryption_restore_text" msgid="1570864916855208992">"သင့်စက်၏ လျှို့ဝှက်အသွင်ပြောင်းခြင်းအတွက်စကားဝှက်ကို ထည့်သွင်းပါ။"</string>
+    <string name="device_encryption_backup_text" msgid="5866590762672844664">"သင့်စက်၏လျှို့ဝှက်အသွင်ပြောင်းခြင်းအတွက် လျှို့ဝှက်စကားဝှက်အားထည့်ပါ။ အရံသိမ်းဆည်းမှု သိမ်းဆည်းနေရာတွင်လည်း အသုံးပြုမည်ဖြစ်သည်။"</string>
+    <string name="backup_enc_password_text" msgid="4981585714795233099">"ဒေတာအားလုံးအားအရန်သိမ်းဆည်းခြင်းပြီးလျှို့ဝှက်အသွင်ပြောင်းခြင်းအတွက် လျှို့ဝှက်နံပါတ်/စာကိုထည့်ပါ။ အကယ်၍ ကွက်လပ်ထားပါက ယခုသင့်လက်ရှိလျှို့ဝှက်စကားဝှက်အား အသုံးပြုပါမည်။"</string>
+    <string name="backup_enc_password_optional" msgid="1350137345907579306">"အကယ်၍ ဒေတာအားလုံးအားအရန်သိမ်းဆည်းခြင်းကို ဝှက်လိုပါက အောက်တွင်လျှို့ဝှက်နံပါတ်/စာကိုထည့်ပါ။"</string>
+    <string name="backup_enc_password_required" msgid="7889652203371654149">"သင်၏ ကိရိယာကို လျှို့ဝျက်ကုဒ် သွင်းထားရာ၊ သင်သည် သင်၏ ဘက်အာပ်ကိုပါ  လျှို့ဝျက်ကုဒ် သွင်းရန် လိုအပ်သည်။ ကျေးဇူးပြုပြီး အောက်မှာ စကားဝှက်ကို ထည့်သွင်းပါ:"</string>
+    <string name="restore_enc_password_text" msgid="6140898525580710823">"အကယ်၍ ပြန်လည်ရယူမည့်ဒေတာမှာလျှို့ဝှက်အသွင်ပြောင်းထားပါက အောက်တွင်စကားဝှက်ကိုထည့်ပါ-"</string>
     <string name="toast_backup_started" msgid="550354281452756121">"Backupစတင်ပြုလုပ်နေသည်"</string>
     <string name="toast_backup_ended" msgid="3818080769548726424">"Backupလုပ်ခြင်းပြီးဆုံးပါပြီ"</string>
     <string name="toast_restore_started" msgid="7881679218971277385">"ပြန်လည်ရယူခြင်း စတင်ပြုလုပ်နေသည်"</string>
diff --git a/packages/InputDevices/res/values-de/strings.xml b/packages/InputDevices/res/values-de/strings.xml
index 04c19e3..40722f6 100644
--- a/packages/InputDevices/res/values-de/strings.xml
+++ b/packages/InputDevices/res/values-de/strings.xml
@@ -3,7 +3,7 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="app_label" msgid="8016145283189546017">"Eingabegeräte"</string>
     <string name="keyboard_layouts_label" msgid="6688773268302087545">"Android-Tastatur"</string>
-    <string name="keyboard_layout_english_uk_label" msgid="6664258463319999632">"Englisch (Großbritannien)"</string>
+    <string name="keyboard_layout_english_uk_label" msgid="6664258463319999632">"Englisch (Vereinigtes Königreich)"</string>
     <string name="keyboard_layout_english_us_label" msgid="8994890249649106291">"Englisch (USA)"</string>
     <string name="keyboard_layout_english_us_intl" msgid="3705168594034233583">"Englisch (USA), international"</string>
     <string name="keyboard_layout_english_us_colemak_label" msgid="4194969610343455380">"Englisch (USA), Colemak"</string>
diff --git a/packages/Keyguard/res/values-km-rKH/strings.xml b/packages/Keyguard/res/values-km-rKH/strings.xml
index f4a73a8..70db756 100644
--- a/packages/Keyguard/res/values-km-rKH/strings.xml
+++ b/packages/Keyguard/res/values-km-rKH/strings.xml
@@ -86,7 +86,7 @@
     <string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
     <string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
     <string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
-    <string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"បោះ​បង់"</string>
+    <string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"បោះ​បង់​"</string>
     <string name="keyboardview_keycode_delete" msgid="3337914833206635744">"លុប"</string>
     <string name="keyboardview_keycode_done" msgid="1992571118466679775">"រួចរាល់"</string>
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"ប្ដូរ​របៀប"</string>
@@ -125,7 +125,7 @@
     <string name="kg_login_too_many_attempts" msgid="6486842094005698475">"ព្យាយាម​លំនាំ​ច្រើន​ពេក"</string>
     <string name="kg_login_instructions" msgid="1100551261265506448">"ដើម្បី​ដោះ​សោ ចូល​ក្នុង​គណនី Google ។"</string>
     <string name="kg_login_username_hint" msgid="5718534272070920364">"ឈ្មោះ​អ្នក​ប្រើ (អ៊ីមែល​)"</string>
-    <string name="kg_login_password_hint" msgid="9057289103827298549">"ពាក្យសម្ងាត់"</string>
+    <string name="kg_login_password_hint" msgid="9057289103827298549">"ពាក្យសម្ងាត់​"</string>
     <string name="kg_login_submit_button" msgid="5355904582674054702">"ចូល"</string>
     <string name="kg_login_invalid_input" msgid="5754664119319872197">"ឈ្មោះ​អ្នកប្រើ ឬ​ពាក្យ​សម្ងាត់​មិន​ត្រឹមត្រូវ។"</string>
     <string name="kg_login_account_recovery_hint" msgid="5690709132841752974">"ភ្លេច​ឈ្មោះ​អ្នកប្រើ ឬ​ពាក្យ​សម្ងាត់​របស់​អ្នក?\nមើល "<b>"google.com/accounts/recovery"</b>" ។"</string>
@@ -166,5 +166,5 @@
     <string name="keyguard_transport_pause_description" msgid="5093073338238310224">"ប៊ូតុង​ផ្អាក"</string>
     <string name="keyguard_transport_play_description" msgid="2924628863741150956">"ប៊ូតុង​ចាក់"</string>
     <string name="keyguard_transport_stop_description" msgid="3084179324810575787">"ប៊ូតុង​បញ្ឈប់"</string>
-    <string name="keyguard_carrier_default" msgid="8700650403054042153">"គ្មាន​សេវា"</string>
+    <string name="keyguard_carrier_default" msgid="8700650403054042153">"គ្មាន​សេវា​"</string>
 </resources>
diff --git a/packages/Keyguard/res/values-my-rMM/strings.xml b/packages/Keyguard/res/values-my-rMM/strings.xml
index a7ba0e5..37ae0f3 100644
--- a/packages/Keyguard/res/values-my-rMM/strings.xml
+++ b/packages/Keyguard/res/values-my-rMM/strings.xml
@@ -20,16 +20,16 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="719438068451601849">"သော့ချက် စောင့်ပေးသူ"</string>
-    <string name="keyguard_password_enter_pin_code" msgid="3037685796058495017">"PIN ကုဒ် ရိုက်ထည့်ပါ"</string>
+    <string name="app_name" msgid="719438068451601849">"သော့ချက် စောင့်ပေးသူ"</string>
+    <string name="keyguard_password_enter_pin_code" msgid="3037685796058495017">"PIN ကုဒ် ရိုက်ထည့်ပါ"</string>
     <string name="keyguard_password_enter_puk_code" msgid="3035856550289724338">"ဆင်းမ်ကဒ် ပင်နံပါတ် ပြန်ဖွင့်သည့် ကုဒ် နှင့် လျို့ဝှက်နံပါတ်သစ် ရိုက်ထည့်ပါ"</string>
     <string name="keyguard_password_enter_puk_prompt" msgid="1801941051094974609">"ဆင်းမ်ကဒ် ပင်နံပါတ် ပြန်ဖွင့်သည့် ကုဒ် နံပါတ်"</string>
     <string name="keyguard_password_enter_pin_prompt" msgid="3201151840570492538">"ဆင်းမ်ကဒ် လျို့ဝှက်ပင်နံပါတ် အသစ်သွင်းရန်"</string>
     <string name="keyguard_password_entry_touch_hint" msgid="7858547464982981384"><font size="17">"စကားဝှက် ရိုက်ရန် ထိပါ"</font></string>
-    <string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"သော့ဖွင့်ရန် စကားဝှက်ကို ရိုက်ထည့်ပါ"</string>
-    <string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"သော့ဖွင့်ရန် PIN ကို ရိုက်ထည့်ပါ"</string>
+    <string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"သော့ဖွင့်ရန် စကားဝှက်ကို ရိုက်ထည့်ပါ"</string>
+    <string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"သော့ဖွင့်ရန် PIN ကို ရိုက်ထည့်ပါ"</string>
     <string name="keyguard_password_wrong_pin_code" msgid="2422225591006134936">"ပင်နံပါတ်မှားနေပါသည်"</string>
-    <string name="keyguard_label_text" msgid="861796461028298424">"သော့ဖွင့်ရန် Menu ထိုနောက်0ကိုနှိပ်ပါ"</string>
+    <string name="keyguard_label_text" msgid="861796461028298424">"သော့ဖွင့်ရန် Menu ထိုနောက်0ကိုနှိပ်ပါ"</string>
     <string name="faceunlock_multiple_failures" msgid="754137583022792429">"မျက်မှာမှတ် သော့ဖွင့်ခြင်း ခွင့်ပြုသော အကြိမ်ရေထက် ကျော်လွန်သွားပါပြီ"</string>
     <string name="keyguard_charged" msgid="3272223906073492454">"အားသွင်းနေပါသည်"</string>
     <string name="keyguard_plugged_in" msgid="9087497435553252863">"အားသွင်းနေ"</string>
@@ -88,14 +88,14 @@
     <string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Altခလုတ်"</string>
     <string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"ပယ်ဖျက်ရန်ခလုတ်"</string>
     <string name="keyboardview_keycode_delete" msgid="3337914833206635744">"ဖျက်ရန်ခလုတ်"</string>
-    <string name="keyboardview_keycode_done" msgid="1992571118466679775">"ပြီးဆုံးသည့်ခလုတ်"</string>
+    <string name="keyboardview_keycode_done" msgid="1992571118466679775">"ပြီးဆုံးသည့်ခလုတ်"</string>
     <string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"စနစ်ပြောင်းခြင်းခလုတ်"</string>
     <string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shiftခလုတ်"</string>
     <string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enterခလုတ်"</string>
-    <string name="description_target_unlock" msgid="2228524900439801453">"ဖွင့်ရန်"</string>
+    <string name="description_target_unlock" msgid="2228524900439801453">"ဖွင့်ရန်"</string>
     <string name="description_target_camera" msgid="969071997552486814">"ကင်မရာ"</string>
     <string name="description_target_silent" msgid="893551287746522182">"အသံတိတ်ရန်"</string>
-    <string name="description_target_soundon" msgid="30052466675500172">"အသံဖွင့်သည်"</string>
+    <string name="description_target_soundon" msgid="30052466675500172">"အသံဖွင့်သည်"</string>
     <string name="description_target_search" msgid="3091587249776033139">"ရှာဖွေရန်"</string>
     <string name="description_direction_up" msgid="7169032478259485180">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> အတွက် အပေါ်ကို ပွတ်ဆွဲပါ"</string>
     <string name="description_direction_down" msgid="5087739728639014595">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> အတွက် အောက်ကို ပွတ်ဆွဲပါ"</string>
@@ -110,11 +110,11 @@
     <string name="kg_too_many_failed_attempts_countdown" msgid="6358110221603297548">"<xliff:g id="NUMBER">%d</xliff:g> စက္ကန့်အကြာတွင် ပြန်ကြိုးစားပါ"</string>
     <string name="kg_pattern_instructions" msgid="398978611683075868">"သင့်ရဲ့ သော့ဖွင့်သော ပုံစံကို ဆွဲပါ"</string>
     <string name="kg_sim_pin_instructions" msgid="2319508550934557331">"ဆင်းမ်ကဒ် ပင် နံပါတ် ရိုက်ထည့်ပါ"</string>
-    <string name="kg_sim_pin_instructions_multi" msgid="7818515973197201434">"\"<xliff:g id="CARRIER">%1$s</xliff:g>\" အတွက် ဆင်းမ် ပင်နံပါတ် ရိုက်ထည့်ပါ။"</string>
+    <string name="kg_sim_pin_instructions_multi" msgid="7818515973197201434">"\"<xliff:g id="CARRIER">%1$s</xliff:g>\" အတွက် ဆင်းမ် ပင်နံပါတ် ရိုက်ထည့်ပါ။"</string>
     <string name="kg_pin_instructions" msgid="2377242233495111557">"ပင်နံပါတ် ရိုက်ထည့်ပါ"</string>
     <string name="kg_password_instructions" msgid="5753646556186936819">"လျို့ဝှက်နံပါတ် ရိုက်ထည့်ပါ"</string>
     <string name="kg_puk_enter_puk_hint" msgid="453227143861735537">"ဆင်းမ်ကဒ်သည် ယခု ပိတ်သွားပါပြီ ဆက်လက် လုပ်ဆောင်ရန် ပင်နံပါတ် ပြန်ဖွင့်သည့် ကုဒ်ကို ရိုက်ထည့်ပါ။ ပိုမိုသိချင်လျင် ဖုန်းဝန်ဆောင်မှု ပေးသောဌာန အားဆက်သွယ်နိုင်ပါသည်။"</string>
-    <string name="kg_puk_enter_puk_hint_multi" msgid="363822494559783025">"ဆင်းမ် \"<xliff:g id="CARRIER">%1$s</xliff:g>\" သည် ယခု အလုပ်မလုပ်တော့ပါ။ ဆက်လက်သွားရန် PUK ကုဒ် ရိုက်ထည့်ပါ၊။အသေးစိတ်သိရရန် ဖုန်းဝန်ဆောင်မှုလုပ်ငန်းအား ဆက်သွယ်ပါ။"</string>
+    <string name="kg_puk_enter_puk_hint_multi" msgid="363822494559783025">"ဆင်းမ် \"<xliff:g id="CARRIER">%1$s</xliff:g>\" သည် ယခု အလုပ်မလုပ်တော့ပါ။ ဆက်လက်သွားရန် PUK ကုဒ် ရိုက်ထည့်ပါ၊။အသေးစိတ်သိရရန် ဖုန်းဝန်ဆောင်မှုလုပ်ငန်းအား ဆက်သွယ်ပါ။"</string>
     <string name="kg_puk_enter_pin_hint" msgid="7871604527429602024">"လိုချင်သော ပင်နံပါတ်ကို ရိုက်ထည့်ပါ"</string>
     <string name="kg_enter_confirm_pin_hint" msgid="325676184762529976">"လိုချင်သော ပင်နံပါတ်ကို အတည်ပြုရန်"</string>
     <string name="kg_sim_unlock_progress_dialog_message" msgid="8950398016976865762">"ဆင်းမ်ကဒ် ကို သော့ဖွင့်နေပါသည်"</string>
@@ -133,18 +133,18 @@
     <string name="kg_too_many_failed_pin_attempts_dialog_message" msgid="8276745642049502550">"သင် ပင် နံပါတ်ကို အမှားကို <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ရိုက်ထည့်ပြီးပါပြီ။ \n\n<xliff:g id="NUMBER_1">%d</xliff:g> စက္ကန့် အကြာတွင် ပြန်လည်ကြိုးစားပါ"</string>
     <string name="kg_too_many_failed_password_attempts_dialog_message" msgid="7813713389422226531">"သင်သည် စကားဝှက်ကို  <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် မှားရိုက်ပြီးပါပြီ။ \n\n <xliff:g id="NUMBER_1">%d</xliff:g> စက္ကန့်အကြာ ပြန်လည်ကြိုးစားပါ"</string>
     <string name="kg_too_many_failed_pattern_attempts_dialog_message" msgid="74089475965050805">"သင် ပုံစံဆွဲ သော့ဖွင့်ခြင်းကို <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ်မြောက် မအောင်မြင်ပါ။ \n\n<xliff:g id="NUMBER_1">%d</xliff:g> စက္ကန့်အကြာတွင် ပြန်လည် ကြိုးစားပါ"</string>
-    <string name="kg_failed_attempts_almost_at_wipe" product="tablet" msgid="8774056606869646621">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤတက်ဘလက်အား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
-    <string name="kg_failed_attempts_almost_at_wipe" product="default" msgid="1843331751334128428">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
-    <string name="kg_failed_attempts_now_wiping" product="tablet" msgid="258925501999698032">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
-    <string name="kg_failed_attempts_now_wiping" product="default" msgid="7154028908459817066">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
-    <string name="kg_failed_attempts_almost_at_erase_user" product="tablet" msgid="6159955099372112688">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤအသုံးပြုသူအား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
-    <string name="kg_failed_attempts_almost_at_erase_user" product="default" msgid="6945823186629369880">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤအသုံးပြုသူအား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
-    <string name="kg_failed_attempts_now_erasing_user" product="tablet" msgid="3963486905355778734">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤအသုံးပြုသူအား ဖယ်ထုတ်မည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
-    <string name="kg_failed_attempts_now_erasing_user" product="default" msgid="7729009752252111673">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤအသုံးပြုသူအား ဖယ်ထုတ်မည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
-    <string name="kg_failed_attempts_almost_at_erase_profile" product="tablet" msgid="4621778507387853694">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ သင့် အလုပ်ပရိုဖိုင်အား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
-    <string name="kg_failed_attempts_almost_at_erase_profile" product="default" msgid="6853071165802933545">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ သင့် အလုပ်ပရိုဖိုင်အား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
-    <string name="kg_failed_attempts_now_erasing_profile" product="tablet" msgid="4686386497449912146">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ အလုပ်ပရိုဖိုင် ဖယ်ထုတ်ခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
-    <string name="kg_failed_attempts_now_erasing_profile" product="default" msgid="4951507352869831265">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ အလုပ်ပရိုဖိုင် ဖယ်ထုတ်ခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+    <string name="kg_failed_attempts_almost_at_wipe" product="tablet" msgid="8774056606869646621">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤတက်ဘလက်အား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+    <string name="kg_failed_attempts_almost_at_wipe" product="default" msgid="1843331751334128428">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+    <string name="kg_failed_attempts_now_wiping" product="tablet" msgid="258925501999698032">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+    <string name="kg_failed_attempts_now_wiping" product="default" msgid="7154028908459817066">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+    <string name="kg_failed_attempts_almost_at_erase_user" product="tablet" msgid="6159955099372112688">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤအသုံးပြုသူအား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
+    <string name="kg_failed_attempts_almost_at_erase_user" product="default" msgid="6945823186629369880">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤအသုံးပြုသူအား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
+    <string name="kg_failed_attempts_now_erasing_user" product="tablet" msgid="3963486905355778734">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤအသုံးပြုသူအား ဖယ်ထုတ်မည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+    <string name="kg_failed_attempts_now_erasing_user" product="default" msgid="7729009752252111673">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤအသုံးပြုသူအား ဖယ်ထုတ်မည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+    <string name="kg_failed_attempts_almost_at_erase_profile" product="tablet" msgid="4621778507387853694">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ သင့် အလုပ်ပရိုဖိုင်အား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
+    <string name="kg_failed_attempts_almost_at_erase_profile" product="default" msgid="6853071165802933545">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ သင့် အလုပ်ပရိုဖိုင်အား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
+    <string name="kg_failed_attempts_now_erasing_profile" product="tablet" msgid="4686386497449912146">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ အလုပ်ပရိုဖိုင် ဖယ်ထုတ်ခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+    <string name="kg_failed_attempts_now_erasing_profile" product="default" msgid="4951507352869831265">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ အလုပ်ပရိုဖိုင် ဖယ်ထုတ်ခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
     <string name="kg_failed_attempts_almost_at_login" product="tablet" msgid="3253575572118914370">"သင် ပုံဖော်၍သော့ဖွင့်ခြင်းကို  <xliff:g id="NUMBER_0">%d</xliff:g> အကြိမ် မှန်ကန်စွာ မပြုလုပ်နိုင်ပါ။  နောက်ထပ် <xliff:g id="NUMBER_1">%d</xliff:g> အကြိမ် မမှန်ကန်ပါက သင့်တက်ဘလက်အား အီးမေးလ်အသုံးပြု၍ သော့ဖွင့်ရန် တောင်းဆိုပါလိမ့်မည်။ \n\n <xliff:g id="NUMBER_2">%d</xliff:g> စက္ကန့်အကြာတွင် ပြန်လည် ကြိုးစားပါ"</string>
     <string name="kg_failed_attempts_almost_at_login" product="default" msgid="1437638152015574839">"သင် ပုံဖော်၍သော့ဖွင့်ခြင်းကို <xliff:g id="NUMBER_0">%d</xliff:g> အကြိမ် မှန်ကန်စွာ မပြုလုပ်နိုင်ပါ။ နောက်ထပ် <xliff:g id="NUMBER_1">%d</xliff:g> အကြိမ် မမှန်ကန်ပါက သင့်ဖုန်းအား အီးမေးလ်အသုံးပြု၍ သော့ဖွင့်ရန် တောင်းဆိုပါလိမ့်မည်။ \n\n <xliff:g id="NUMBER_2">%d</xliff:g> စက္ကန့်အကြာတွင် ပြန်လည် ကြိုးစားပါ"</string>
     <string name="kg_reordering_delete_drop_target_text" msgid="7899202978204438708">"ဖယ်ရှားရန်"</string>
diff --git a/packages/PrintSpooler/res/values-km-rKH/strings.xml b/packages/PrintSpooler/res/values-km-rKH/strings.xml
index 9279fe4..63d710a 100644
--- a/packages/PrintSpooler/res/values-km-rKH/strings.xml
+++ b/packages/PrintSpooler/res/values-km-rKH/strings.xml
@@ -70,7 +70,7 @@
   </plurals>
     <string name="cancel" msgid="4373674107267141885">"បោះបង់"</string>
     <string name="restart" msgid="2472034227037808749">"ចាប់ផ្ដើម​ឡើងវិញ"</string>
-    <string name="no_connection_to_printer" msgid="2159246915977282728">"គ្មាន​​​ការ​ភ្ជាប់​ទៅ​ម៉ាស៊ីន​បោះពុម្ព"</string>
+    <string name="no_connection_to_printer" msgid="2159246915977282728">"គ្មាន​​​ការ​ភ្ជាប់​ទៅ​ម៉ាស៊ីន​បោះពុម្ព​"</string>
     <string name="reason_unknown" msgid="5507940196503246139">"មិន​ស្គាល់"</string>
     <string name="printer_unavailable" msgid="2434170617003315690">"<xliff:g id="PRINT_JOB_NAME">%1$s</xliff:g> – មិន​អាច​ប្រើ​បាន"</string>
   <string-array name="color_mode_labels">
diff --git a/packages/PrintSpooler/res/values-my-rMM/strings.xml b/packages/PrintSpooler/res/values-my-rMM/strings.xml
index 7dce459..d6eb380 100644
--- a/packages/PrintSpooler/res/values-my-rMM/strings.xml
+++ b/packages/PrintSpooler/res/values-my-rMM/strings.xml
@@ -43,8 +43,8 @@
     <string name="collapse_handle" msgid="6886637989442507451">"ခေါက်ရန် လက်"</string>
     <string name="print_button" msgid="645164566271246268">"စာထုတ်ရန်"</string>
     <string name="savetopdf_button" msgid="2976186791686924743">"PDF သို့ သိမ်းဆည်းခဲ့"</string>
-    <string name="print_options_expanded" msgid="6944679157471691859">"ပရင့်ထုတ် ရွေးစရာများကို ချဲ့ထား"</string>
-    <string name="print_options_collapsed" msgid="7455930445670414332">"ပရင့်ထုတ် ရွေးစရာများကို ခေါက်ထား"</string>
+    <string name="print_options_expanded" msgid="6944679157471691859">"ပရင့်ထုတ် ရွေးစရာများကို ချဲ့ထား"</string>
+    <string name="print_options_collapsed" msgid="7455930445670414332">"ပရင့်ထုတ် ရွေးစရာများကို ခေါက်ထား"</string>
     <string name="search" msgid="5421724265322228497">"ရှာဖွေခြင်း"</string>
     <string name="all_printers_label" msgid="3178848870161526399">"စာထုတ်စက် အားလုံး"</string>
     <string name="add_print_service_label" msgid="5356702546188981940">"ဆားဗစ် အသစ်ထည့်ရန်"</string>
@@ -85,5 +85,5 @@
     <string name="print_error_default_message" msgid="8602678405502922346">"ဆော်ရီး၊ အဲဒါ အလုပ်မဖြစ်ခဲ့ပါ။ ထပ် စမ်းပါ။"</string>
     <string name="print_error_retry" msgid="1426421728784259538">"ထပ်စမ်း"</string>
     <string name="print_error_printer_unavailable" msgid="8985614415253203381">"ဒီပရင်တာမှာ ယခုအချိန်မှာ မရနိုင်ပါ။"</string>
-    <string name="print_preparing_preview" msgid="3939930735671364712">"အစမ်းကြည့်ရန် ပြင်ဆင်နေ…"</string>
+    <string name="print_preparing_preview" msgid="3939930735671364712">"အစမ်းကြည့်ရန် ပြင်ဆင်နေ…"</string>
 </resources>
diff --git a/services/core/jni/com_android_server_tv_TvInputHal.cpp b/services/core/jni/com_android_server_tv_TvInputHal.cpp
index c0e4d32..507bc9c 100644
--- a/services/core/jni/com_android_server_tv_TvInputHal.cpp
+++ b/services/core/jni/com_android_server_tv_TvInputHal.cpp
@@ -264,6 +264,7 @@
     class NotifyHandler : public MessageHandler {
     public:
         NotifyHandler(JTvInputHal* hal, const tv_input_event_t* event);
+        ~NotifyHandler();
 
         virtual void handleMessage(const Message& message);
 
@@ -277,6 +278,9 @@
     static void notify(
             tv_input_device_t* dev, tv_input_event_t* event, void* data);
 
+    static void cloneTvInputEvent(
+            tv_input_event_t* dstEvent, const tv_input_event_t* srcEvent);
+
     Mutex mLock;
     jweak mThiz;
     tv_input_device_t* mDevice;
@@ -447,6 +451,20 @@
     thiz->mLooper->sendMessage(new NotifyHandler(thiz, event), event->type);
 }
 
+// static
+void JTvInputHal::cloneTvInputEvent(
+        tv_input_event_t* dstEvent, const tv_input_event_t* srcEvent) {
+    memcpy(dstEvent, srcEvent, sizeof(tv_input_event_t));
+    if ((srcEvent->type == TV_INPUT_EVENT_DEVICE_AVAILABLE ||
+            srcEvent->type == TV_INPUT_EVENT_DEVICE_UNAVAILABLE ||
+            srcEvent->type == TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED) &&
+            srcEvent->device_info.audio_address != NULL){
+        char* audio_address = new char[strlen(srcEvent->device_info.audio_address) + 1];
+        strcpy(audio_address, srcEvent->device_info.audio_address);
+        dstEvent->device_info.audio_address = audio_address;
+    }
+}
+
 void JTvInputHal::onDeviceAvailable(const tv_input_device_info_t& info) {
     {
         Mutex::Autolock autoLock(&mLock);
@@ -543,7 +561,16 @@
 
 JTvInputHal::NotifyHandler::NotifyHandler(JTvInputHal* hal, const tv_input_event_t* event) {
     mHal = hal;
-    memcpy(&mEvent, event, sizeof(mEvent));
+    cloneTvInputEvent(&mEvent, event);
+}
+
+JTvInputHal::NotifyHandler::~NotifyHandler() {
+    if ((mEvent.type == TV_INPUT_EVENT_DEVICE_AVAILABLE ||
+            mEvent.type == TV_INPUT_EVENT_DEVICE_UNAVAILABLE ||
+            mEvent.type == TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED) &&
+            mEvent.device_info.audio_address != NULL) {
+        delete mEvent.device_info.audio_address;
+    }
 }
 
 void JTvInputHal::NotifyHandler::handleMessage(const Message& message) {