Merge "Fix doc for Telephony Manager api and make isTtySupported public."
diff --git a/Android.mk b/Android.mk
index 2ba31df..76ca9b9 100644
--- a/Android.mk
+++ b/Android.mk
@@ -566,6 +566,7 @@
 
 LOCAL_SRC_FILES += \
 	../../system/netd/server/binder/android/net/INetd.aidl \
+	../../system/vold/binder/android/os/IVold.aidl \
 	../native/cmds/installd/binder/android/os/IInstalld.aidl \
 
 LOCAL_AIDL_INCLUDES += system/update_engine/binder_bindings
diff --git a/api/current.txt b/api/current.txt
index da4bb9c..39944bf 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -37193,6 +37193,7 @@
   public final class SaveRequest implements android.os.Parcelable {
     method public int describeContents();
     method public android.os.Bundle getClientState();
+    method public java.util.List<java.lang.String> getDatasetIds();
     method public java.util.List<android.service.autofill.FillContext> getFillContexts();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.service.autofill.SaveRequest> CREATOR;
@@ -40289,6 +40290,7 @@
     method public int getPhoneCount();
     method public int getPhoneType();
     method public android.telephony.ServiceState getServiceState();
+    method public android.telephony.SignalStrength getSignalStrength();
     method public java.lang.String getSimCountryIso();
     method public java.lang.String getSimOperator();
     method public java.lang.String getSimOperatorName();
@@ -51074,10 +51076,11 @@
   public class RemoteViews implements android.view.LayoutInflater.Filter android.os.Parcelable {
     ctor public RemoteViews(java.lang.String, int);
     ctor public RemoteViews(android.widget.RemoteViews, android.widget.RemoteViews);
+    ctor public RemoteViews(android.widget.RemoteViews);
     ctor public RemoteViews(android.os.Parcel);
     method public void addView(int, android.widget.RemoteViews);
     method public android.view.View apply(android.content.Context, android.view.ViewGroup);
-    method public android.widget.RemoteViews clone();
+    method public deprecated android.widget.RemoteViews clone();
     method public int describeContents();
     method public int getLayoutId();
     method public java.lang.String getPackage();
diff --git a/api/system-current.txt b/api/system-current.txt
index 4e05661..4a76bfb 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -40284,6 +40284,7 @@
   public final class SaveRequest implements android.os.Parcelable {
     method public int describeContents();
     method public android.os.Bundle getClientState();
+    method public java.util.List<java.lang.String> getDatasetIds();
     method public java.util.List<android.service.autofill.FillContext> getFillContexts();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.service.autofill.SaveRequest> CREATOR;
@@ -43808,6 +43809,7 @@
     method public int getPhoneCount();
     method public int getPhoneType();
     method public android.telephony.ServiceState getServiceState();
+    method public android.telephony.SignalStrength getSignalStrength();
     method public java.lang.String getSimCountryIso();
     method public java.lang.String getSimOperator();
     method public java.lang.String getSimOperatorName();
@@ -55051,10 +55053,11 @@
   public class RemoteViews implements android.view.LayoutInflater.Filter android.os.Parcelable {
     ctor public RemoteViews(java.lang.String, int);
     ctor public RemoteViews(android.widget.RemoteViews, android.widget.RemoteViews);
+    ctor public RemoteViews(android.widget.RemoteViews);
     ctor public RemoteViews(android.os.Parcel);
     method public void addView(int, android.widget.RemoteViews);
     method public android.view.View apply(android.content.Context, android.view.ViewGroup);
-    method public android.widget.RemoteViews clone();
+    method public deprecated android.widget.RemoteViews clone();
     method public int describeContents();
     method public int getLayoutId();
     method public java.lang.String getPackage();
diff --git a/api/test-current.txt b/api/test-current.txt
index e6637d4..aa9e5f9 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -12124,6 +12124,18 @@
     ctor public SQLiteFullException(java.lang.String);
   }
 
+  public final class SQLiteGlobal {
+    method public static java.lang.String getDefaultJournalMode();
+    method public static int getDefaultPageSize();
+    method public static java.lang.String getDefaultSyncMode();
+    method public static int getIdleConnectionTimeout();
+    method public static int getJournalSizeLimit();
+    method public static int getWALAutoCheckpoint();
+    method public static int getWALConnectionPoolSize();
+    method public static java.lang.String getWALSyncMode();
+    method public static int releaseMemory();
+  }
+
   public class SQLiteMisuseException extends android.database.sqlite.SQLiteException {
     ctor public SQLiteMisuseException();
     ctor public SQLiteMisuseException(java.lang.String);
@@ -37414,6 +37426,7 @@
   public final class SaveRequest implements android.os.Parcelable {
     method public int describeContents();
     method public android.os.Bundle getClientState();
+    method public java.util.List<java.lang.String> getDatasetIds();
     method public java.util.List<android.service.autofill.FillContext> getFillContexts();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator<android.service.autofill.SaveRequest> CREATOR;
@@ -40568,6 +40581,7 @@
     method public int getPhoneCount();
     method public int getPhoneType();
     method public android.telephony.ServiceState getServiceState();
+    method public android.telephony.SignalStrength getSignalStrength();
     method public java.lang.String getSimCountryIso();
     method public java.lang.String getSimOperator();
     method public java.lang.String getSimOperatorName();
@@ -51565,10 +51579,11 @@
   public class RemoteViews implements android.view.LayoutInflater.Filter android.os.Parcelable {
     ctor public RemoteViews(java.lang.String, int);
     ctor public RemoteViews(android.widget.RemoteViews, android.widget.RemoteViews);
+    ctor public RemoteViews(android.widget.RemoteViews);
     ctor public RemoteViews(android.os.Parcel);
     method public void addView(int, android.widget.RemoteViews);
     method public android.view.View apply(android.content.Context, android.view.ViewGroup);
-    method public android.widget.RemoteViews clone();
+    method public deprecated android.widget.RemoteViews clone();
     method public int describeContents();
     method public int getLayoutId();
     method public java.lang.String getPackage();
diff --git a/cmds/am/Android.bp b/cmds/am/Android.bp
new file mode 100644
index 0000000..7eb4edf
--- /dev/null
+++ b/cmds/am/Android.bp
@@ -0,0 +1,11 @@
+// Copyright 2008 The Android Open Source Project
+//
+
+cc_library_host_static {
+    name: "libinstrumentation",
+    srcs: ["**/*.proto"],
+    proto: {
+        type: "full",
+        export_proto_headers: true,
+    },
+}
diff --git a/cmds/am/Android.mk b/cmds/am/Android.mk
index 5586dd4..9411c32 100644
--- a/cmds/am/Android.mk
+++ b/cmds/am/Android.mk
@@ -16,14 +16,3 @@
 LOCAL_MODULE_CLASS := EXECUTABLES
 LOCAL_MODULE_TAGS := optional
 include $(BUILD_PREBUILT)
-
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := \
-    $(call all-proto-files-under, proto)
-LOCAL_MODULE := libinstrumentation
-LOCAL_PROTOC_OPTIMIZE_TYPE := full
-LOCAL_EXPORT_C_INCLUDE_DIRS := \
-    $(call intermediates-dir-for,STATIC_LIBRARIES,libinstrumentation,HOST,,,)/proto/$(LOCAL_PATH)/proto
-include $(BUILD_HOST_STATIC_LIBRARY)
-
diff --git a/cmds/hid/Android.bp b/cmds/hid/Android.bp
new file mode 100644
index 0000000..2b7963a
--- /dev/null
+++ b/cmds/hid/Android.bp
@@ -0,0 +1 @@
+subdirs = ["jni"]
diff --git a/cmds/hid/jni/Android.bp b/cmds/hid/jni/Android.bp
new file mode 100644
index 0000000..095cfc6
--- /dev/null
+++ b/cmds/hid/jni/Android.bp
@@ -0,0 +1,17 @@
+cc_library_shared {
+    name: "libhidcommand_jni",
+
+    srcs: ["com_android_commands_hid_Device.cpp"],
+
+    shared_libs: [
+        "libandroid",
+        "liblog",
+        "libnativehelper",
+    ],
+
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+}
diff --git a/cmds/hid/jni/Android.mk b/cmds/hid/jni/Android.mk
deleted file mode 100644
index 86f4e01..0000000
--- a/cmds/hid/jni/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    com_android_commands_hid_Device.cpp
-
-LOCAL_C_INCLUDES := \
-    $(JNI_H_INCLUDE)
-
-LOCAL_LDLIBS += -landroid -llog -lnativehelper
-
-LOCAL_MODULE := libhidcommand_jni
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CFLAGS += -Wall -Wextra -Werror
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/cmds/incident/main.cpp b/cmds/incident/main.cpp
index 47f1db8..519852d 100644
--- a/cmds/incident/main.cpp
+++ b/cmds/incident/main.cpp
@@ -25,6 +25,7 @@
 #include <binder/IServiceManager.h>
 #include <utils/Looper.h>
 
+#include <cstring>
 #include <fcntl.h>
 #include <getopt.h>
 #include <stdio.h>
@@ -144,6 +145,16 @@
 }
 
 // ================================================================================
+static int
+get_dest(const char* arg)
+{
+    if (strcmp(arg, "LOCAL") == 0) return 0;
+    if (strcmp(arg, "EXPLICIT") == 0) return 1;
+    if (strcmp(arg, "AUTOMATIC") == 0) return 2;
+    return -1; // return the default value
+}
+
+// ================================================================================
 static void
 usage(FILE* out)
 {
@@ -155,6 +166,7 @@
     fprintf(out, "  -b           (default) print the report to stdout (in proto format)\n");
     fprintf(out, "  -d           send the report into dropbox\n");
     fprintf(out, "  -l           list available sections\n");
+    fprintf(out, "  -p           privacy spec, LOCAL, EXPLICIT or AUTOMATIC\n");
     fprintf(out, "\n");
     fprintf(out, "  SECTION     the field numbers of the incident report fields to include\n");
     fprintf(out, "\n");
@@ -166,10 +178,11 @@
     Status status;
     IncidentReportArgs args;
     enum { DEST_DROPBOX, DEST_STDOUT } destination = DEST_STDOUT;
+    int dest = -1; // default
 
     // Parse the args
     int opt;
-    while ((opt = getopt(argc, argv, "bhdl")) != -1) {
+    while ((opt = getopt(argc, argv, "bhdlp:")) != -1) {
         switch (opt) {
             case 'h':
                 usage(stdout);
@@ -183,6 +196,9 @@
             case 'd':
                 destination = DEST_DROPBOX;
                 break;
+            case 'p':
+                dest = get_dest(optarg);
+                break;
             default:
                 usage(stderr);
                 return 1;
@@ -210,8 +226,7 @@
             }
         }
     }
-
-
+    args.setDest(dest);
 
     // Start the thread pool.
     sp<ProcessState> ps(ProcessState::self());
diff --git a/cmds/incident_helper/IncidentHelper.cpp b/cmds/incident_helper/IncidentHelper.cpp
index fba5e66..787d3a1 100644
--- a/cmds/incident_helper/IncidentHelper.cpp
+++ b/cmds/incident_helper/IncidentHelper.cpp
@@ -61,6 +61,21 @@
 }
 
 // ================================================================================
+status_t NoopParser::Parse(const int in, const int out) const
+{
+    string content;
+    if (!ReadFdToString(in, &content)) {
+        fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.string());
+        return -1;
+    }
+    if (!WriteStringToFd(content, out)) {
+        fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.string());
+        return -1;
+    }
+    return NO_ERROR;
+}
+
+// ================================================================================
 status_t ReverseParser::Parse(const int in, const int out) const
 {
     string content;
@@ -189,4 +204,4 @@
     }
     fprintf(stderr, "[%s]Proto size: %d bytes\n", this->name.string(), proto.ByteSize());
     return NO_ERROR;
-}
\ No newline at end of file
+}
diff --git a/cmds/incident_helper/IncidentHelper.h b/cmds/incident_helper/IncidentHelper.h
index f319c41..f6579a2 100644
--- a/cmds/incident_helper/IncidentHelper.h
+++ b/cmds/incident_helper/IncidentHelper.h
@@ -36,6 +36,17 @@
 };
 
 /**
+ * No op parser returns what it reads
+ */
+class NoopParser : public TextParserBase {
+public:
+    NoopParser() : TextParserBase(String8("NoopParser")) {};
+    ~NoopParser() {};
+
+    virtual status_t Parse(const int in, const int out) const;
+};
+
+/**
  * This parser is used for testing only, results in timeout.
  */
 class TimeoutParser : public TextParserBase {
diff --git a/cmds/incident_helper/main.cpp b/cmds/incident_helper/main.cpp
index 333344b..296d300 100644
--- a/cmds/incident_helper/main.cpp
+++ b/cmds/incident_helper/main.cpp
@@ -41,9 +41,11 @@
         case -1:
             return new TimeoutParser();
         case 0:
+            return new NoopParser();
+        case 1: // 1 is reserved for incident header so it won't be section id
             return new ReverseParser();
 /* ========================================================================= */
-        // IDs larger than 0 are reserved in incident.proto
+        // IDs larger than 1 are section ids reserved in incident.proto
         case 2000:
             return new ProcrankParser();
         case 2002:
diff --git a/cmds/incidentd/Android.mk b/cmds/incidentd/Android.mk
index 835a7b9..830bf9e 100644
--- a/cmds/incidentd/Android.mk
+++ b/cmds/incidentd/Android.mk
@@ -23,10 +23,13 @@
 LOCAL_MODULE := incidentd
 
 LOCAL_SRC_FILES := \
+        src/EncodedBuffer.cpp \
         src/FdBuffer.cpp \
         src/IncidentService.cpp \
+        src/Privacy.cpp \
         src/Reporter.cpp \
         src/Section.cpp \
+        src/io_util.cpp \
         src/main.cpp \
         src/protobuf.cpp \
         src/report_directory.cpp
@@ -69,7 +72,9 @@
 gen_src_dir:=
 GEN:=
 
+ifeq ($(BUILD_WITH_INCIDENTD_RC), true)
 LOCAL_INIT_RC := incidentd.rc
+endif
 
 include $(BUILD_EXECUTABLE)
 
@@ -88,12 +93,16 @@
 LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
 
 LOCAL_SRC_FILES := \
+    src/EncodedBuffer.cpp \
     src/FdBuffer.cpp \
+    src/Privacy.cpp \
     src/Reporter.cpp \
     src/Section.cpp \
+    src/io_util.cpp \
     src/protobuf.cpp \
     src/report_directory.cpp \
     tests/section_list.cpp \
+    tests/EncodedBuffer_test.cpp \
     tests/FdBuffer_test.cpp \
     tests/Reporter_test.cpp \
     tests/Section_test.cpp \
diff --git a/cmds/incidentd/src/EncodedBuffer.cpp b/cmds/incidentd/src/EncodedBuffer.cpp
new file mode 100644
index 0000000..3d20548
--- /dev/null
+++ b/cmds/incidentd/src/EncodedBuffer.cpp
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "EncodedBuffer.h"
+#include "io_util.h"
+#include "protobuf.h"
+
+#include <deque>
+
+const size_t BUFFER_SIZE = 4 * 1024; // 4 KB
+
+/**
+ * Read varint from iterator, the iterator will point to next available byte.
+ * Return the number of bytes of the varint.
+ */
+static uint32_t
+read_raw_varint(FdBuffer::iterator& it)
+{
+    uint32_t val = 0;
+    int i = 0;
+    bool hasNext = true;
+    while (hasNext) {
+        hasNext = ((*it & 0x80) != 0);
+        val += (*it & 0x7F) << (7*i);
+        it++;
+        i++;
+    }
+    return val;
+}
+
+/**
+ * Write the field to buf based on the wire type, iterator will point to next field.
+ * If skip is set to true, no data will be written to buf. Return number of bytes written.
+ */
+static size_t
+write_field_or_skip(FdBuffer::iterator &iterator, vector<uint8_t> &buf, uint8_t wireType, bool skip)
+{
+    FdBuffer::iterator snapshot = iterator.snapshot();
+    size_t bytesToWrite = 0;
+    uint32_t varint = 0;
+    switch (wireType) {
+        case WIRE_TYPE_VARINT:
+            varint = read_raw_varint(iterator);
+            if(!skip) return write_raw_varint(buf, varint);
+            break;
+        case WIRE_TYPE_FIXED64:
+            bytesToWrite = 8;
+            break;
+        case WIRE_TYPE_LENGTH_DELIMITED:
+            bytesToWrite = read_raw_varint(iterator);
+            if(!skip) write_raw_varint(buf, bytesToWrite);
+            break;
+        case WIRE_TYPE_FIXED32:
+            bytesToWrite = 4;
+            break;
+    }
+    if (skip) {
+        iterator += bytesToWrite;
+    } else {
+        for (size_t i=0; i<bytesToWrite; i++) {
+            buf.push_back(*iterator);
+            iterator++;
+        }
+    }
+    return skip ? 0 : iterator - snapshot;
+}
+
+/**
+ * Strip next field based on its private policy and request spec, then stores data in buf.
+ * Return NO_ERROR if succeeds, otherwise BAD_VALUE is returned to indicate bad data in FdBuffer.
+ *
+ * The iterator must point to the head of a protobuf formatted field for successful operation.
+ * After exit with NO_ERROR, iterator points to the next protobuf field's head.
+ */
+static status_t
+stripField(FdBuffer::iterator &iterator, vector<uint8_t> &buf, const Privacy* parentPolicy, const PrivacySpec& spec)
+{
+    if (iterator.outOfBound() || parentPolicy == NULL) return BAD_VALUE;
+
+    uint32_t varint = read_raw_varint(iterator);
+    uint8_t wireType = read_wire_type(varint);
+    uint32_t fieldId = read_field_id(varint);
+    const Privacy* policy = parentPolicy->lookup(fieldId);
+
+    if (policy == NULL || !policy->IsMessageType() || !policy->HasChildren()) {
+        bool skip = !spec.CheckPremission(policy);
+        size_t amt = buf.size();
+        if (!skip) amt += write_header(buf, fieldId, wireType);
+        amt += write_field_or_skip(iterator, buf, wireType, skip); // point to head of next field
+        return buf.size() != amt ? BAD_VALUE : NO_ERROR;
+    }
+    // current field is message type and its sub-fields have extra privacy policies
+    deque<vector<uint8_t>> q;
+    uint32_t msgSize = read_raw_varint(iterator);
+    size_t finalSize = 0;
+    FdBuffer::iterator start = iterator.snapshot();
+    while ((iterator - start) != (int)msgSize) {
+        vector<uint8_t> v;
+        status_t err = stripField(iterator, v, policy, spec);
+        if (err != NO_ERROR) return err;
+        if (v.empty()) continue;
+        q.push_back(v);
+        finalSize += v.size();
+    }
+
+    write_header(buf, fieldId, wireType);
+    write_raw_varint(buf, finalSize);
+    buf.reserve(finalSize);
+    while (!q.empty()) {
+        vector<uint8_t> subField = q.front();
+        for (vector<uint8_t>::iterator it = subField.begin(); it != subField.end(); it++) {
+            buf.push_back(*it);
+        }
+        q.pop_front();
+    }
+    return NO_ERROR;
+}
+
+// ================================================================================
+EncodedBuffer::EncodedBuffer(const FdBuffer& buffer, const Privacy* policy)
+        : mFdBuffer(buffer),
+          mPolicy(policy),
+          mBuffers(),
+          mSize(0)
+{
+}
+
+EncodedBuffer::~EncodedBuffer()
+{
+}
+
+status_t
+EncodedBuffer::strip(const PrivacySpec& spec)
+{
+    // optimization when no strip happens
+    if (mPolicy == NULL || !mPolicy->HasChildren() || spec.RequireAll()) {
+        if (spec.CheckPremission(mPolicy)) mSize = mFdBuffer.size();
+        return NO_ERROR;
+    }
+
+    FdBuffer::iterator it = mFdBuffer.begin();
+    vector<uint8_t> field;
+    field.reserve(BUFFER_SIZE);
+
+    while (it != mFdBuffer.end()) {
+        status_t err = stripField(it, field, mPolicy, spec);
+        if (err != NO_ERROR) return err;
+        if (field.size() > BUFFER_SIZE) { // rotate to another chunk if buffer size exceeds
+            mBuffers.push_back(field);
+            mSize += field.size();
+            field.clear();
+        }
+    }
+    if (!field.empty()) {
+        mBuffers.push_back(field);
+        mSize += field.size();
+    }
+    return NO_ERROR;
+}
+
+void
+EncodedBuffer::clear()
+{
+    mSize = 0;
+    mBuffers.clear();
+}
+
+size_t
+EncodedBuffer::size() const { return mSize; }
+
+status_t
+EncodedBuffer::flush(int fd)
+{
+    if (size() == mFdBuffer.size()) return mFdBuffer.flush(fd);
+
+    for (vector<vector<uint8_t>>::iterator it = mBuffers.begin(); it != mBuffers.end(); it++) {
+        status_t err = write_all(fd, it->data(), it->size());
+        if (err != NO_ERROR) return err;
+    }
+    return NO_ERROR;
+}
+
diff --git a/cmds/incidentd/src/EncodedBuffer.h b/cmds/incidentd/src/EncodedBuffer.h
new file mode 100644
index 0000000..ea8603a
--- /dev/null
+++ b/cmds/incidentd/src/EncodedBuffer.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ENCODED_BUFFER_H
+#define ENCODED_BUFFER_H
+
+#include "FdBuffer.h"
+#include "Privacy.h"
+
+#include <stdint.h>
+#include <vector>
+
+/**
+ * EncodedBuffer is constructed from FdBuffer which holds original protobuf formatted data and
+ * its privacy policy in its tagged proto message. The class strips PII-sensitive fields
+ * based on the request and holds stripped data in its buffer for output.
+ */
+class EncodedBuffer
+{
+public:
+    EncodedBuffer(const FdBuffer& buffer, const Privacy* policy);
+    ~EncodedBuffer();
+
+    /**
+     * Strip based on the request and hold data in its own buffer. Return NO_ERROR if strip succeeds.
+     */
+    status_t strip(const PrivacySpec& spec);
+
+    /**
+     * Clear encoded buffer so it can be reused by another request.
+     */
+    void clear();
+
+    /**
+     * Return the size of the stripped data.
+     */
+    size_t size() const;
+
+    /**
+     * Flush buffer to the given fd. NO_ERROR is returned if the flush succeeds.
+     */
+    status_t flush(int fd);
+
+private:
+    const FdBuffer& mFdBuffer;
+    const Privacy* mPolicy;
+    vector<vector<uint8_t>> mBuffers;
+    size_t mSize;
+};
+
+#endif // ENCODED_BUFFER_H
\ No newline at end of file
diff --git a/cmds/incidentd/src/FdBuffer.cpp b/cmds/incidentd/src/FdBuffer.cpp
index 4d6a36c..bb399b5 100644
--- a/cmds/incidentd/src/FdBuffer.cpp
+++ b/cmds/incidentd/src/FdBuffer.cpp
@@ -17,6 +17,7 @@
 #define LOG_TAG "incidentd"
 
 #include "FdBuffer.h"
+#include "io_util.h"
 
 #include <cutils/log.h>
 #include <utils/SystemClock.h>
@@ -239,25 +240,32 @@
 }
 
 size_t
-FdBuffer::size()
+FdBuffer::size() const
 {
     if (mBuffers.empty()) return 0;
     return ((mBuffers.size() - 1) * BUFFER_SIZE) + mCurrentWritten;
 }
 
 status_t
-FdBuffer::write(ReportRequestSet* reporter)
+FdBuffer::flush(int fd) const
 {
-    const int N = mBuffers.size() - 1;
-    for (int i=0; i<N; i++) {
-        reporter->write(mBuffers[i], BUFFER_SIZE);
+    size_t i=0;
+    status_t err = NO_ERROR;
+    for (i=0; i<mBuffers.size()-1; i++) {
+        err = write_all(fd, mBuffers[i], BUFFER_SIZE);
+        if (err != NO_ERROR) return err;
     }
-    reporter->write(mBuffers[N], mCurrentWritten);
-    return NO_ERROR;
+    return write_all(fd, mBuffers[i], mCurrentWritten);
 }
 
 FdBuffer::iterator
-FdBuffer::end()
+FdBuffer::begin() const
+{
+    return iterator(*this, 0, 0);
+}
+
+FdBuffer::iterator
+FdBuffer::end() const
 {
     if (mBuffers.empty() || mCurrentWritten < 0) return begin();
     if (mCurrentWritten == BUFFER_SIZE)
@@ -266,6 +274,17 @@
     return FdBuffer::iterator(*this, mBuffers.size() - 1, mCurrentWritten);
 }
 
+// ===============================================================================
+FdBuffer::iterator::iterator(const FdBuffer& buffer, ssize_t index, ssize_t offset)
+        : mFdBuffer(buffer),
+          mIndex(index),
+          mOffset(offset)
+{
+}
+
+FdBuffer::iterator&
+FdBuffer::iterator::operator=(iterator& other) const { return other; }
+
 FdBuffer::iterator&
 FdBuffer::iterator::operator+(size_t offset)
 {
@@ -278,8 +297,50 @@
     return *this;
 }
 
+FdBuffer::iterator&
+FdBuffer::iterator::operator+=(size_t offset) { return *this + offset; }
+
+FdBuffer::iterator&
+FdBuffer::iterator::operator++() { return *this + 1; }
+
+FdBuffer::iterator
+FdBuffer::iterator::operator++(int) { return *this + 1; }
+
+bool
+FdBuffer::iterator::operator==(iterator other) const
+{
+    return mIndex == other.mIndex && mOffset == other.mOffset;
+}
+
+bool
+FdBuffer::iterator::operator!=(iterator other) const { return !(*this == other); }
+
+int
+FdBuffer::iterator::operator-(iterator other) const
+{
+    return (int)bytesRead() - (int)other.bytesRead();
+}
+
+FdBuffer::iterator::reference
+FdBuffer::iterator::operator*() const
+{
+    return mFdBuffer.mBuffers[mIndex][mOffset];
+}
+
+FdBuffer::iterator
+FdBuffer::iterator::snapshot() const
+{
+    return FdBuffer::iterator(mFdBuffer, mIndex, mOffset);
+}
+
 size_t
-FdBuffer::iterator::bytesRead()
+FdBuffer::iterator::bytesRead() const
 {
     return mIndex * BUFFER_SIZE + mOffset;
 }
+
+bool
+FdBuffer::iterator::outOfBound() const
+{
+    return bytesRead() > mFdBuffer.size();
+}
diff --git a/cmds/incidentd/src/FdBuffer.h b/cmds/incidentd/src/FdBuffer.h
index e9a53ff..dfe39c6 100644
--- a/cmds/incidentd/src/FdBuffer.h
+++ b/cmds/incidentd/src/FdBuffer.h
@@ -17,8 +17,6 @@
 #ifndef FD_BUFFER_H
 #define FD_BUFFER_H
 
-#include "Reporter.h"
-
 #include <utils/Errors.h>
 
 #include <vector>
@@ -55,7 +53,7 @@
     /**
      * Whether we timed out.
      */
-    bool timedOut() { return mTimedOut; }
+    bool timedOut() const { return mTimedOut; }
 
     /**
      * If more than 4 MB is read, we truncate the data and return success.
@@ -65,23 +63,22 @@
      * happens, truncated() will return true so it can be marked. If the data is
      * exactly 4 MB, truncated is still set. Sorry.
      */
-    bool truncated() { return mTruncated; }
+    bool truncated() const { return mTruncated; }
 
     /**
      * How much data was read.
      */
-    size_t size();
+    size_t size() const;
 
     /**
-     * [Deprecated] Write the data that we recorded to the fd given.
-     * TODO: remove it once the iterator api is working
+     * Flush all the data to given file descriptor;
      */
-    status_t write(ReportRequestSet* requests);
+    status_t flush(int fd) const;
 
     /**
      * How long the read took in milliseconds.
      */
-    int64_t durationMs() { return mFinishTime - mStartTime; }
+    int64_t durationMs() const { return mFinishTime - mStartTime; }
 
     /**
      * Read data stored in FdBuffer
@@ -89,30 +86,31 @@
     class iterator;
     friend class iterator;
     class iterator : public std::iterator<std::random_access_iterator_tag, uint8_t> {
+    public:
+        iterator(const FdBuffer& buffer, ssize_t index, ssize_t offset);
+        iterator& operator=(iterator& other) const;
+        iterator& operator+(size_t offset);
+        iterator& operator+=(size_t offset);
+        iterator& operator++();
+        iterator operator++(int);
+        bool operator==(iterator other) const;
+        bool operator!=(iterator other) const;
+        int operator-(iterator other) const;
+        reference operator*() const;
+
+        // return the snapshot of the current iterator
+        iterator snapshot() const;
+        // how many bytes are read
+        size_t bytesRead() const;
+        // random access could make the iterator out of bound
+        bool outOfBound() const;
     private:
-        FdBuffer& mFdBuffer;
+        const FdBuffer& mFdBuffer;
         size_t mIndex;
         size_t mOffset;
-    public:
-        explicit iterator(FdBuffer& buffer, ssize_t index, ssize_t offset)
-                : mFdBuffer(buffer), mIndex(index), mOffset(offset) {}
-        iterator& operator=(iterator& other) { return other; }
-        iterator& operator+(size_t offset); // this is implemented in .cpp
-        iterator& operator+=(size_t offset) { return *this + offset; }
-        iterator& operator++() { return *this + 1; }
-        iterator operator++(int) { return *this + 1; }
-        bool operator==(iterator other) const {
-            return mIndex == other.mIndex && mOffset == other.mOffset;
-        }
-        bool operator!=(iterator other) const { return !(*this == other); }
-        reference operator*() const { return mFdBuffer.mBuffers[mIndex][mOffset]; }
-
-        // random access could make the iterator out of bound
-        size_t bytesRead();
-        bool outOfBound() { return bytesRead() > mFdBuffer.size(); };
     };
-    iterator begin() { return iterator(*this, 0, 0); }
-    iterator end();
+    iterator begin() const;
+    iterator end() const;
 
 private:
     vector<uint8_t*> mBuffers;
@@ -123,19 +121,4 @@
     bool mTruncated;
 };
 
-class Fpipe {
-public:
-    Fpipe() {}
-    bool close() { return !(::close(mFds[0]) || ::close(mFds[1])); }
-    ~Fpipe() { close(); }
-
-    inline bool init() { return pipe(mFds) != -1; }
-    inline int readFd() const { return mFds[0]; }
-    inline int writeFd() const { return mFds[1]; }
-
-private:
-    int mFds[2];
-};
-
-
 #endif // FD_BUFFER_H
diff --git a/cmds/incidentd/src/Privacy.cpp b/cmds/incidentd/src/Privacy.cpp
new file mode 100644
index 0000000..dbab548
--- /dev/null
+++ b/cmds/incidentd/src/Privacy.cpp
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Privacy.h"
+
+// DESTINATION enum value
+const uint8_t DEST_LOCAL = 0;
+const uint8_t DEST_EXPLICIT = 1;
+const uint8_t DEST_AUTOMATIC = 2;
+
+// type of the field, identitical to protobuf definition
+const uint8_t TYPE_STRING = 9;
+const uint8_t TYPE_MESSAGE = 11;
+
+Privacy::Privacy(uint32_t field_id, uint8_t type, uint8_t dest)
+    : field_id(field_id),
+      type(type),
+      children(NULL),
+      dest(dest),
+      patterns(NULL)
+{
+}
+
+Privacy::Privacy(uint32_t field_id, const Privacy** children)
+    : field_id(field_id),
+      type(TYPE_MESSAGE),
+      children(children),
+      dest(DEST_DEFAULT_VALUE), // this will be ignored
+      patterns(NULL)
+{
+}
+
+Privacy::Privacy(uint32_t field_id, uint8_t dest, const char** patterns)
+    : field_id(field_id),
+      type(TYPE_STRING),
+      children(NULL),
+      dest(dest),
+      patterns(patterns)
+{
+}
+
+bool
+Privacy::IsMessageType() const { return type == TYPE_MESSAGE; }
+
+bool
+Privacy::IsStringType() const { return type == TYPE_STRING; }
+
+bool
+Privacy::HasChildren() const { return children != NULL && children[0] != NULL; }
+
+const Privacy*
+Privacy::lookup(uint32_t fieldId) const
+{
+    if (children == NULL) return NULL;
+    for (int i=0; children[i] != NULL; i++) {
+        if (children[i]->field_id == fieldId) return children[i];
+        // This assumes the list's field id is in ascending order and must be true.
+        if (children[i]->field_id > fieldId) return NULL;
+    }
+    return NULL;
+}
+
+static bool allowDest(const uint8_t dest, const uint8_t policy)
+{
+    switch (policy) {
+    case DEST_LOCAL:
+        return dest == DEST_LOCAL;
+    case DEST_EXPLICIT:
+        return dest == DEST_LOCAL || dest == DEST_EXPLICIT;
+    case DEST_AUTOMATIC:
+        return true;
+    default:
+        return false;
+    }
+}
+
+bool
+PrivacySpec::operator<(const PrivacySpec& other) const
+{
+  return dest < other.dest;
+}
+
+bool
+PrivacySpec::CheckPremission(const Privacy* privacy) const
+{
+    uint8_t policy = privacy == NULL ? DEST_DEFAULT_VALUE : privacy->dest;
+    return allowDest(dest, policy);
+}
+
+bool
+PrivacySpec::RequireAll() const { return dest == DEST_LOCAL; }
+
+PrivacySpec new_spec_from_args(int dest) {
+  if (dest < 0) return PrivacySpec();
+  return PrivacySpec(dest);
+}
+
+PrivacySpec get_default_dropbox_spec() { return PrivacySpec(DEST_AUTOMATIC); }
\ No newline at end of file
diff --git a/cmds/incidentd/src/Privacy.h b/cmds/incidentd/src/Privacy.h
new file mode 100644
index 0000000..c56ba9b8
--- /dev/null
+++ b/cmds/incidentd/src/Privacy.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef PRIVACY_H
+#define PRIVACY_H
+
+#include <stdint.h>
+
+// This is the default value of DEST enum
+const uint8_t DEST_DEFAULT_VALUE = 1;
+
+/*
+ * In order not to depend on libprotobuf-cpp-full nor libplatformprotos in incidentd,
+ * privacy options's data structure are explicitly redefined in this file.
+ */
+struct Privacy {
+    uint32_t field_id;
+    uint8_t type;
+    // ignore parent's privacy flags if children are set, NULL-terminated
+    const Privacy** children;
+
+    // the following fields are identitical to
+    // frameworks/base/libs/incident/proto/android/privacy.proto
+    uint8_t dest;
+    const char** patterns; // only set when type is string
+
+    Privacy(uint32_t field_id, uint8_t type, uint8_t dest); // generic constructor
+    Privacy(uint32_t field_id, const Privacy** children); // used for message type
+    Privacy(uint32_t field_id, uint8_t dest, const char** patterns); // used for string type
+
+    bool IsMessageType() const;
+    bool IsStringType() const;
+    bool HasChildren() const;
+    const Privacy* lookup(uint32_t fieldId) const;
+};
+
+/**
+ * PrivacySpec defines the request has what level of privacy authorization.
+ * For example, a device without user consent should only be able to upload AUTOMATIC fields.
+ */
+class PrivacySpec {
+public:
+    const uint8_t dest;
+
+    PrivacySpec() : dest(DEST_DEFAULT_VALUE) {}
+    PrivacySpec(uint8_t dest) : dest(dest) {}
+
+    bool operator<(const PrivacySpec& other) const;
+
+    bool CheckPremission(const Privacy* privacy) const;
+    bool RequireAll() const;
+};
+
+PrivacySpec new_spec_from_args(int dest);
+PrivacySpec get_default_dropbox_spec();
+
+#endif // PRIVACY_H
diff --git a/cmds/incidentd/src/Reporter.cpp b/cmds/incidentd/src/Reporter.cpp
index 4ffc119..11347e2 100644
--- a/cmds/incidentd/src/Reporter.cpp
+++ b/cmds/incidentd/src/Reporter.cpp
@@ -17,7 +17,6 @@
 #define LOG_TAG "incidentd"
 
 #include "Reporter.h"
-#include "protobuf.h"
 
 #include "report_directory.h"
 #include "section_list.h"
@@ -38,20 +37,6 @@
 static const char* INCIDENT_DIRECTORY = "/data/misc/incidents/";
 
 // ================================================================================
-static status_t write_all(int fd, uint8_t const* buf, size_t size)
-{
-    while (size > 0) {
-        ssize_t amt = ::write(fd, buf, size);
-        if (amt < 0) {
-            return -errno;
-        }
-        size -= amt;
-        buf += amt;
-    }
-    return NO_ERROR;
-}
-
-// ================================================================================
 ReportRequest::ReportRequest(const IncidentReportArgs& a,
             const sp<IIncidentReportStatusListener> &l, int f)
     :args(a),
@@ -65,11 +50,16 @@
 {
 }
 
+bool
+ReportRequest::ok()
+{
+    return fd >= 0 && err == NO_ERROR;
+}
+
 // ================================================================================
 ReportRequestSet::ReportRequestSet()
     :mRequests(),
      mSections(),
-     mWritableCount(0),
      mMainFd(-1)
 {
 }
@@ -84,45 +74,12 @@
 {
     mRequests.push_back(request);
     mSections.merge(request->args);
-    mWritableCount++;
 }
 
 void
 ReportRequestSet::setMainFd(int fd)
 {
     mMainFd = fd;
-    mWritableCount++;
-}
-
-status_t
-ReportRequestSet::write(uint8_t const* buf, size_t size)
-{
-    status_t err = EBADF;
-
-    // The streaming ones
-    int const N = mRequests.size();
-    for (int i=N-1; i>=0; i--) {
-        sp<ReportRequest> request = mRequests[i];
-        if (request->fd >= 0 && request->err == NO_ERROR) {
-            err = write_all(request->fd, buf, size);
-            if (err != NO_ERROR) {
-                request->err = err;
-                mWritableCount--;
-            }
-        }
-    }
-
-    // The dropbox file
-    if (mMainFd >= 0) {
-        err = write_all(mMainFd, buf, size);
-        if (err != NO_ERROR) {
-            mMainFd = -1;
-            mWritableCount--;
-        }
-    }
-
-    // Return an error only when there are no FDs to write.
-    return mWritableCount > 0 ? NO_ERROR : err;
 }
 
 bool
@@ -164,6 +121,7 @@
     status_t err = NO_ERROR;
     bool needMainFd = false;
     int mainFd = -1;
+    HeaderSection headers;
 
     // See if we need the main file
     for (ReportRequestSet::iterator it=batch.begin(); it!=batch.end(); it++) {
@@ -176,7 +134,7 @@
         // Create the directory
         if (!isTest) err = create_directory(mIncidentDirectory);
         if (err != NO_ERROR) {
-            goto done;
+            goto DONE;
         }
 
         // If there are too many files in the directory (for whatever reason),
@@ -187,7 +145,7 @@
         // Open the file.
         err = create_file(&mainFd);
         if (err != NO_ERROR) {
-            goto done;
+            goto DONE;
         }
 
         // Add to the set
@@ -202,24 +160,7 @@
     }
 
     // Write the incident headers
-    for (ReportRequestSet::iterator it=batch.begin(); it!=batch.end(); it++) {
-        const sp<ReportRequest> request = (*it);
-        const vector<vector<int8_t>>& headers = request->args.headers();
-
-        for (vector<vector<int8_t>>::const_iterator buf=headers.begin(); buf!=headers.end();
-                buf++) {
-            int fd = request->fd >= 0 ? request->fd : mainFd;
-
-            uint8_t buffer[20];
-            uint8_t* p = write_length_delimited_tag_header(buffer, FIELD_ID_INCIDENT_HEADER,
-                    buf->size());
-            write_all(fd, buffer, p-buffer);
-
-            write_all(fd, (uint8_t const*)buf->data(), buf->size());
-            // If there was an error now, there will be an error later and we will remove
-            // it from the list then.
-        }
-    }
+    headers.Execute(&batch);
 
     // For each of the report fields, see if we need it, and if so, execute the command
     // and report to those that care that we're doing it.
@@ -240,7 +181,7 @@
             if (err != NO_ERROR) {
                 ALOGW("Incident section %s (%d) failed. Stopping report.",
                         (*section)->name.string(), id);
-                goto done;
+                goto DONE;
             }
 
             // Notify listener of starting
@@ -254,7 +195,7 @@
         }
     }
 
-done:
+DONE:
     // Close the file.
     if (mainFd >= 0) {
         close(mainFd);
diff --git a/cmds/incidentd/src/Reporter.h b/cmds/incidentd/src/Reporter.h
index 509611c..2615c62 100644
--- a/cmds/incidentd/src/Reporter.h
+++ b/cmds/incidentd/src/Reporter.h
@@ -40,6 +40,8 @@
     ReportRequest(const IncidentReportArgs& args,
             const sp<IIncidentReportStatusListener> &listener, int fd);
     virtual ~ReportRequest();
+
+    bool ok(); // returns true if the request is ok for write.
 };
 
 // ================================================================================
@@ -52,21 +54,16 @@
     void add(const sp<ReportRequest>& request);
     void setMainFd(int fd);
 
-    // Write to all of the fds for the requests. If a write fails, it stops
-    // writing to that fd and returns NO_ERROR. When we are out of fds to write
-    // to it returns an error.
-    status_t write(uint8_t const* buf, size_t size);
-
     typedef vector<sp<ReportRequest>>::iterator iterator;
 
     iterator begin() { return mRequests.begin(); }
     iterator end() { return mRequests.end(); }
 
+    int mainFd() { return mMainFd; }
     bool containsSection(int id);
 private:
     vector<sp<ReportRequest>> mRequests;
     IncidentReportArgs mSections;
-    int mWritableCount;
     int mMainFd;
 };
 
diff --git a/cmds/incidentd/src/Section.cpp b/cmds/incidentd/src/Section.cpp
index ac87fe3..6f052de 100644
--- a/cmds/incidentd/src/Section.cpp
+++ b/cmds/incidentd/src/Section.cpp
@@ -16,11 +16,18 @@
 
 #define LOG_TAG "incidentd"
 
+#include "EncodedBuffer.h"
+#include "FdBuffer.h"
+#include "Privacy.h"
 #include "Section.h"
+
+#include "io_util.h"
 #include "protobuf.h"
+#include "section_list.h"
 
 #include <private/android_filesystem_config.h>
 #include <binder/IServiceManager.h>
+#include <map>
 #include <mutex>
 #include <wait.h>
 #include <unistd.h>
@@ -32,7 +39,7 @@
 const char* INCIDENT_HELPER = "/system/bin/incident_helper";
 
 static pid_t
-forkAndExecuteIncidentHelper(const int id, const char* name, Fpipe& p2cPipe, Fpipe& c2pPipe)
+fork_execute_incident_helper(const int id, const char* name, Fpipe& p2cPipe, Fpipe& c2pPipe)
 {
     const char* ihArgs[] { INCIDENT_HELPER, "-s", String8::format("%d", id).string(), NULL };
 
@@ -66,14 +73,15 @@
     return pid;
 }
 
-static status_t killChild(pid_t pid) {
+// ================================================================================
+static status_t kill_child(pid_t pid) {
     int status;
     kill(pid, SIGKILL);
     if (waitpid(pid, &status, 0) == -1) return -1;
     return WIFEXITED(status) == 0 ? NO_ERROR : -WEXITSTATUS(status);
 }
 
-static status_t waitForChild(pid_t pid) {
+static status_t wait_child(pid_t pid) {
     int status;
     bool died = false;
     // wait for child to report status up to 1 seconds
@@ -82,13 +90,92 @@
         // sleep for 0.2 second
         nanosleep(&WAIT_INTERVAL_NS, NULL);
     }
-    if (!died) return killChild(pid);
+    if (!died) return kill_child(pid);
     return WIFEXITED(status) == 0 ? NO_ERROR : -WEXITSTATUS(status);
 }
+// ================================================================================
+static const Privacy*
+get_privacy_of_section(int id)
+{
+    if (id < 0) return NULL;
+    int i=0;
+    while (PRIVACY_POLICY_LIST[i] != NULL) {
+        const Privacy* p = PRIVACY_POLICY_LIST[i];
+        if (p->field_id == (uint32_t)id) return p;
+        if (p->field_id > (uint32_t)id) return NULL;
+        i++;
+    }
+    return NULL;
+}
+
+// ================================================================================
+static status_t
+write_section_header(int fd, int sectionId, size_t size)
+{
+    uint8_t buf[20];
+    uint8_t *p = write_length_delimited_tag_header(buf, sectionId, size);
+    return write_all(fd, buf, p-buf);
+}
+
+static status_t
+write_report_requests(const int id, const FdBuffer& buffer, ReportRequestSet* requests)
+{
+    status_t err = -EBADF;
+    EncodedBuffer encodedBuffer(buffer, get_privacy_of_section(id));
+    int writeable = 0;
+
+    // The streaming ones, group requests by spec in order to save unnecessary strip operations
+    map<PrivacySpec, vector<sp<ReportRequest>>> requestsBySpec;
+    for (ReportRequestSet::iterator it = requests->begin(); it != requests->end(); it++) {
+        sp<ReportRequest> request = *it;
+        if (!request->ok() || !request->args.containsSection(id)) {
+            continue;  // skip invalid request
+        }
+        PrivacySpec spec = new_spec_from_args(request->args.dest());
+        requestsBySpec[spec].push_back(request);
+    }
+
+    for (map<PrivacySpec, vector<sp<ReportRequest>>>::iterator mit = requestsBySpec.begin(); mit != requestsBySpec.end(); mit++) {
+        PrivacySpec spec = mit->first;
+        err = encodedBuffer.strip(spec);
+        if (err != NO_ERROR) return err; // it means the encodedBuffer data is corrupted.
+        if (encodedBuffer.size() == 0) continue;
+
+        for (vector<sp<ReportRequest>>::iterator it = mit->second.begin(); it != mit->second.end(); it++) {
+            sp<ReportRequest> request = *it;
+            err = write_section_header(request->fd, id, encodedBuffer.size());
+            if (err != NO_ERROR) { request->err = err; continue; }
+            err = encodedBuffer.flush(request->fd);
+            if (err != NO_ERROR) { request->err = err; continue; }
+            writeable++;
+            ALOGD("Section %d flushed %zu bytes to fd %d with spec %d", id, encodedBuffer.size(), request->fd, spec.dest);
+        }
+        encodedBuffer.clear();
+    }
+
+    // The dropbox file
+    if (requests->mainFd() >= 0) {
+        err = encodedBuffer.strip(get_default_dropbox_spec());
+        if (err != NO_ERROR) return err; // the buffer data is corrupted.
+        if (encodedBuffer.size() == 0) goto DONE;
+
+        err = write_section_header(requests->mainFd(), id, encodedBuffer.size());
+        if (err != NO_ERROR) { requests->setMainFd(-1); goto DONE; }
+        err = encodedBuffer.flush(requests->mainFd());
+        if (err != NO_ERROR) { requests->setMainFd(-1); goto DONE; }
+        writeable++;
+        ALOGD("Section %d flushed %zu bytes to dropbox %d", id, encodedBuffer.size(), requests->mainFd());
+    }
+
+DONE:
+    // only returns error if there is no fd to write to.
+    return writeable > 0 ? NO_ERROR : err;
+}
 
 // ================================================================================
 Section::Section(int i, const int64_t timeoutMs)
-    :id(i), timeoutMs(timeoutMs)
+    :id(i),
+     timeoutMs(timeoutMs)
 {
 }
 
@@ -96,24 +183,50 @@
 {
 }
 
-status_t
-Section::WriteHeader(ReportRequestSet* requests, size_t size) const
+// ================================================================================
+HeaderSection::HeaderSection()
+    :Section(FIELD_ID_INCIDENT_HEADER, 0)
 {
-    ssize_t amt;
-    uint8_t buf[20];
-    uint8_t* p = write_length_delimited_tag_header(buf, this->id, size);
-    return requests->write(buf, p-buf);
+}
+
+HeaderSection::~HeaderSection()
+{
+}
+
+status_t
+HeaderSection::Execute(ReportRequestSet* requests) const
+{
+    for (ReportRequestSet::iterator it=requests->begin(); it!=requests->end(); it++) {
+        const sp<ReportRequest> request = *it;
+        const vector<vector<int8_t>>& headers = request->args.headers();
+
+        for (vector<vector<int8_t>>::const_iterator buf=headers.begin(); buf!=headers.end(); buf++) {
+            if (buf->empty()) continue;
+
+            // So the idea is only requests with negative fd are written to dropbox file.
+            int fd = request->fd >= 0 ? request->fd : requests->mainFd();
+            write_section_header(fd, FIELD_ID_INCIDENT_HEADER, buf->size());
+            write_all(fd, (uint8_t const*)buf->data(), buf->size());
+            // If there was an error now, there will be an error later and we will remove
+            // it from the list then.
+        }
+    }
+    return NO_ERROR;
 }
 
 // ================================================================================
 FileSection::FileSection(int id, const char* filename, const int64_t timeoutMs)
-        : Section(id, timeoutMs), mFilename(filename) {
+    :Section(id, timeoutMs),
+     mFilename(filename)
+{
     name = filename;
 }
 
 FileSection::~FileSection() {}
 
-status_t FileSection::Execute(ReportRequestSet* requests) const {
+status_t
+FileSection::Execute(ReportRequestSet* requests) const
+{
     // read from mFilename first, make sure the file is available
     // add O_CLOEXEC to make sure it is closed when exec incident helper
     int fd = open(mFilename, O_RDONLY | O_CLOEXEC);
@@ -131,7 +244,7 @@
         return -errno;
     }
 
-    pid_t pid = forkAndExecuteIncidentHelper(this->id, this->name.string(), p2cPipe, c2pPipe);
+    pid_t pid = fork_execute_incident_helper(this->id, this->name.string(), p2cPipe, c2pPipe);
     if (pid == -1) {
         ALOGW("FileSection '%s' failed to fork", this->name.string());
         return -errno;
@@ -143,11 +256,11 @@
     if (readStatus != NO_ERROR || buffer.timedOut()) {
         ALOGW("FileSection '%s' failed to read data from incident helper: %s, timedout: %s, kill: %s",
             this->name.string(), strerror(-readStatus), buffer.timedOut() ? "true" : "false",
-            strerror(-killChild(pid)));
+            strerror(-kill_child(pid)));
         return readStatus;
     }
 
-    status_t ihStatus = waitForChild(pid);
+    status_t ihStatus = wait_child(pid);
     if (ihStatus != NO_ERROR) {
         ALOGW("FileSection '%s' abnormal child process: %s", this->name.string(), strerror(-ihStatus));
         return ihStatus;
@@ -155,8 +268,7 @@
 
     ALOGD("FileSection '%s' wrote %zd bytes in %d ms", this->name.string(), buffer.size(),
             (int)buffer.durationMs());
-    WriteHeader(requests, buffer.size());
-    status_t err = buffer.write(requests);
+    status_t err = write_report_requests(this->id, buffer, requests);
     if (err != NO_ERROR) {
         ALOGW("FileSection '%s' failed writing: %s", this->name.string(), strerror(-err));
         return err;
@@ -313,8 +425,7 @@
     // Write the data that was collected
     ALOGD("WorkerThreadSection '%s' wrote %zd bytes in %d ms", name.string(), buffer.size(),
             (int)buffer.durationMs());
-    WriteHeader(requests, buffer.size());
-    err = buffer.write(requests);
+    err = write_report_requests(this->id, buffer, requests);
     if (err != NO_ERROR) {
         ALOGW("WorkerThreadSection '%s' failed writing: '%s'", this->name.string(), strerror(-err));
         return err;
@@ -324,7 +435,8 @@
 }
 
 // ================================================================================
-void CommandSection::init(const char* command, va_list args)
+void
+CommandSection::init(const char* command, va_list args)
 {
     va_list copied_args;
     int numOfArgs = 0;
@@ -350,7 +462,7 @@
 }
 
 CommandSection::CommandSection(int id, const int64_t timeoutMs, const char* command, ...)
-        : Section(id, timeoutMs)
+    :Section(id, timeoutMs)
 {
     va_list args;
     va_start(args, command);
@@ -359,7 +471,7 @@
 }
 
 CommandSection::CommandSection(int id, const char* command, ...)
-        : Section(id)
+    :Section(id)
 {
     va_list args;
     va_start(args, command);
@@ -401,7 +513,7 @@
         ALOGW("CommandSection '%s' failed in executing command: %s", this->name.string(), strerror(errno));
         _exit(err); // exit with command error code
     }
-    pid_t ihPid = forkAndExecuteIncidentHelper(this->id, this->name.string(), cmdPipe, ihPipe);
+    pid_t ihPid = fork_execute_incident_helper(this->id, this->name.string(), cmdPipe, ihPipe);
     if (ihPid == -1) {
         ALOGW("CommandSection '%s' failed to fork", this->name.string());
         return -errno;
@@ -413,14 +525,14 @@
         ALOGW("CommandSection '%s' failed to read data from incident helper: %s, "
             "timedout: %s, kill command: %s, kill incident helper: %s",
             this->name.string(), strerror(-readStatus), buffer.timedOut() ? "true" : "false",
-            strerror(-killChild(cmdPid)), strerror(-killChild(ihPid)));
+            strerror(-kill_child(cmdPid)), strerror(-kill_child(ihPid)));
         return readStatus;
     }
 
     // TODO: wait for command here has one trade-off: the failed status of command won't be detected until
     //       buffer timeout, but it has advatage on starting the data stream earlier.
-    status_t cmdStatus = waitForChild(cmdPid);
-    status_t ihStatus  = waitForChild(ihPid);
+    status_t cmdStatus = wait_child(cmdPid);
+    status_t ihStatus  = wait_child(ihPid);
     if (cmdStatus != NO_ERROR || ihStatus != NO_ERROR) {
         ALOGW("CommandSection '%s' abnormal child processes, return status: command: %s, incident helper: %s",
             this->name.string(), strerror(-cmdStatus), strerror(-ihStatus));
@@ -429,8 +541,7 @@
 
     ALOGD("CommandSection '%s' wrote %zd bytes in %d ms", this->name.string(), buffer.size(),
             (int)buffer.durationMs());
-    WriteHeader(requests, buffer.size());
-    status_t err = buffer.write(requests);
+    status_t err = write_report_requests(this->id, buffer, requests);
     if (err != NO_ERROR) {
         ALOGW("CommandSection '%s' failed writing: %s", this->name.string(), strerror(-err));
         return err;
diff --git a/cmds/incidentd/src/Section.h b/cmds/incidentd/src/Section.h
index 93b4848..0a1e03e 100644
--- a/cmds/incidentd/src/Section.h
+++ b/cmds/incidentd/src/Section.h
@@ -17,7 +17,7 @@
 #ifndef SECTIONS_H
 #define SECTIONS_H
 
-#include "FdBuffer.h"
+#include "Reporter.h"
 
 #include <stdarg.h>
 #include <utils/String8.h>
@@ -42,8 +42,18 @@
     virtual ~Section();
 
     virtual status_t Execute(ReportRequestSet* requests) const = 0;
+};
 
-    status_t WriteHeader(ReportRequestSet* requests, size_t size) const;
+/**
+ * Section that generates incident headers.
+ */
+class HeaderSection : public Section
+{
+public:
+    HeaderSection();
+    virtual ~HeaderSection();
+
+    virtual status_t Execute(ReportRequestSet* requests) const;
 };
 
 /**
diff --git a/cmds/incidentd/src/io_util.cpp b/cmds/incidentd/src/io_util.cpp
new file mode 100644
index 0000000..f043d36
--- /dev/null
+++ b/cmds/incidentd/src/io_util.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "io_util.h"
+
+#include <unistd.h>
+
+status_t write_all(int fd, uint8_t const* buf, size_t size)
+{
+    while (size > 0) {
+        ssize_t amt = ::write(fd, buf, size);
+        if (amt < 0) {
+            return -errno;
+        }
+        size -= amt;
+        buf += amt;
+    }
+    return NO_ERROR;
+}
+
+Fpipe::Fpipe() {}
+
+Fpipe::~Fpipe() { close(); }
+
+bool Fpipe::close() { return !(::close(mFds[0]) || ::close(mFds[1])); }
+
+bool Fpipe::init() { return pipe(mFds) != -1; }
+
+int Fpipe::readFd() const { return mFds[0]; }
+
+int Fpipe::writeFd() const { return mFds[1]; }
diff --git a/cmds/incidentd/src/io_util.h b/cmds/incidentd/src/io_util.h
new file mode 100644
index 0000000..320dd6c
--- /dev/null
+++ b/cmds/incidentd/src/io_util.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef IO_UTIL_H
+#define IO_UTIL_H
+
+#include <stdint.h>
+#include <utils/Errors.h>
+
+using namespace android;
+
+status_t write_all(int fd, uint8_t const* buf, size_t size);
+
+class Fpipe {
+public:
+    Fpipe();
+    ~Fpipe();
+
+    bool init();
+    bool close();
+    int readFd() const;
+    int writeFd() const;
+
+private:
+    int mFds[2];
+};
+
+#endif // IO_UTIL_H
\ No newline at end of file
diff --git a/cmds/incidentd/src/protobuf.cpp b/cmds/incidentd/src/protobuf.cpp
index b865339..05de831 100644
--- a/cmds/incidentd/src/protobuf.cpp
+++ b/cmds/incidentd/src/protobuf.cpp
@@ -16,8 +16,17 @@
 
 #include "protobuf.h"
 
+uint8_t read_wire_type(uint32_t varint)
+{
+    return (uint8_t) (varint & 0x07);
+}
 
-uint8_t* 
+uint32_t read_field_id(uint32_t varint)
+{
+    return varint >> 3;
+}
+
+uint8_t*
 write_raw_varint(uint8_t* buf, uint32_t val)
 {
     uint8_t* p = buf;
@@ -32,7 +41,7 @@
     }
 }
 
-uint8_t* 
+uint8_t*
 write_length_delimited_tag_header(uint8_t* buf, uint32_t fieldId, size_t size)
 {
     buf = write_raw_varint(buf, (fieldId << 3) | 2);
@@ -40,3 +49,24 @@
     return buf;
 }
 
+size_t
+write_raw_varint(vector<uint8_t> &buf, uint32_t val)
+{
+    size_t size = 0;
+    while (true) {
+        size++;
+        if ((val & ~0x7F) == 0) {
+            buf.push_back((uint8_t) val);
+            return size;
+        } else {
+            buf.push_back((uint8_t)((val & 0x7F) | 0x80));
+            val >>= 7;
+        }
+    }
+}
+
+size_t
+write_header(vector<uint8_t> &buf, uint32_t fieldId, uint8_t wireType)
+{
+    return write_raw_varint(buf, (fieldId << 3) | wireType);
+}
\ No newline at end of file
diff --git a/cmds/incidentd/src/protobuf.h b/cmds/incidentd/src/protobuf.h
index f196ddc..fb0d69d 100644
--- a/cmds/incidentd/src/protobuf.h
+++ b/cmds/incidentd/src/protobuf.h
@@ -18,6 +18,24 @@
 #define PROTOBUF_H
 
 #include <stdint.h>
+#include <vector>
+
+using namespace std;
+
+const uint8_t WIRE_TYPE_VARINT = 0;
+const uint8_t WIRE_TYPE_FIXED64 = 1;
+const uint8_t WIRE_TYPE_LENGTH_DELIMITED = 2;
+const uint8_t WIRE_TYPE_FIXED32 = 5;
+
+/**
+ * Read the wire type from varint, it is the smallest 3 bits.
+ */
+uint8_t read_wire_type(uint32_t varint);
+
+/**
+ * read field id from varint, it is varint >> 3;
+ */
+uint32_t read_field_id(uint32_t varint);
 
 /**
  * Write a varint into the buffer. Return the next position to write at.
@@ -32,6 +50,16 @@
  */
 uint8_t* write_length_delimited_tag_header(uint8_t* buf, uint32_t fieldId, size_t size);
 
+/**
+ * Write a varint into a vector. Return the size of the varint.
+ */
+size_t write_raw_varint(vector<uint8_t> &buf, uint32_t val);
+
+/**
+ * Write a protobuf header. Return the size of the header.
+ */
+size_t write_header(vector<uint8_t> &buf, uint32_t fieldId, uint8_t wireType);
+
 enum {
     // IncidentProto.header
     FIELD_ID_INCIDENT_HEADER = 1
diff --git a/cmds/incidentd/src/section_list.h b/cmds/incidentd/src/section_list.h
index 1abdb52..4d9efd7 100644
--- a/cmds/incidentd/src/section_list.h
+++ b/cmds/incidentd/src/section_list.h
@@ -17,6 +17,7 @@
 #ifndef SECTION_LIST_H
 #define SECTION_LIST_H
 
+#include "Privacy.h"
 #include "Section.h"
 
 /**
@@ -25,37 +26,6 @@
  */
 extern const Section* SECTION_LIST[];
 
-/*
- * In order not to use libprotobuf-cpp-full nor libplatformprotos in incidentd
- * privacy options's data structure are explicityly redefined in this file.
- */
-
-// DESTINATION enum
-extern const uint8_t DEST_LOCAL;
-extern const uint8_t DEST_EXPLICIT;
-extern const uint8_t DEST_AUTOMATIC;
-
-// This is the default value of DEST enum
-// field with this value doesn't generate Privacy to save too much generated code
-extern const uint8_t DEST_DEFAULT_VALUE;
-
-// type of the field, identitical to protobuf definition
-extern const uint8_t TYPE_STRING;
-extern const uint8_t TYPE_MESSAGE;
-
-struct Privacy {
-    int field_id;
-    uint8_t type;
-
-    // the following two fields are identitical to
-    // frameworks/base/libs/incident/proto/android/privacy.proto
-    uint8_t dest;
-    const char** patterns;
-
-    // ignore parent's privacy flags if children are set, NULL-terminated
-    const Privacy** children;
-};
-
 /**
  * This is the mapping of section IDs to each section's privacy policy.
  * The section IDs are guaranteed in ascending order
diff --git a/cmds/incidentd/tests/EncodedBuffer_test.cpp b/cmds/incidentd/tests/EncodedBuffer_test.cpp
new file mode 100644
index 0000000..c51520b
--- /dev/null
+++ b/cmds/incidentd/tests/EncodedBuffer_test.cpp
@@ -0,0 +1,207 @@
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "EncodedBuffer.h"
+
+#include <android-base/file.h>
+#include <android-base/test_utils.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <string.h>
+
+using namespace android;
+using namespace android::base;
+using namespace std;
+using ::testing::StrEq;
+using ::testing::Test;
+using ::testing::internal::CaptureStdout;
+using ::testing::internal::GetCapturedStdout;
+
+const uint8_t LOCAL = 0;
+const uint8_t EXPLICIT = 1;
+const uint8_t AUTOMATIC = 2;
+
+const uint8_t OTHER_TYPE = 1;
+const uint8_t STRING_TYPE = 9;
+const uint8_t MESSAGE_TYPE = 11;
+const string STRING_FIELD_0 = "\x02\viamtestdata";
+const string VARINT_FIELD_1 = "\x08\x96\x01"; // 150
+const string STRING_FIELD_2 = "\x12\vwhatthefuck";
+const string FIX64_FIELD_3 = "\x19\xff\xff\xff\xff\xff\xff\xff\xff"; // -1
+const string FIX32_FIELD_4 = "\x25\xff\xff\xff\xff"; // -1
+const string MESSAGE_FIELD_5 = "\x2a\x10" + VARINT_FIELD_1 + STRING_FIELD_2;
+
+class EncodedBufferTest : public Test {
+public:
+    virtual void SetUp() override {
+        ASSERT_NE(tf.fd, -1);
+    }
+
+    void writeToFdBuffer(string str) {
+        ASSERT_TRUE(WriteStringToFile(str, tf.path, false));
+        ASSERT_EQ(NO_ERROR, buffer.read(tf.fd, 10000));
+    }
+
+    void assertBuffer(EncodedBuffer& buf, string expected) {
+        ASSERT_EQ(buf.size(), expected.size());
+        CaptureStdout();
+        ASSERT_EQ(buf.flush(STDOUT_FILENO), NO_ERROR);
+        ASSERT_THAT(GetCapturedStdout(), StrEq(expected));
+    }
+
+    void assertStrip(uint8_t dest, string expected, Privacy* policy) {
+        PrivacySpec spec(dest);
+        EncodedBuffer encodedBuf(buffer, policy);
+        ASSERT_EQ(encodedBuf.strip(spec), NO_ERROR);
+        assertBuffer(encodedBuf, expected);
+    }
+
+    void assertStripByFields(uint8_t dest, string expected, int size, Privacy* privacy, ...) {
+        Privacy* list[size+1];
+        list[0] = privacy;
+        va_list args;
+        va_start(args, privacy);
+        for (int i=1; i<size; i++) {
+            Privacy* p = va_arg(args, Privacy*);
+            list[i] = p;
+        }
+        va_end(args);
+        list[size] = NULL;
+        assertStrip(dest, expected, new Privacy(300, const_cast<const Privacy**>(list)));
+    }
+
+    FdBuffer buffer;
+private:
+    TemporaryFile tf;
+};
+
+TEST_F(EncodedBufferTest, NullFieldPolicy) {
+    writeToFdBuffer(STRING_FIELD_0);
+    assertStrip(EXPLICIT, STRING_FIELD_0, new Privacy(300, NULL));
+}
+
+TEST_F(EncodedBufferTest, StripSpecNotAllowed) {
+    writeToFdBuffer(STRING_FIELD_0);
+    assertStripByFields(AUTOMATIC, "", 1, new Privacy(0, STRING_TYPE, EXPLICIT));
+}
+
+TEST_F(EncodedBufferTest, StripVarintField) {
+    writeToFdBuffer(VARINT_FIELD_1);
+    assertStripByFields(EXPLICIT, "", 1, new Privacy(1, OTHER_TYPE, LOCAL));
+}
+
+TEST_F(EncodedBufferTest, StripLengthDelimitedField_String) {
+    writeToFdBuffer(STRING_FIELD_2);
+    assertStripByFields(EXPLICIT, "", 1, new Privacy(2, STRING_TYPE, LOCAL));
+}
+
+TEST_F(EncodedBufferTest, StripFixed64Field) {
+    writeToFdBuffer(FIX64_FIELD_3);
+    assertStripByFields(EXPLICIT, "", 1, new Privacy(3, OTHER_TYPE, LOCAL));
+}
+
+TEST_F(EncodedBufferTest, StripFixed32Field) {
+    writeToFdBuffer(FIX32_FIELD_4);
+    assertStripByFields(EXPLICIT, "", 1, new Privacy(4, OTHER_TYPE, LOCAL));
+}
+
+TEST_F(EncodedBufferTest, StripLengthDelimitedField_Message) {
+    writeToFdBuffer(MESSAGE_FIELD_5);
+    assertStripByFields(EXPLICIT, "", 1, new Privacy(5, MESSAGE_TYPE, LOCAL));
+}
+
+TEST_F(EncodedBufferTest, NoStripVarintField) {
+    writeToFdBuffer(VARINT_FIELD_1);
+    assertStripByFields(EXPLICIT, VARINT_FIELD_1, 1, new Privacy(1, OTHER_TYPE, AUTOMATIC));
+}
+
+TEST_F(EncodedBufferTest, NoStripLengthDelimitedField_String) {
+    writeToFdBuffer(STRING_FIELD_2);
+    assertStripByFields(EXPLICIT, STRING_FIELD_2, 1, new Privacy(2, STRING_TYPE, AUTOMATIC));
+}
+
+TEST_F(EncodedBufferTest, NoStripFixed64Field) {
+    writeToFdBuffer(FIX64_FIELD_3);
+    assertStripByFields(EXPLICIT, FIX64_FIELD_3, 1, new Privacy(3, OTHER_TYPE, AUTOMATIC));
+}
+
+TEST_F(EncodedBufferTest, NoStripFixed32Field) {
+    writeToFdBuffer(FIX32_FIELD_4);
+    assertStripByFields(EXPLICIT, FIX32_FIELD_4, 1, new Privacy(4, OTHER_TYPE, AUTOMATIC));
+}
+
+TEST_F(EncodedBufferTest, NoStripLengthDelimitedField_Message) {
+    writeToFdBuffer(MESSAGE_FIELD_5);
+    assertStripByFields(EXPLICIT, MESSAGE_FIELD_5, 1, new Privacy(5, MESSAGE_TYPE, AUTOMATIC));
+}
+
+TEST_F(EncodedBufferTest, StripVarintAndString) {
+    writeToFdBuffer(STRING_FIELD_0 + VARINT_FIELD_1 + STRING_FIELD_2
+            + FIX64_FIELD_3 + FIX32_FIELD_4);
+    string expected = STRING_FIELD_0 + FIX64_FIELD_3 + FIX32_FIELD_4;
+    assertStripByFields(EXPLICIT, expected, 2,
+            new Privacy(1, OTHER_TYPE, LOCAL), new Privacy(2, STRING_TYPE, LOCAL));
+}
+
+TEST_F(EncodedBufferTest, StripVarintAndFixed64) {
+    writeToFdBuffer(STRING_FIELD_0 + VARINT_FIELD_1 + STRING_FIELD_2
+            + FIX64_FIELD_3 + FIX32_FIELD_4);
+    string expected = STRING_FIELD_0 + STRING_FIELD_2 + FIX32_FIELD_4;
+    assertStripByFields(EXPLICIT, expected, 2,
+            new Privacy(1, OTHER_TYPE, LOCAL), new Privacy(3, OTHER_TYPE, LOCAL));
+}
+
+TEST_F(EncodedBufferTest, StripVarintInNestedMessage) {
+    writeToFdBuffer(STRING_FIELD_0 + MESSAGE_FIELD_5);
+    const Privacy* list[] = { new Privacy(1, OTHER_TYPE, LOCAL), NULL };
+    string expected = STRING_FIELD_0 + "\x2a\xd" + STRING_FIELD_2;
+    assertStripByFields(EXPLICIT, expected, 1, new Privacy(5, list));
+}
+
+TEST_F(EncodedBufferTest, StripFix64AndVarintInNestedMessage) {
+    writeToFdBuffer(STRING_FIELD_0 + FIX64_FIELD_3 + MESSAGE_FIELD_5);
+    const Privacy* list[] = { new Privacy(1, OTHER_TYPE, LOCAL), NULL };
+    string expected = STRING_FIELD_0 + "\x2a\xd" + STRING_FIELD_2;
+    assertStripByFields(EXPLICIT, expected, 2, new Privacy(3, OTHER_TYPE, LOCAL), new Privacy(5, list));
+}
+
+TEST_F(EncodedBufferTest, ClearAndStrip) {
+    string data = STRING_FIELD_0 + VARINT_FIELD_1;
+    writeToFdBuffer(data);
+    const Privacy* list[] = { new Privacy(1, OTHER_TYPE, LOCAL), NULL };
+    EncodedBuffer encodedBuf(buffer, new Privacy(300, list));
+    PrivacySpec spec1(EXPLICIT), spec2(LOCAL);
+
+    ASSERT_EQ(encodedBuf.strip(spec1), NO_ERROR);
+    assertBuffer(encodedBuf, STRING_FIELD_0);
+    ASSERT_EQ(encodedBuf.strip(spec2), NO_ERROR);
+    assertBuffer(encodedBuf, data);
+}
+
+TEST_F(EncodedBufferTest, BadDataInFdBuffer) {
+    writeToFdBuffer("iambaddata");
+    const Privacy* list[] = { new Privacy(4, OTHER_TYPE, AUTOMATIC), NULL };
+    EncodedBuffer encodedBuf(buffer, new Privacy(300, list));
+    PrivacySpec spec;
+    ASSERT_EQ(encodedBuf.strip(spec), BAD_VALUE);
+}
+
+TEST_F(EncodedBufferTest, BadDataInNestedMessage) {
+    writeToFdBuffer(STRING_FIELD_0 + MESSAGE_FIELD_5 + "aoeoe");
+    const Privacy* list[] = { new Privacy(1, OTHER_TYPE, LOCAL), NULL };
+    const Privacy* field5[] = { new Privacy(5, list), NULL };
+    EncodedBuffer encodedBuf(buffer, new Privacy(300, field5));
+    PrivacySpec spec;
+    ASSERT_EQ(encodedBuf.strip(spec), BAD_VALUE);
+}
diff --git a/cmds/incidentd/tests/FdBuffer_test.cpp b/cmds/incidentd/tests/FdBuffer_test.cpp
index 403a2ab..d1436b2 100644
--- a/cmds/incidentd/tests/FdBuffer_test.cpp
+++ b/cmds/incidentd/tests/FdBuffer_test.cpp
@@ -15,10 +15,11 @@
 #define LOG_TAG "incidentd"
 
 #include "FdBuffer.h"
+#include "io_util.h"
 
 #include <android-base/file.h>
 #include <android-base/test_utils.h>
-#include <gmock/gmock.h>
+#include <fcntl.h>
 #include <gtest/gtest.h>
 #include <signal.h>
 #include <string.h>
@@ -30,10 +31,7 @@
 
 using namespace android;
 using namespace android::base;
-using ::testing::StrEq;
 using ::testing::Test;
-using ::testing::internal::CaptureStdout;
-using ::testing::internal::GetCapturedStdout;
 
 class FdBufferTest : public Test {
 public:
@@ -50,12 +48,13 @@
     }
 
     void AssertBufferContent(const char* expected) {
-        ReportRequestSet requests;
-        requests.setMainFd(STDOUT_FILENO);
-
-        CaptureStdout();
-        ASSERT_EQ(NO_ERROR, buffer.write(&requests));
-        EXPECT_THAT(GetCapturedStdout(), StrEq(expected));
+        int i=0;
+        FdBuffer::iterator it = buffer.begin();
+        while (expected[i] != '\0') {
+            ASSERT_EQ(*it, expected[i++]);
+            it++;
+        }
+        ASSERT_EQ(it, buffer.end());
     }
 
     bool DoDataStream(int rFd, int wFd) {
@@ -99,6 +98,16 @@
     EXPECT_TRUE(it.outOfBound());
 }
 
+TEST_F(FdBufferTest, IteratorSnapshot) {
+    FdBuffer::iterator it = buffer.begin();
+    it += 4;
+    FdBuffer::iterator snapshot = it.snapshot();
+    it += 5;
+    EXPECT_TRUE(snapshot != it);
+    EXPECT_EQ(it - snapshot, 5);
+    EXPECT_EQ(snapshot - it, -5);
+}
+
 TEST_F(FdBufferTest, ReadAndIterate) {
     std::string testdata = "FdBuffer test string";
     ASSERT_TRUE(WriteStringToFile(testdata, tf.path, false));
@@ -227,7 +236,7 @@
 TEST_F(FdBufferTest, ReadInStreamMoreThan4MB) {
     const std::string testFile = kTestDataPath + "morethan4MB.txt";
     size_t fourMB = (size_t) 4 * 1024 * 1024;
-    int fd = open(testFile.c_str(), O_RDONLY);
+    int fd = open(testFile.c_str(), O_RDONLY | O_CLOEXEC);
     ASSERT_NE(fd, -1);
     int pid = fork();
     ASSERT_TRUE(pid != -1);
diff --git a/cmds/incidentd/tests/Reporter_test.cpp b/cmds/incidentd/tests/Reporter_test.cpp
index a774741..5d074bc 100644
--- a/cmds/incidentd/tests/Reporter_test.cpp
+++ b/cmds/incidentd/tests/Reporter_test.cpp
@@ -76,8 +76,7 @@
     };
 
 protected:
-    IBinder* onAsBinder() override { return nullptr; };
-
+    virtual IBinder* onAsBinder() override { return nullptr; };
 };
 
 class ReporterTest : public Test {
@@ -127,29 +126,7 @@
 
 TEST_F(ReporterTest, ReportRequestSetEmpty) {
     requests.setMainFd(STDOUT_FILENO);
-
-    CaptureStdout();
-    requests.write((uint8_t *) "abcdef", 6);
-    EXPECT_THAT(GetCapturedStdout(), StrEq("abcdef"));
-}
-
-TEST_F(ReporterTest, WriteToStreamFdAndMainFd) {
-    TemporaryFile tf;
-    IncidentReportArgs args;
-    sp<ReportRequest> r = new ReportRequest(args, l, tf.fd);
-
-    requests.add(r);
-    requests.setMainFd(STDOUT_FILENO);
-
-    const char* data = "abcdef";
-
-    CaptureStdout();
-    requests.write((uint8_t *) data, 6);
-    EXPECT_THAT(GetCapturedStdout(), StrEq(data));
-
-    string content;
-    ASSERT_TRUE(ReadFileToString(tf.path, &content));
-    EXPECT_THAT(content, StrEq(data));
+    ASSERT_EQ(requests.mainFd(), STDOUT_FILENO);
 }
 
 TEST_F(ReporterTest, RunReportEmpty) {
diff --git a/cmds/incidentd/tests/Section_test.cpp b/cmds/incidentd/tests/Section_test.cpp
index 93771ff..25b05b2 100644
--- a/cmds/incidentd/tests/Section_test.cpp
+++ b/cmds/incidentd/tests/Section_test.cpp
@@ -22,31 +22,80 @@
 #include <gtest/gtest.h>
 #include <string.h>
 
+const int TIMEOUT_PARSER = -1;
+const int NOOP_PARSER = 0;
+const int REVERSE_PARSER = 1;
+
 const int QUICK_TIMEOUT_MS = 100;
 
+const string VARINT_FIELD_1 = "\x08\x96\x01"; // 150
+const string STRING_FIELD_2 = "\x12\vwhatthefuck";
+const string FIX64_FIELD_3 = "\x19\xff\xff\xff\xff\xff\xff\xff\xff"; // -1
+
 using namespace android::base;
+using namespace android::binder;
 using namespace std;
 using ::testing::StrEq;
 using ::testing::internal::CaptureStdout;
 using ::testing::internal::GetCapturedStdout;
 
 // NOTICE: this test requires /system/bin/incident_helper is installed.
-TEST(SectionTest, WriteHeader) {
-    int id = 13; // expect output is 13 << 3 & 2 = 106 --> \x6a in ASCII
-    FileSection s(id, ""); // ignore the path, just used to test the header
+
+class SimpleListener : public IIncidentReportStatusListener
+{
+public:
+    SimpleListener() {};
+    virtual ~SimpleListener() {};
+
+    virtual Status onReportStarted() { return Status::ok(); };
+    virtual Status onReportSectionStatus(int /*section*/, int /*status*/) { return Status::ok(); };
+    virtual Status onReportFinished() { return Status::ok(); };
+    virtual Status onReportFailed() { return Status::ok(); };
+
+protected:
+    virtual IBinder* onAsBinder() override { return nullptr; };
+};
+
+TEST(SectionTest, HeaderSection) {
+    TemporaryFile output2;
+    HeaderSection hs;
     ReportRequestSet requests;
 
+    IncidentReportArgs args1, args2;
+    args1.addSection(1);
+    args1.addSection(2);
+    args2.setAll(true);
+
+    vector<int8_t> head1;
+    head1.push_back('a');
+    head1.push_back('x');
+    head1.push_back('e');
+
+    vector<int8_t> head2;
+    head2.push_back('p');
+    head2.push_back('u');
+    head2.push_back('p');
+
+    args1.addHeader(head1);
+    args1.addHeader(head2);
+    args2.addHeader(head2);
+
+    requests.add(new ReportRequest(args1, new SimpleListener(), -1));
+    requests.add(new ReportRequest(args2, new SimpleListener(), output2.fd));
     requests.setMainFd(STDOUT_FILENO);
 
+    string content;
     CaptureStdout();
-    ASSERT_EQ(NO_ERROR, s.WriteHeader(&requests, 300));
-    // According to protobuf encoding, 300 is "1010 1100 0000 0010" -> \xac \x02
-    EXPECT_THAT(GetCapturedStdout(), StrEq("\x6a\xac\x02"));
+    ASSERT_EQ(NO_ERROR, hs.Execute(&requests));
+    EXPECT_THAT(GetCapturedStdout(), StrEq("\n\x3" "axe\n\x03pup"));
+
+    EXPECT_TRUE(ReadFileToString(output2.path, &content));
+    EXPECT_THAT(content, StrEq("\n\x03pup"));
 }
 
 TEST(SectionTest, FileSection) {
     TemporaryFile tf;
-    FileSection fs(0, tf.path);
+    FileSection fs(REVERSE_PARSER, tf.path);
     ReportRequestSet requests;
 
     ASSERT_TRUE(tf.fd != -1);
@@ -58,13 +107,13 @@
     ASSERT_EQ(NO_ERROR, fs.Execute(&requests));
     // The input string is reversed in incident helper
     // The length is 11, in 128Varint it is "0000 1011" -> \v
-    EXPECT_THAT(GetCapturedStdout(), StrEq("\x02\vatadtsetmai"));
+    EXPECT_THAT(GetCapturedStdout(), StrEq("\xa\vatadtsetmai"));
 }
 
 TEST(SectionTest, FileSectionTimeout) {
     TemporaryFile tf;
     // id -1 is timeout parser
-    FileSection fs(-1, tf.path, QUICK_TIMEOUT_MS);
+    FileSection fs(TIMEOUT_PARSER, tf.path, QUICK_TIMEOUT_MS);
     ReportRequestSet requests;
     ASSERT_EQ(NO_ERROR, fs.Execute(&requests));
 }
@@ -84,36 +133,165 @@
 }
 
 TEST(SectionTest, CommandSectionEcho) {
-    CommandSection cs(0, "/system/bin/echo", "about", NULL);
+    CommandSection cs(REVERSE_PARSER, "/system/bin/echo", "about", NULL);
     ReportRequestSet requests;
     requests.setMainFd(STDOUT_FILENO);
     CaptureStdout();
     ASSERT_EQ(NO_ERROR, cs.Execute(&requests));
-    EXPECT_THAT(GetCapturedStdout(), StrEq("\x02\x06\ntuoba"));
+    EXPECT_THAT(GetCapturedStdout(), StrEq("\xa\x06\ntuoba"));
 }
 
 TEST(SectionTest, CommandSectionCommandTimeout) {
-    CommandSection cs(0, QUICK_TIMEOUT_MS, "/system/bin/yes", NULL);
+    CommandSection cs(NOOP_PARSER, QUICK_TIMEOUT_MS, "/system/bin/yes", NULL);
     ReportRequestSet requests;
     ASSERT_EQ(NO_ERROR, cs.Execute(&requests));
 }
 
 TEST(SectionTest, CommandSectionIncidentHelperTimeout) {
-    CommandSection cs(-1, QUICK_TIMEOUT_MS, "/system/bin/echo", "about", NULL);
+    CommandSection cs(TIMEOUT_PARSER, QUICK_TIMEOUT_MS, "/system/bin/echo", "about", NULL);
     ReportRequestSet requests;
     requests.setMainFd(STDOUT_FILENO);
     ASSERT_EQ(NO_ERROR, cs.Execute(&requests));
 }
 
 TEST(SectionTest, CommandSectionBadCommand) {
-    CommandSection cs(0, "echo", "about", NULL);
+    CommandSection cs(NOOP_PARSER, "echo", "about", NULL);
     ReportRequestSet requests;
     ASSERT_EQ(NAME_NOT_FOUND, cs.Execute(&requests));
 }
 
 TEST(SectionTest, CommandSectionBadCommandAndTimeout) {
-    CommandSection cs(-1, QUICK_TIMEOUT_MS, "nonexistcommand", "-opt", NULL);
+    CommandSection cs(TIMEOUT_PARSER, QUICK_TIMEOUT_MS, "nonexistcommand", "-opt", NULL);
     ReportRequestSet requests;
     // timeout will return first
     ASSERT_EQ(NO_ERROR, cs.Execute(&requests));
+}
+
+TEST(SectionTest, TestFilterPiiTaggedFields) {
+    TemporaryFile tf;
+    FileSection fs(NOOP_PARSER, tf.path);
+    ReportRequestSet requests;
+
+    ASSERT_TRUE(tf.fd != -1);
+    ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, tf.path, false));
+
+    requests.setMainFd(STDOUT_FILENO);
+
+    CaptureStdout();
+    ASSERT_EQ(NO_ERROR, fs.Execute(&requests));
+    EXPECT_THAT(GetCapturedStdout(), StrEq("\x02\r" + STRING_FIELD_2));
+}
+
+TEST(SectionTest, TestBadFdRequest) {
+    TemporaryFile input;
+    FileSection fs(NOOP_PARSER, input.path);
+    ReportRequestSet requests;
+    ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path, false));
+
+    IncidentReportArgs args;
+    args.setAll(true);
+    args.setDest(0);
+    sp<ReportRequest> badFdRequest = new ReportRequest(args, new SimpleListener(), 1234567);
+    requests.add(badFdRequest);
+    requests.setMainFd(STDOUT_FILENO);
+
+    CaptureStdout();
+    ASSERT_EQ(NO_ERROR, fs.Execute(&requests));
+    EXPECT_THAT(GetCapturedStdout(), StrEq("\x02\r" + STRING_FIELD_2));
+    EXPECT_EQ(badFdRequest->err, -EBADF);
+}
+
+TEST(SectionTest, TestBadRequests) {
+    TemporaryFile input;
+    FileSection fs(NOOP_PARSER, input.path);
+    ReportRequestSet requests;
+    ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path, false));
+
+    IncidentReportArgs args;
+    args.setAll(true);
+    args.setDest(0);
+    requests.add(new ReportRequest(args, new SimpleListener(), -1));
+    EXPECT_EQ(fs.Execute(&requests), -EBADF);
+}
+
+TEST(SectionTest, TestMultipleRequests) {
+    TemporaryFile input, output1, output2, output3;
+    FileSection fs(NOOP_PARSER, input.path);
+    ReportRequestSet requests;
+
+    ASSERT_TRUE(input.fd != -1);
+    ASSERT_TRUE(output1.fd != -1);
+    ASSERT_TRUE(output2.fd != -1);
+    ASSERT_TRUE(output3.fd != -1);
+    ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path, false));
+
+    IncidentReportArgs args1, args2, args3;
+    args1.setAll(true);
+    args1.setDest(0); // LOCAL
+    args2.setAll(true); // default to explicit
+    sp<SimpleListener> l = new SimpleListener();
+    requests.add(new ReportRequest(args1, l, output1.fd));
+    requests.add(new ReportRequest(args2, l, output2.fd));
+    requests.add(new ReportRequest(args3, l, output3.fd));
+    requests.setMainFd(STDOUT_FILENO);
+
+    CaptureStdout();
+    ASSERT_EQ(NO_ERROR, fs.Execute(&requests));
+    EXPECT_THAT(GetCapturedStdout(), StrEq("\x02\r" + STRING_FIELD_2));
+
+    string content, expect;
+    expect = VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3;
+    char c = (char) expect.size();
+    EXPECT_TRUE(ReadFileToString(output1.path, &content));
+    EXPECT_THAT(content, StrEq(string("\x02") + c + expect));
+
+    expect = STRING_FIELD_2 + FIX64_FIELD_3;
+    c = (char) expect.size();
+    EXPECT_TRUE(ReadFileToString(output2.path, &content));
+    EXPECT_THAT(content, StrEq(string("\x02") + c + expect));
+
+    // because args3 doesn't set section, so it should receive nothing
+    EXPECT_TRUE(ReadFileToString(output3.path, &content));
+    EXPECT_THAT(content, StrEq(""));
+}
+
+TEST(SectionTest, TestMultipleRequestsBySpec) {
+    TemporaryFile input, output1, output2, output3;
+    FileSection fs(NOOP_PARSER, input.path);
+    ReportRequestSet requests;
+
+    ASSERT_TRUE(input.fd != -1);
+    ASSERT_TRUE(output1.fd != -1);
+    ASSERT_TRUE(output2.fd != -1);
+    ASSERT_TRUE(output3.fd != -1);
+
+    ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path, false));
+
+    IncidentReportArgs args1, args2, args3, args4;
+    args1.setAll(true);
+    args2.setAll(true);
+    args4.setAll(true);
+    sp<SimpleListener> l = new SimpleListener();
+    requests.add(new ReportRequest(args1, l, output1.fd));
+    requests.add(new ReportRequest(args2, l, output2.fd));
+    requests.add(new ReportRequest(args3, l, output3.fd));
+    requests.setMainFd(STDOUT_FILENO);
+
+    CaptureStdout();
+    ASSERT_EQ(NO_ERROR, fs.Execute(&requests));
+    EXPECT_THAT(GetCapturedStdout(), StrEq("\x02\r" + STRING_FIELD_2));
+
+    string content, expect;
+    expect = STRING_FIELD_2 + FIX64_FIELD_3;
+    char c = (char) expect.size();
+
+    // output1 and output2 are the same
+    EXPECT_TRUE(ReadFileToString(output1.path, &content));
+    EXPECT_THAT(content, StrEq(string("\x02") + c + expect));
+    EXPECT_TRUE(ReadFileToString(output2.path, &content));
+    EXPECT_THAT(content, StrEq(string("\x02") + c + expect));
+
+    // because args3 doesn't set section, so it should receive nothing
+    EXPECT_TRUE(ReadFileToString(output3.path, &content));
+    EXPECT_THAT(content, StrEq(""));
 }
\ No newline at end of file
diff --git a/cmds/incidentd/tests/section_list.cpp b/cmds/incidentd/tests/section_list.cpp
index f005335..3722c72 100644
--- a/cmds/incidentd/tests/section_list.cpp
+++ b/cmds/incidentd/tests/section_list.cpp
@@ -4,3 +4,18 @@
 const Section* SECTION_LIST[] = {
     NULL
 };
+
+const uint8_t LOCAL = 0;
+const uint8_t EXPLICIT = 1;
+const uint8_t AUTOMATIC = 2;
+
+const Privacy* list[] = {
+    new Privacy(1, 1, LOCAL),
+    new Privacy(2, AUTOMATIC, (const char**)NULL),
+    NULL };
+
+const Privacy* PRIVACY_POLICY_LIST[] = {
+    new Privacy(0, list),
+    new Privacy(1, 9, AUTOMATIC),
+    NULL
+};
\ No newline at end of file
diff --git a/cmds/interrupter/Android.bp b/cmds/interrupter/Android.bp
new file mode 100644
index 0000000..d68e7fe
--- /dev/null
+++ b/cmds/interrupter/Android.bp
@@ -0,0 +1,11 @@
+cc_library_shared {
+    name: "interrupter",
+    host_supported: true,
+    srcs: ["interrupter.c"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wunused",
+        "-Wunreachable-code",
+    ],
+}
diff --git a/cmds/interrupter/Android.mk b/cmds/interrupter/Android.mk
deleted file mode 100644
index 97a96bf..0000000
--- a/cmds/interrupter/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    interrupter.c
-LOCAL_MODULE := interrupter
-LOCAL_MODULE_TAGS := eng tests
-LOCAL_LDFLAGS := -ldl
-LOCAL_CFLAGS := -Wall -Werror -Wunused -Wunreachable-code
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-    interrupter.c
-LOCAL_MODULE := interrupter
-LOCAL_MODULE_TAGS := eng tests
-LOCAL_LDFLAGS := -ldl
-LOCAL_CFLAGS := -Wall -Werror -Wunused -Wunreachable-code
-
-include $(BUILD_HOST_SHARED_LIBRARY)
diff --git a/cmds/statsd/src/LogReader.cpp b/cmds/statsd/src/LogReader.cpp
index e0ed646..2a9e500 100644
--- a/cmds/statsd/src/LogReader.cpp
+++ b/cmds/statsd/src/LogReader.cpp
@@ -110,7 +110,7 @@
             /* no pid restriction */ 0);
 
     // Open the buffer(s)
-    eventLogger = android_logger_open(loggers, LOG_ID_EVENTS);
+    eventLogger = android_logger_open(loggers, LOG_ID_STATS);
 
     // Read forever
     if (eventLogger) {
diff --git a/config/boot-image-profile.txt b/config/boot-image-profile.txt
index 21f6739..efa5dc9 100644
--- a/config/boot-image-profile.txt
+++ b/config/boot-image-profile.txt
@@ -54831,3 +54831,2098 @@
 Lsun/util/logging/PlatformLogger$1;
 Lsun/util/logging/PlatformLogger$Level;
 Lsun/util/logging/PlatformLogger;
+HPLandroid/accounts/IAccountAuthenticator;->addAccount(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)V
+HPLandroid/accounts/IAccountAuthenticator;->addAccountFromCredentials(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Landroid/os/Bundle;)V
+HPLandroid/accounts/IAccountAuthenticator;->confirmCredentials(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Landroid/os/Bundle;)V
+HPLandroid/accounts/IAccountAuthenticator;->editProperties(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;)V
+HPLandroid/accounts/IAccountAuthenticator;->finishSession(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;Landroid/os/Bundle;)V
+HPLandroid/accounts/IAccountAuthenticator;->getAccountCredentialsForCloning(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;)V
+HPLandroid/accounts/IAccountAuthenticator;->getAccountRemovalAllowed(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;)V
+HPLandroid/accounts/IAccountAuthenticator;->getAuthToken(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)V
+HPLandroid/accounts/IAccountAuthenticator;->getAuthTokenLabel(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;)V
+HPLandroid/accounts/IAccountAuthenticator;->hasFeatures(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;[Ljava/lang/String;)V
+HPLandroid/accounts/IAccountAuthenticator;->isCredentialsUpdateSuggested(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Ljava/lang/String;)V
+HPLandroid/accounts/IAccountAuthenticator;->startAddAccountSession(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)V
+HPLandroid/accounts/IAccountAuthenticator;->startUpdateCredentialsSession(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)V
+HPLandroid/accounts/IAccountAuthenticator;->updateCredentials(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)V
+HPLandroid/accounts/IAccountAuthenticatorResponse;->onError(ILjava/lang/String;)V
+HPLandroid/accounts/IAccountAuthenticatorResponse;->onRequestContinued()V
+HPLandroid/app/IInstantAppResolver;->getInstantAppIntentFilterList([ILjava/lang/String;Ljava/lang/String;Landroid/os/IRemoteCallback;)V
+HPLandroid/app/IInstantAppResolver;->getInstantAppResolveInfoList([ILjava/lang/String;ILandroid/os/IRemoteCallback;)V
+HPLandroid/app/IProcessObserver;->onForegroundActivitiesChanged(IIZ)V
+HPLandroid/app/IProcessObserver;->onProcessDied(II)V
+HPLandroid/app/Notification;->getNotificationStyleClass(Ljava/lang/String;)Ljava/lang/Class;
+HPLandroid/app/WindowConfiguration;->hasWindowShadow()Z
+HPLandroid/app/backup/BackupHelper;->performBackup(Landroid/os/ParcelFileDescriptor;Landroid/app/backup/BackupDataOutput;Landroid/os/ParcelFileDescriptor;)V
+HPLandroid/app/backup/BackupHelper;->restoreEntity(Landroid/app/backup/BackupDataInputStream;)V
+HPLandroid/app/backup/BackupHelper;->writeNewStateDescription(Landroid/os/ParcelFileDescriptor;)V
+HPLandroid/app/backup/ISelectBackupTransportCallback;->onFailure(I)V
+HPLandroid/app/backup/ISelectBackupTransportCallback;->onSuccess(Ljava/lang/String;)V
+HPLandroid/app/usage/ICacheQuotaService;->computeCacheQuotaHints(Landroid/os/RemoteCallback;Ljava/util/List;)V
+HPLandroid/content/pm/IOnAppsChangedListener;->onPackageAdded(Landroid/os/UserHandle;Ljava/lang/String;)V
+HPLandroid/content/pm/IOnAppsChangedListener;->onPackageChanged(Landroid/os/UserHandle;Ljava/lang/String;)V
+HPLandroid/content/pm/IOnAppsChangedListener;->onPackageRemoved(Landroid/os/UserHandle;Ljava/lang/String;)V
+HPLandroid/content/pm/IOnAppsChangedListener;->onPackagesAvailable(Landroid/os/UserHandle;[Ljava/lang/String;Z)V
+HPLandroid/content/pm/IOnAppsChangedListener;->onPackagesSuspended(Landroid/os/UserHandle;[Ljava/lang/String;)V
+HPLandroid/content/pm/IOnAppsChangedListener;->onPackagesUnavailable(Landroid/os/UserHandle;[Ljava/lang/String;Z)V
+HPLandroid/content/pm/IOnAppsChangedListener;->onPackagesUnsuspended(Landroid/os/UserHandle;[Ljava/lang/String;)V
+HPLandroid/content/pm/IOnAppsChangedListener;->onShortcutChanged(Landroid/os/UserHandle;Ljava/lang/String;Landroid/content/pm/ParceledListSlice;)V
+HPLandroid/content/pm/IPackageInstallerCallback;->onSessionActiveChanged(IZ)V
+HPLandroid/content/pm/IPackageInstallerCallback;->onSessionBadgingChanged(I)V
+HPLandroid/content/pm/IPackageInstallerCallback;->onSessionCreated(I)V
+HPLandroid/content/pm/IPackageInstallerCallback;->onSessionFinished(IZ)V
+HPLandroid/content/pm/IPackageInstallerCallback;->onSessionProgressChanged(IF)V
+HPLandroid/content/pm/IPackageInstallerSession;->abandon()V
+HPLandroid/content/pm/IPackageInstallerSession;->addClientProgress(F)V
+HPLandroid/content/pm/IPackageInstallerSession;->close()V
+HPLandroid/content/pm/IPackageInstallerSession;->commit(Landroid/content/IntentSender;Z)V
+HPLandroid/content/pm/IPackageInstallerSession;->getNames()[Ljava/lang/String;
+HPLandroid/content/pm/IPackageInstallerSession;->openRead(Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
+HPLandroid/content/pm/IPackageInstallerSession;->openWrite(Ljava/lang/String;JJ)Landroid/os/ParcelFileDescriptor;
+HPLandroid/content/pm/IPackageInstallerSession;->removeSplit(Ljava/lang/String;)V
+HPLandroid/content/pm/IPackageInstallerSession;->setClientProgress(F)V
+HPLandroid/content/pm/IPackageInstallerSession;->transfer(Ljava/lang/String;)V
+HPLandroid/content/pm/PackageParser;->loadCertificates(Landroid/util/jar/StrictJarFile;Ljava/util/zip/ZipEntry;)[[Ljava/security/cert/Certificate;
+HPLandroid/content/pm/PackageParser;->readFullyIgnoringContents(Ljava/io/InputStream;)J
+HPLandroid/content/pm/split/SplitAssetLoader;->getBaseAssetManager()Landroid/content/res/AssetManager;
+HPLandroid/content/pm/split/SplitAssetLoader;->getSplitAssetManager(I)Landroid/content/res/AssetManager;
+HPLandroid/graphics/LeakyTypefaceStorage;->writeTypefaceToParcel(Landroid/graphics/Typeface;Landroid/os/Parcel;)V
+HPLandroid/hardware/location/IActivityRecognitionHardwareClient;->onAvailabilityChanged(ZLandroid/hardware/location/IActivityRecognitionHardware;)V
+HPLandroid/hardware/location/IContextHubCallback;->onMessageReceipt(IILandroid/hardware/location/ContextHubMessage;)V
+HPLandroid/hardware/location/IGeofenceHardwareMonitorCallback;->onMonitoringSystemChange(Landroid/hardware/location/GeofenceHardwareMonitorEvent;)V
+HPLandroid/location/IGeofenceProvider;->setGeofenceHardware(Landroid/hardware/location/IGeofenceHardware;)V
+HPLandroid/net/INetworkRecommendationProvider;->requestScores([Landroid/net/NetworkKey;)V
+HPLandroid/os/FileUtils$1;->compare(Ljava/io/File;Ljava/io/File;)I
+HPLandroid/os/FileUtils$1;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
+HPLandroid/os/ShellCommand;->onCommand(Ljava/lang/String;)I
+HPLandroid/os/ShellCommand;->onHelp()V
+HPLandroid/print/IPrintSpooler;->clearCustomPrinterIconCache(Landroid/print/IPrintSpoolerCallbacks;I)V
+HPLandroid/print/IPrintSpooler;->createPrintJob(Landroid/print/PrintJobInfo;)V
+HPLandroid/print/IPrintSpooler;->getCustomPrinterIcon(Landroid/print/PrinterId;Landroid/print/IPrintSpoolerCallbacks;I)V
+HPLandroid/print/IPrintSpooler;->getPrintJobInfo(Landroid/print/PrintJobId;Landroid/print/IPrintSpoolerCallbacks;II)V
+HPLandroid/print/IPrintSpooler;->getPrintJobInfos(Landroid/print/IPrintSpoolerCallbacks;Landroid/content/ComponentName;III)V
+HPLandroid/print/IPrintSpooler;->onCustomPrinterIconLoaded(Landroid/print/PrinterId;Landroid/graphics/drawable/Icon;Landroid/print/IPrintSpoolerCallbacks;I)V
+HPLandroid/print/IPrintSpooler;->pruneApprovedPrintServices(Ljava/util/List;)V
+HPLandroid/print/IPrintSpooler;->removeObsoletePrintJobs()V
+HPLandroid/print/IPrintSpooler;->setClient(Landroid/print/IPrintSpoolerClient;)V
+HPLandroid/print/IPrintSpooler;->setPrintJobCancelling(Landroid/print/PrintJobId;Z)V
+HPLandroid/print/IPrintSpooler;->setPrintJobState(Landroid/print/PrintJobId;ILjava/lang/String;Landroid/print/IPrintSpoolerCallbacks;I)V
+HPLandroid/print/IPrintSpooler;->setPrintJobTag(Landroid/print/PrintJobId;Ljava/lang/String;Landroid/print/IPrintSpoolerCallbacks;I)V
+HPLandroid/print/IPrintSpooler;->setProgress(Landroid/print/PrintJobId;F)V
+HPLandroid/print/IPrintSpooler;->setStatus(Landroid/print/PrintJobId;Ljava/lang/CharSequence;)V
+HPLandroid/print/IPrintSpooler;->setStatusRes(Landroid/print/PrintJobId;ILjava/lang/CharSequence;)V
+HPLandroid/print/IPrintSpooler;->writePrintJobData(Landroid/os/ParcelFileDescriptor;Landroid/print/PrintJobId;)V
+HPLandroid/print/IPrintSpoolerCallbacks;->onCancelPrintJobResult(ZI)V
+HPLandroid/print/IPrintSpoolerClient;->onAllPrintJobsForServiceHandled(Landroid/content/ComponentName;)V
+HPLandroid/print/IPrintSpoolerClient;->onAllPrintJobsHandled()V
+HPLandroid/print/IPrintSpoolerClient;->onPrintJobQueued(Landroid/print/PrintJobInfo;)V
+HPLandroid/print/IPrintSpoolerClient;->onPrintJobStateChanged(Landroid/print/PrintJobInfo;)V
+HPLandroid/printservice/IPrintServiceClient;->getPrintJobInfo(Landroid/print/PrintJobId;)Landroid/print/PrintJobInfo;
+HPLandroid/printservice/IPrintServiceClient;->getPrintJobInfos()Ljava/util/List;
+HPLandroid/printservice/IPrintServiceClient;->onCustomPrinterIconLoaded(Landroid/print/PrinterId;Landroid/graphics/drawable/Icon;)V
+HPLandroid/printservice/IPrintServiceClient;->onPrintersAdded(Landroid/content/pm/ParceledListSlice;)V
+HPLandroid/printservice/IPrintServiceClient;->onPrintersRemoved(Landroid/content/pm/ParceledListSlice;)V
+HPLandroid/printservice/IPrintServiceClient;->setPrintJobState(Landroid/print/PrintJobId;ILjava/lang/String;)Z
+HPLandroid/printservice/IPrintServiceClient;->setPrintJobTag(Landroid/print/PrintJobId;Ljava/lang/String;)Z
+HPLandroid/printservice/IPrintServiceClient;->setProgress(Landroid/print/PrintJobId;F)V
+HPLandroid/printservice/IPrintServiceClient;->setStatus(Landroid/print/PrintJobId;Ljava/lang/CharSequence;)V
+HPLandroid/printservice/IPrintServiceClient;->setStatusRes(Landroid/print/PrintJobId;ILjava/lang/CharSequence;)V
+HPLandroid/printservice/IPrintServiceClient;->writePrintJobData(Landroid/os/ParcelFileDescriptor;Landroid/print/PrintJobId;)V
+HPLandroid/security/IKeyChainService;->containsCaAlias(Ljava/lang/String;)Z
+HPLandroid/security/IKeyChainService;->deleteCaCertificate(Ljava/lang/String;)Z
+HPLandroid/security/IKeyChainService;->getCaCertificateChainAliases(Ljava/lang/String;Z)Ljava/util/List;
+HPLandroid/security/IKeyChainService;->getCaCertificates(Ljava/lang/String;)[B
+HPLandroid/security/IKeyChainService;->getCertificate(Ljava/lang/String;)[B
+HPLandroid/security/IKeyChainService;->getEncodedCaCertificate(Ljava/lang/String;Z)[B
+HPLandroid/security/IKeyChainService;->getSystemCaAliases()Landroid/content/pm/StringParceledListSlice;
+HPLandroid/security/IKeyChainService;->getUserCaAliases()Landroid/content/pm/StringParceledListSlice;
+HPLandroid/security/IKeyChainService;->hasGrant(ILjava/lang/String;)Z
+HPLandroid/security/IKeyChainService;->installCaCertificate([B)Ljava/lang/String;
+HPLandroid/security/IKeyChainService;->installKeyPair([B[B[BLjava/lang/String;)Z
+HPLandroid/security/IKeyChainService;->removeKeyPair(Ljava/lang/String;)Z
+HPLandroid/security/IKeyChainService;->requestPrivateKey(Ljava/lang/String;)Ljava/lang/String;
+HPLandroid/security/IKeyChainService;->reset()Z
+HPLandroid/security/IKeyChainService;->setGrant(ILjava/lang/String;Z)V
+HPLandroid/service/voice/IVoiceInteractionService;->launchVoiceAssistFromKeyguard()V
+HPLandroid/service/voice/IVoiceInteractionService;->ready()V
+HPLandroid/service/voice/IVoiceInteractionService;->shutdown()V
+HPLandroid/service/voice/IVoiceInteractionService;->soundModelsChanged()V
+HPLandroid/system/Os;->lseek(Ljava/io/FileDescriptor;JI)J
+HPLandroid/text/style/TextAppearanceSpan;->writeToParcelInternal(Landroid/os/Parcel;I)V
+HPLandroid/util/jar/StrictJarFile$EntryIterator;->hasNext()Z
+HPLandroid/util/jar/StrictJarFile$EntryIterator;->next()Ljava/lang/Object;
+HPLandroid/util/jar/StrictJarFile$EntryIterator;->next()Ljava/util/zip/ZipEntry;
+HPLandroid/util/jar/StrictJarFile$FDStream;-><init>(Ljava/io/FileDescriptor;JJ)V
+HPLandroid/util/jar/StrictJarFile$FDStream;->read([BII)I
+HPLandroid/util/jar/StrictJarFile$JarFileInputStream;-><init>(Ljava/io/InputStream;JLandroid/util/jar/StrictJarVerifier$VerifierEntry;)V
+HPLandroid/util/jar/StrictJarFile$JarFileInputStream;->read([BII)I
+HPLandroid/util/jar/StrictJarFile$ZipInflaterInputStream;-><init>(Ljava/io/InputStream;Ljava/util/zip/Inflater;ILjava/util/zip/ZipEntry;)V
+HPLandroid/util/jar/StrictJarFile$ZipInflaterInputStream;->read([BII)I
+HPLandroid/util/jar/StrictJarFile;->access$100(J)Ljava/util/zip/ZipEntry;
+HPLandroid/util/jar/StrictJarFile;->getCertificateChains(Ljava/util/zip/ZipEntry;)[[Ljava/security/cert/Certificate;
+HPLandroid/util/jar/StrictJarFile;->getInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
+HPLandroid/util/jar/StrictJarFile;->getZipInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
+HPLandroid/util/jar/StrictJarManifest$Chunk;-><init>(II)V
+HPLandroid/util/jar/StrictJarManifest;->getAttributes(Ljava/lang/String;)Ljava/util/jar/Attributes;
+HPLandroid/util/jar/StrictJarManifest;->getEntries()Ljava/util/Map;
+HPLandroid/util/jar/StrictJarManifestReader;->readEntries(Ljava/util/Map;Ljava/util/Map;)V
+HPLandroid/util/jar/StrictJarManifestReader;->readHeader()Z
+HPLandroid/util/jar/StrictJarManifestReader;->readName()V
+HPLandroid/util/jar/StrictJarManifestReader;->readValue()V
+HPLandroid/util/jar/StrictJarVerifier$VerifierEntry;-><init>(Ljava/lang/String;Ljava/security/MessageDigest;[B[[Ljava/security/cert/Certificate;Ljava/util/Hashtable;)V
+HPLandroid/util/jar/StrictJarVerifier$VerifierEntry;->verify()V
+HPLandroid/util/jar/StrictJarVerifier$VerifierEntry;->write([BII)V
+HPLandroid/util/jar/StrictJarVerifier;->access$000([B[B)Z
+HPLandroid/util/jar/StrictJarVerifier;->getCertificateChains(Ljava/lang/String;)[[Ljava/security/cert/Certificate;
+HPLandroid/util/jar/StrictJarVerifier;->initEntry(Ljava/lang/String;)Landroid/util/jar/StrictJarVerifier$VerifierEntry;
+HPLandroid/util/jar/StrictJarVerifier;->verifyMessageDigest([B[B)Z
+HPLandroid/view/WindowManagerPolicy$StartingSurface;->remove()V
+HPLcom/android/internal/app/IMediaContainerService;->calculateInstalledSize(Ljava/lang/String;ZLjava/lang/String;)J
+HPLcom/android/internal/app/IMediaContainerService;->clearDirectory(Ljava/lang/String;)V
+HPLcom/android/internal/app/IMediaContainerService;->copyPackage(Ljava/lang/String;Lcom/android/internal/os/IParcelFileDescriptorFactory;)I
+HPLcom/android/internal/app/IMediaContainerService;->copyPackageToContainer(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZLjava/lang/String;)Ljava/lang/String;
+HPLcom/android/internal/app/IMediaContainerService;->getMinimalPackageInfo(Ljava/lang/String;ILjava/lang/String;)Landroid/content/pm/PackageInfoLite;
+HPLcom/android/internal/app/IMediaContainerService;->getObbInfo(Ljava/lang/String;)Landroid/content/res/ObbInfo;
+HPLcom/android/internal/app/procstats/DumpUtils;->collapseString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+HPLcom/android/internal/app/procstats/DumpUtils;->printAdjTag(Ljava/io/PrintWriter;I)V
+HPLcom/android/internal/app/procstats/DumpUtils;->printAdjTagAndValue(Ljava/io/PrintWriter;IJ)V
+HPLcom/android/internal/app/procstats/DumpUtils;->printArrayEntry(Ljava/io/PrintWriter;[Ljava/lang/String;II)I
+HPLcom/android/internal/app/procstats/DumpUtils;->printProcStateTag(Ljava/io/PrintWriter;I)V
+HPLcom/android/internal/app/procstats/DumpUtils;->printProcStateTagAndValue(Ljava/io/PrintWriter;IJ)V
+HPLcom/android/internal/app/procstats/ProcessState$PssAggr;-><init>()V
+HPLcom/android/internal/app/procstats/ProcessState;->aggregatePss(Lcom/android/internal/app/procstats/ProcessStats$TotalMemoryUseCollection;J)V
+HPLcom/android/internal/app/procstats/ProcessState;->dumpAllPssCheckin(Ljava/io/PrintWriter;)V
+HPLcom/android/internal/app/procstats/ProcessState;->dumpAllStateCheckin(Ljava/io/PrintWriter;J)V
+HPLcom/android/internal/app/procstats/ProcessState;->dumpPackageProcCheckin(Ljava/io/PrintWriter;Ljava/lang/String;IILjava/lang/String;J)V
+HPLcom/android/internal/app/procstats/ProcessState;->dumpProcCheckin(Ljava/io/PrintWriter;Ljava/lang/String;IJ)V
+HPLcom/android/internal/app/procstats/ProcessState;->getPssSampleCount(I)J
+HPLcom/android/internal/app/procstats/ProcessState;->readFromParcel(Landroid/os/Parcel;Z)Z
+HPLcom/android/internal/app/procstats/ProcessStats;->computeTotalMemoryUse(Lcom/android/internal/app/procstats/ProcessStats$TotalMemoryUseCollection;J)V
+HPLcom/android/internal/app/procstats/ProcessStats;->dumpCheckinLocked(Ljava/io/PrintWriter;Ljava/lang/String;)V
+HPLcom/android/internal/app/procstats/ProcessStats;->readCommonString(Landroid/os/Parcel;I)Ljava/lang/String;
+HPLcom/android/internal/app/procstats/ProcessStats;->readFromParcel(Landroid/os/Parcel;)V
+HPLcom/android/internal/app/procstats/ServiceState;->dumpTimeCheckin(Ljava/io/PrintWriter;Ljava/lang/String;Ljava/lang/String;IILjava/lang/String;IIIJJ)V
+HPLcom/android/internal/app/procstats/ServiceState;->readFromParcel(Landroid/os/Parcel;)Z
+HPLcom/android/internal/app/procstats/SparseMappingTable$Table;->getValueForId(BI)J
+HPLcom/android/internal/app/procstats/SparseMappingTable$Table;->readFromParcel(Landroid/os/Parcel;)Z
+HPLcom/android/internal/app/procstats/SparseMappingTable$Table;->validateKeys(Z)Z
+HPLcom/android/internal/app/procstats/SparseMappingTable;->access$100(Lcom/android/internal/app/procstats/SparseMappingTable;)Ljava/util/ArrayList;
+HPLcom/android/internal/app/procstats/SparseMappingTable;->readCompactedLongArray(Landroid/os/Parcel;[JI)V
+HPLcom/android/internal/appwidget/IAppWidgetHost;->providerChanged(ILandroid/appwidget/AppWidgetProviderInfo;)V
+HPLcom/android/internal/appwidget/IAppWidgetHost;->providersChanged()V
+HPLcom/android/internal/appwidget/IAppWidgetHost;->updateAppWidget(ILandroid/widget/RemoteViews;)V
+HPLcom/android/internal/appwidget/IAppWidgetHost;->viewDataChanged(II)V
+HPLcom/android/internal/backup/IBackupTransport;->abortFullRestore()I
+HPLcom/android/internal/backup/IBackupTransport;->cancelFullBackup()V
+HPLcom/android/internal/backup/IBackupTransport;->checkFullBackupSize(J)I
+HPLcom/android/internal/backup/IBackupTransport;->clearBackupData(Landroid/content/pm/PackageInfo;)I
+HPLcom/android/internal/backup/IBackupTransport;->configurationIntent()Landroid/content/Intent;
+HPLcom/android/internal/backup/IBackupTransport;->currentDestinationString()Ljava/lang/String;
+HPLcom/android/internal/backup/IBackupTransport;->dataManagementIntent()Landroid/content/Intent;
+HPLcom/android/internal/backup/IBackupTransport;->dataManagementLabel()Ljava/lang/String;
+HPLcom/android/internal/backup/IBackupTransport;->finishBackup()I
+HPLcom/android/internal/backup/IBackupTransport;->finishRestore()V
+HPLcom/android/internal/backup/IBackupTransport;->getAvailableRestoreSets()[Landroid/app/backup/RestoreSet;
+HPLcom/android/internal/backup/IBackupTransport;->getBackupQuota(Ljava/lang/String;Z)J
+HPLcom/android/internal/backup/IBackupTransport;->getCurrentRestoreSet()J
+HPLcom/android/internal/backup/IBackupTransport;->getNextFullRestoreDataChunk(Landroid/os/ParcelFileDescriptor;)I
+HPLcom/android/internal/backup/IBackupTransport;->getRestoreData(Landroid/os/ParcelFileDescriptor;)I
+HPLcom/android/internal/backup/IBackupTransport;->initializeDevice()I
+HPLcom/android/internal/backup/IBackupTransport;->isAppEligibleForBackup(Landroid/content/pm/PackageInfo;Z)Z
+HPLcom/android/internal/backup/IBackupTransport;->name()Ljava/lang/String;
+HPLcom/android/internal/backup/IBackupTransport;->nextRestorePackage()Landroid/app/backup/RestoreDescription;
+HPLcom/android/internal/backup/IBackupTransport;->performBackup(Landroid/content/pm/PackageInfo;Landroid/os/ParcelFileDescriptor;I)I
+HPLcom/android/internal/backup/IBackupTransport;->performFullBackup(Landroid/content/pm/PackageInfo;Landroid/os/ParcelFileDescriptor;I)I
+HPLcom/android/internal/backup/IBackupTransport;->requestBackupTime()J
+HPLcom/android/internal/backup/IBackupTransport;->requestFullBackupTime()J
+HPLcom/android/internal/backup/IBackupTransport;->sendBackupData(I)I
+HPLcom/android/internal/backup/IBackupTransport;->startRestore(J[Landroid/content/pm/PackageInfo;)I
+HPLcom/android/internal/backup/IBackupTransport;->transportDirName()Ljava/lang/String;
+HPLcom/android/internal/content/PackageHelper$TestableInterface;->getAllow3rdPartyOnInternalConfig(Landroid/content/Context;)Z
+HPLcom/android/internal/content/PackageHelper$TestableInterface;->getDataDirectory()Ljava/io/File;
+HPLcom/android/internal/content/PackageHelper$TestableInterface;->getExistingAppInfo(Landroid/content/Context;Ljava/lang/String;)Landroid/content/pm/ApplicationInfo;
+HPLcom/android/internal/content/PackageHelper$TestableInterface;->getForceAllowOnExternalSetting(Landroid/content/Context;)Z
+HPLcom/android/internal/content/PackageHelper$TestableInterface;->getStorageManager(Landroid/content/Context;)Landroid/os/storage/StorageManager;
+HPLcom/android/internal/os/BatteryStatsImpl$Uid;->getWifiBatchedScanTime(IJI)J
+HPLcom/android/internal/os/IShellCallback;->openOutputFile(Ljava/lang/String;Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
+HPLcom/android/internal/os/WifiPowerEstimator;->calculateApp(Lcom/android/internal/os/BatterySipper;Landroid/os/BatteryStats$Uid;JJI)V
+HPLcom/android/server/BootReceiver;->addFileWithFootersToDropBox(Landroid/os/DropBoxManager;Ljava/util/HashMap;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V
+HPLjava/util/Base64$Encoder;->encode0([BII[B)I
+HPLjava/util/Base64;->getDecoder()Ljava/util/Base64$Decoder;
+HPLjava/util/HashMap;->comparableClassFor(Ljava/lang/Object;)Ljava/lang/Class;
+HPLjava/util/Hashtable$HashtableEntry;->getValue()Ljava/lang/Object;
+HPLjava/util/concurrent/CompletableFuture$Completion;->isLive()Z
+HPLjava/util/concurrent/CompletableFuture$Completion;->tryFire(I)Ljava/util/concurrent/CompletableFuture;
+HPLjava/util/concurrent/ForkJoinPool$ManagedBlocker;->block()Z
+HPLjava/util/concurrent/ForkJoinPool$ManagedBlocker;->isReleasable()Z
+HPLjava/util/jar/Attributes;->getValue(Ljava/lang/String;)Ljava/lang/String;
+HPLjava/util/zip/ZipEntry;->getCompressedSize()J
+HPLjava/util/zip/ZipEntry;->getDataOffset()J
+HPLlibcore/io/Streams;->readFullyNoClose(Ljava/io/InputStream;)[B
+HPLlibcore/net/http/Dns;->lookup(Ljava/lang/String;)Ljava/util/List;
+HSLandroid/os/IRemoteCallback;->sendResult(Landroid/os/Bundle;)V
+HSLandroid/os/TokenWatcher;->acquired()V
+HSLandroid/os/TokenWatcher;->released()V
+HSLcom/android/internal/os/ProcessCpuTracker$FilterStats;->needed(Lcom/android/internal/os/ProcessCpuTracker$Stats;)Z
+HSLjava/util/stream/AbstractSpinedBuffer;->clear()V
+HSLjava/util/stream/Node$Builder$OfInt;->build()Ljava/util/stream/Node$OfInt;
+HSLjava/util/stream/Node$Builder;->build()Ljava/util/stream/Node;
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->disableSelf()V
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->findAccessibilityNodeInfoByAccessibilityId(IJILandroid/view/accessibility/IAccessibilityInteractionConnectionCallback;IJLandroid/os/Bundle;)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->findAccessibilityNodeInfosByText(IJLjava/lang/String;ILandroid/view/accessibility/IAccessibilityInteractionConnectionCallback;J)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->findAccessibilityNodeInfosByViewId(IJLjava/lang/String;ILandroid/view/accessibility/IAccessibilityInteractionConnectionCallback;J)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->findFocus(IJIILandroid/view/accessibility/IAccessibilityInteractionConnectionCallback;J)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->focusSearch(IJIILandroid/view/accessibility/IAccessibilityInteractionConnectionCallback;J)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->getMagnificationCenterX()F
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->getMagnificationCenterY()F
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->getMagnificationRegion()Landroid/graphics/Region;
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->getMagnificationScale()F
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->getServiceInfo()Landroid/accessibilityservice/AccessibilityServiceInfo;
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->getWindow(I)Landroid/view/accessibility/AccessibilityWindowInfo;
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->getWindows()Ljava/util/List;
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->isAccessibilityButtonAvailable()Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->isFingerprintGestureDetectionAvailable()Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->performAccessibilityAction(IJILandroid/os/Bundle;ILandroid/view/accessibility/IAccessibilityInteractionConnectionCallback;J)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->performGlobalAction(I)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->resetMagnification(Z)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->sendGesture(ILandroid/content/pm/ParceledListSlice;)V
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->setMagnificationCallbackEnabled(Z)V
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->setMagnificationScaleAndCenter(FFFZ)Z
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->setOnKeyEventResult(ZI)V
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->setServiceInfo(Landroid/accessibilityservice/AccessibilityServiceInfo;)V
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->setSoftKeyboardCallbackEnabled(Z)V
+HSPLandroid/accessibilityservice/IAccessibilityServiceConnection;->setSoftKeyboardShowMode(I)Z
+HSPLandroid/accounts/AccountManagerInternal$OnAppPermissionChangeListener;->onAppPermissionChanged(Landroid/accounts/Account;I)V
+HSPLandroid/accounts/AccountManagerInternal;->addOnAppPermissionChangeListener(Landroid/accounts/AccountManagerInternal$OnAppPermissionChangeListener;)V
+HSPLandroid/accounts/AccountManagerInternal;->backupAccountAccessPermissions(I)[B
+HSPLandroid/accounts/AccountManagerInternal;->hasAccountAccess(Landroid/accounts/Account;I)Z
+HSPLandroid/accounts/AccountManagerInternal;->requestAccountAccess(Landroid/accounts/Account;Ljava/lang/String;ILandroid/os/RemoteCallback;)V
+HSPLandroid/accounts/AccountManagerInternal;->restoreAccountAccessPermissions([BI)V
+HSPLandroid/app/ActivityManager$OnUidImportanceListener;->onUidImportance(II)V
+HSPLandroid/app/ActivityManagerInternal$SleepToken;->release()V
+HSPLandroid/app/ActivityManagerInternal;->acquireSleepToken(Ljava/lang/String;I)Landroid/app/ActivityManagerInternal$SleepToken;
+HSPLandroid/app/ActivityManagerInternal;->checkContentProviderAccess(Ljava/lang/String;I)Ljava/lang/String;
+HSPLandroid/app/ActivityManagerInternal;->clearSavedANRState()V
+HSPLandroid/app/ActivityManagerInternal;->getHomeActivityForUser(I)Landroid/content/ComponentName;
+HSPLandroid/app/ActivityManagerInternal;->getTopVisibleActivities()Ljava/util/List;
+HSPLandroid/app/ActivityManagerInternal;->getUidProcessState(I)I
+HSPLandroid/app/ActivityManagerInternal;->grantUriPermissionFromIntent(ILjava/lang/String;Landroid/content/Intent;I)V
+HSPLandroid/app/ActivityManagerInternal;->isSystemReady()Z
+HSPLandroid/app/ActivityManagerInternal;->killForegroundAppsForUser(I)V
+HSPLandroid/app/ActivityManagerInternal;->notifyAppTransitionCancelled()V
+HSPLandroid/app/ActivityManagerInternal;->notifyAppTransitionFinished()V
+HSPLandroid/app/ActivityManagerInternal;->notifyAppTransitionStarting(Landroid/util/SparseIntArray;J)V
+HSPLandroid/app/ActivityManagerInternal;->notifyDockedStackMinimizedChanged(Z)V
+HSPLandroid/app/ActivityManagerInternal;->notifyKeyguardFlagsChanged(Ljava/lang/Runnable;)V
+HSPLandroid/app/ActivityManagerInternal;->notifyKeyguardTrustedChanged()V
+HSPLandroid/app/ActivityManagerInternal;->notifyNetworkPolicyRulesUpdated(IJ)V
+HSPLandroid/app/ActivityManagerInternal;->onLocalVoiceInteractionStarted(Landroid/os/IBinder;Landroid/service/voice/IVoiceInteractionSession;Lcom/android/internal/app/IVoiceInteractor;)V
+HSPLandroid/app/ActivityManagerInternal;->onUserRemoved(I)V
+HSPLandroid/app/ActivityManagerInternal;->onWakefulnessChanged(I)V
+HSPLandroid/app/ActivityManagerInternal;->saveANRState(Ljava/lang/String;)V
+HSPLandroid/app/ActivityManagerInternal;->setDeviceIdleWhitelist([I)V
+HSPLandroid/app/ActivityManagerInternal;->setFocusedActivity(Landroid/os/IBinder;)V
+HSPLandroid/app/ActivityManagerInternal;->setHasOverlayUi(IZ)V
+HSPLandroid/app/ActivityManagerInternal;->setPendingIntentWhitelistDuration(Landroid/content/IIntentSender;Landroid/os/IBinder;J)V
+HSPLandroid/app/ActivityManagerInternal;->setVr2dDisplayId(I)V
+HSPLandroid/app/ActivityManagerInternal;->startActivitiesAsPackage(Ljava/lang/String;I[Landroid/content/Intent;Landroid/os/Bundle;)I
+HSPLandroid/app/ActivityManagerInternal;->startIsolatedProcess(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Runnable;)I
+HSPLandroid/app/ActivityManagerInternal;->updateDeviceIdleTempWhitelist([IIZ)V
+HSPLandroid/app/ActivityManagerInternal;->updatePersistentConfigurationForUser(Landroid/content/res/Configuration;I)V
+HSPLandroid/app/ActivityThread;->access$2300(Landroid/app/ActivityThread;Landroid/app/ActivityThread$CreateServiceData;)V
+HSPLandroid/app/ActivityThread;->access$2400(Landroid/app/ActivityThread;Landroid/app/ActivityThread$BindServiceData;)V
+HSPLandroid/app/ActivityThread;->access$2600(Landroid/app/ActivityThread;Landroid/app/ActivityThread$ServiceArgsData;)V
+HSPLandroid/app/ActivityThread;->access$3400(Landroid/app/ActivityThread;Landroid/os/Bundle;)V
+HSPLandroid/app/IActivityManager$Stub;->onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
+HSPLandroid/app/IAlarmCompleteListener;->alarmComplete(Landroid/os/IBinder;)V
+HSPLandroid/app/IApplicationThread$Stub$Proxy;->runIsolatedEntryPoint(Ljava/lang/String;[Ljava/lang/String;)V
+HSPLandroid/app/ISearchManager;->getGlobalSearchActivities()Ljava/util/List;
+HSPLandroid/app/ISearchManager;->getGlobalSearchActivity()Landroid/content/ComponentName;
+HSPLandroid/app/ISearchManager;->getSearchableInfo(Landroid/content/ComponentName;)Landroid/app/SearchableInfo;
+HSPLandroid/app/ISearchManager;->getSearchablesInGlobalSearch()Ljava/util/List;
+HSPLandroid/app/ISearchManager;->getWebSearchActivity()Landroid/content/ComponentName;
+HSPLandroid/app/ISearchManager;->launchAssist(Landroid/os/Bundle;)V
+HSPLandroid/app/ISearchManager;->launchLegacyAssist(Ljava/lang/String;ILandroid/os/Bundle;)Z
+HSPLandroid/app/ITaskStackListener;->onActivityDismissingDockedStack()V
+HSPLandroid/app/ITaskStackListener;->onActivityForcedResizable(Ljava/lang/String;II)V
+HSPLandroid/app/ITaskStackListener;->onActivityLaunchOnSecondaryDisplayFailed()V
+HSPLandroid/app/ITaskStackListener;->onActivityPinned(Ljava/lang/String;I)V
+HSPLandroid/app/ITaskStackListener;->onActivityRequestedOrientationChanged(II)V
+HSPLandroid/app/ITaskStackListener;->onActivityUnpinned()V
+HSPLandroid/app/ITaskStackListener;->onPinnedActivityRestartAttempt(Z)V
+HSPLandroid/app/ITaskStackListener;->onPinnedStackAnimationEnded()V
+HSPLandroid/app/ITaskStackListener;->onPinnedStackAnimationStarted()V
+HSPLandroid/app/ITaskStackListener;->onTaskCreated(ILandroid/content/ComponentName;)V
+HSPLandroid/app/ITaskStackListener;->onTaskDescriptionChanged(ILandroid/app/ActivityManager$TaskDescription;)V
+HSPLandroid/app/ITaskStackListener;->onTaskMovedToFront(I)V
+HSPLandroid/app/ITaskStackListener;->onTaskProfileLocked(II)V
+HSPLandroid/app/ITaskStackListener;->onTaskRemovalStarted(I)V
+HSPLandroid/app/ITaskStackListener;->onTaskRemoved(I)V
+HSPLandroid/app/ITaskStackListener;->onTaskSnapshotChanged(ILandroid/app/ActivityManager$TaskSnapshot;)V
+HSPLandroid/app/ITaskStackListener;->onTaskStackChanged()V
+HSPLandroid/app/LoadedApk$ReceiverDispatcher$Args$$Lambda$0;->run()V
+HSPLandroid/app/LoadedApk$ReceiverDispatcher$Args;->lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args()V
+HSPLandroid/app/Notification$$Lambda$0;->onMarshaled(Landroid/app/PendingIntent;Landroid/os/Parcel;I)V
+HSPLandroid/app/Notification$Extender;->extend(Landroid/app/Notification$Builder;)Landroid/app/Notification$Builder;
+HSPLandroid/app/Notification;->lambda$writeToParcel$0$Notification(Landroid/os/Parcel;Landroid/app/PendingIntent;Landroid/os/Parcel;I)V
+HSPLandroid/app/NotificationChannelGroup;->populateFromXml(Lorg/xmlpull/v1/XmlPullParser;)V
+HSPLandroid/app/NotificationChannelGroup;->safeBool(Lorg/xmlpull/v1/XmlPullParser;Ljava/lang/String;Z)Z
+HSPLandroid/app/NotificationChannelGroup;->setBlocked(Z)V
+HSPLandroid/app/NotificationChannelGroup;->setDescription(Ljava/lang/String;)V
+HSPLandroid/app/SynchronousUserSwitchObserver;->onUserSwitching(I)V
+HSPLandroid/app/WindowConfiguration$1;->createFromParcel(Landroid/os/Parcel;)Landroid/app/WindowConfiguration;
+HSPLandroid/app/WindowConfiguration$1;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;
+HSPLandroid/app/WindowConfiguration;-><init>(Landroid/os/Parcel;)V
+HSPLandroid/app/WindowConfiguration;-><init>(Landroid/os/Parcel;Landroid/app/WindowConfiguration$1;)V
+HSPLandroid/app/WindowConfiguration;->activityTypeToString(I)Ljava/lang/String;
+HSPLandroid/app/WindowConfiguration;->canReceiveKeys()Z
+HSPLandroid/app/WindowConfiguration;->compareTo(Landroid/app/WindowConfiguration;)I
+HSPLandroid/app/WindowConfiguration;->diff(Landroid/app/WindowConfiguration;Z)J
+HSPLandroid/app/WindowConfiguration;->equals(Ljava/lang/Object;)Z
+HSPLandroid/app/WindowConfiguration;->getActivityType()I
+HSPLandroid/app/WindowConfiguration;->getAppBounds()Landroid/graphics/Rect;
+HSPLandroid/app/WindowConfiguration;->getWindowingMode()I
+HSPLandroid/app/WindowConfiguration;->isAlwaysOnTop()Z
+HSPLandroid/app/WindowConfiguration;->readFromParcel(Landroid/os/Parcel;)V
+HSPLandroid/app/WindowConfiguration;->setActivityType(I)V
+HSPLandroid/app/WindowConfiguration;->setAppBounds(IIII)V
+HSPLandroid/app/WindowConfiguration;->setAppBounds(Landroid/graphics/Rect;)V
+HSPLandroid/app/WindowConfiguration;->setTo(Landroid/app/WindowConfiguration;)V
+HSPLandroid/app/WindowConfiguration;->setToDefaults()V
+HSPLandroid/app/WindowConfiguration;->setWindowingMode(I)V
+HSPLandroid/app/WindowConfiguration;->tasksAreFloating()Z
+HSPLandroid/app/WindowConfiguration;->toString()Ljava/lang/String;
+HSPLandroid/app/WindowConfiguration;->updateFrom(Landroid/app/WindowConfiguration;)I
+HSPLandroid/app/WindowConfiguration;->useWindowFrameForBackdrop()Z
+HSPLandroid/app/WindowConfiguration;->windowingModeToString(I)Ljava/lang/String;
+HSPLandroid/app/WindowConfiguration;->windowsAreScaleable()Z
+HSPLandroid/app/WindowConfiguration;->writeToParcel(Landroid/os/Parcel;I)V
+HSPLandroid/app/admin/DevicePolicyManagerInternal$OnCrossProfileWidgetProvidersChangeListener;->onCrossProfileWidgetProvidersChanged(ILjava/util/List;)V
+HSPLandroid/app/admin/DevicePolicyManagerInternal;->addOnCrossProfileWidgetProvidersChangeListener(Landroid/app/admin/DevicePolicyManagerInternal$OnCrossProfileWidgetProvidersChangeListener;)V
+HSPLandroid/app/admin/DevicePolicyManagerInternal;->createShowAdminSupportIntent(IZ)Landroid/content/Intent;
+HSPLandroid/app/admin/DevicePolicyManagerInternal;->createUserRestrictionSupportIntent(ILjava/lang/String;)Landroid/content/Intent;
+HSPLandroid/app/admin/DevicePolicyManagerInternal;->getCrossProfileWidgetProviders(I)Ljava/util/List;
+HSPLandroid/app/admin/DevicePolicyManagerInternal;->isActiveAdminWithPolicy(II)Z
+HSPLandroid/app/admin/IDevicePolicyManager$Stub;->onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
+HSPLandroid/app/timezone/IRulesManager;->getRulesState()Landroid/app/timezone/RulesState;
+HSPLandroid/app/timezone/IRulesManager;->requestInstall(Landroid/os/ParcelFileDescriptor;[BLandroid/app/timezone/ICallback;)I
+HSPLandroid/app/timezone/IRulesManager;->requestNothing([BZ)V
+HSPLandroid/app/timezone/IRulesManager;->requestUninstall([BLandroid/app/timezone/ICallback;)I
+HSPLandroid/app/trust/IStrongAuthTracker;->onStrongAuthRequiredChanged(II)V
+HSPLandroid/app/trust/ITrustListener;->onTrustChanged(ZII)V
+HSPLandroid/app/trust/ITrustListener;->onTrustManagedChanged(ZI)V
+HSPLandroid/app/usage/IUsageStatsManager;->isAppInactive(Ljava/lang/String;I)Z
+HSPLandroid/app/usage/IUsageStatsManager;->onCarrierPrivilegedAppsChanged()V
+HSPLandroid/app/usage/IUsageStatsManager;->queryConfigurationStats(IJJLjava/lang/String;)Landroid/content/pm/ParceledListSlice;
+HSPLandroid/app/usage/IUsageStatsManager;->queryEvents(JJLjava/lang/String;)Landroid/app/usage/UsageEvents;
+HSPLandroid/app/usage/IUsageStatsManager;->queryUsageStats(IJJLjava/lang/String;)Landroid/content/pm/ParceledListSlice;
+HSPLandroid/app/usage/IUsageStatsManager;->reportChooserSelection(Ljava/lang/String;ILjava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/app/usage/IUsageStatsManager;->setAppInactive(Ljava/lang/String;ZI)V
+HSPLandroid/app/usage/IUsageStatsManager;->whitelistAppTemporarily(Ljava/lang/String;JI)V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->addAppIdleStateChangeListener(Landroid/app/usage/UsageStatsManagerInternal$AppIdleStateChangeListener;)V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->applyRestoredPayload(ILjava/lang/String;[B)V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->getBackupPayload(ILjava/lang/String;)[B
+HSPLandroid/app/usage/UsageStatsManagerInternal;->getIdleUidsForUser(I)[I
+HSPLandroid/app/usage/UsageStatsManagerInternal;->isAppIdle(Ljava/lang/String;II)Z
+HSPLandroid/app/usage/UsageStatsManagerInternal;->isAppIdleParoleOn()Z
+HSPLandroid/app/usage/UsageStatsManagerInternal;->prepareShutdown()V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->queryUsageStatsForUser(IIJJZ)Ljava/util/List;
+HSPLandroid/app/usage/UsageStatsManagerInternal;->removeAppIdleStateChangeListener(Landroid/app/usage/UsageStatsManagerInternal$AppIdleStateChangeListener;)V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->reportConfigurationChange(Landroid/content/res/Configuration;I)V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->reportContentProviderUsage(Ljava/lang/String;Ljava/lang/String;I)V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->reportEvent(Landroid/content/ComponentName;II)V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->reportEvent(Ljava/lang/String;II)V
+HSPLandroid/app/usage/UsageStatsManagerInternal;->reportShortcutUsage(Ljava/lang/String;Ljava/lang/String;I)V
+HSPLandroid/bluetooth/IBluetoothCallback;->onBluetoothStateChange(II)V
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->answerCall()Z
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->cdmaSetSecondCallState(Z)V
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->cdmaSwapSecondCallState()V
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->getNetworkOperator()Ljava/lang/String;
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->getSubscriberNumber()Ljava/lang/String;
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->hangupCall()Z
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->listCurrentCalls()Z
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->processChld(I)Z
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->queryPhoneState()Z
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->sendDtmf(I)Z
+HSPLandroid/bluetooth/IBluetoothHeadsetPhone;->updateBtHandsfreeAfterRadioTechnologyChange()V
+HSPLandroid/companion/ICompanionDeviceManager;->associate(Landroid/companion/AssociationRequest;Landroid/companion/IFindDeviceCallback;Ljava/lang/String;)V
+HSPLandroid/companion/ICompanionDeviceManager;->disassociate(Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/companion/ICompanionDeviceManager;->getAssociations(Ljava/lang/String;I)Ljava/util/List;
+HSPLandroid/companion/ICompanionDeviceManager;->hasNotificationAccess(Landroid/content/ComponentName;)Z
+HSPLandroid/companion/ICompanionDeviceManager;->requestNotificationAccess(Landroid/content/ComponentName;)Landroid/app/PendingIntent;
+HSPLandroid/companion/ICompanionDeviceManager;->stopScan(Landroid/companion/AssociationRequest;Landroid/companion/IFindDeviceCallback;Ljava/lang/String;)V
+HSPLandroid/content/Intent;->toInsecureString()Ljava/lang/String;
+HSPLandroid/content/ServiceConnection;->onServiceConnected(Landroid/content/ComponentName;Landroid/os/IBinder;)V
+HSPLandroid/content/ServiceConnection;->onServiceDisconnected(Landroid/content/ComponentName;)V
+HSPLandroid/content/om/IOverlayManager;->getAllOverlays(I)Ljava/util/Map;
+HSPLandroid/content/om/IOverlayManager;->getOverlayInfo(Ljava/lang/String;I)Landroid/content/om/OverlayInfo;
+HSPLandroid/content/om/IOverlayManager;->getOverlayInfosForTarget(Ljava/lang/String;I)Ljava/util/List;
+HSPLandroid/content/om/IOverlayManager;->setEnabled(Ljava/lang/String;ZI)Z
+HSPLandroid/content/om/IOverlayManager;->setEnabledExclusive(Ljava/lang/String;ZI)Z
+HSPLandroid/content/om/IOverlayManager;->setHighestPriority(Ljava/lang/String;I)Z
+HSPLandroid/content/om/IOverlayManager;->setLowestPriority(Ljava/lang/String;I)Z
+HSPLandroid/content/om/IOverlayManager;->setPriority(Ljava/lang/String;Ljava/lang/String;I)Z
+HSPLandroid/content/pm/ActivityInfo;->resizeModeToString(I)Ljava/lang/String;
+HSPLandroid/content/pm/ILauncherApps;->addOnAppsChangedListener(Ljava/lang/String;Landroid/content/pm/IOnAppsChangedListener;)V
+HSPLandroid/content/pm/ILauncherApps;->getApplicationInfo(Ljava/lang/String;Ljava/lang/String;ILandroid/os/UserHandle;)Landroid/content/pm/ApplicationInfo;
+HSPLandroid/content/pm/ILauncherApps;->getLauncherActivities(Ljava/lang/String;Ljava/lang/String;Landroid/os/UserHandle;)Landroid/content/pm/ParceledListSlice;
+HSPLandroid/content/pm/ILauncherApps;->getShortcutConfigActivities(Ljava/lang/String;Ljava/lang/String;Landroid/os/UserHandle;)Landroid/content/pm/ParceledListSlice;
+HSPLandroid/content/pm/ILauncherApps;->getShortcutConfigActivityIntent(Ljava/lang/String;Landroid/content/ComponentName;Landroid/os/UserHandle;)Landroid/content/IntentSender;
+HSPLandroid/content/pm/ILauncherApps;->getShortcutIconFd(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Landroid/os/ParcelFileDescriptor;
+HSPLandroid/content/pm/ILauncherApps;->getShortcutIconResId(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)I
+HSPLandroid/content/pm/ILauncherApps;->getShortcuts(Ljava/lang/String;JLjava/lang/String;Ljava/util/List;Landroid/content/ComponentName;ILandroid/os/UserHandle;)Landroid/content/pm/ParceledListSlice;
+HSPLandroid/content/pm/ILauncherApps;->hasShortcutHostPermission(Ljava/lang/String;)Z
+HSPLandroid/content/pm/ILauncherApps;->isActivityEnabled(Ljava/lang/String;Landroid/content/ComponentName;Landroid/os/UserHandle;)Z
+HSPLandroid/content/pm/ILauncherApps;->isPackageEnabled(Ljava/lang/String;Ljava/lang/String;Landroid/os/UserHandle;)Z
+HSPLandroid/content/pm/ILauncherApps;->pinShortcuts(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Landroid/os/UserHandle;)V
+HSPLandroid/content/pm/ILauncherApps;->removeOnAppsChangedListener(Landroid/content/pm/IOnAppsChangedListener;)V
+HSPLandroid/content/pm/ILauncherApps;->resolveActivity(Ljava/lang/String;Landroid/content/ComponentName;Landroid/os/UserHandle;)Landroid/content/pm/ActivityInfo;
+HSPLandroid/content/pm/ILauncherApps;->showAppDetailsAsUser(Ljava/lang/String;Landroid/content/ComponentName;Landroid/graphics/Rect;Landroid/os/Bundle;Landroid/os/UserHandle;)V
+HSPLandroid/content/pm/ILauncherApps;->startActivityAsUser(Ljava/lang/String;Landroid/content/ComponentName;Landroid/graphics/Rect;Landroid/os/Bundle;Landroid/os/UserHandle;)V
+HSPLandroid/content/pm/ILauncherApps;->startShortcut(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Rect;Landroid/os/Bundle;I)Z
+HSPLandroid/content/pm/IOnPermissionsChangeListener;->onPermissionsChanged(I)V
+HSPLandroid/content/pm/IOtaDexopt;->cleanup()V
+HSPLandroid/content/pm/IOtaDexopt;->dexoptNextPackage()V
+HSPLandroid/content/pm/IOtaDexopt;->getProgress()F
+HSPLandroid/content/pm/IOtaDexopt;->isDone()Z
+HSPLandroid/content/pm/IOtaDexopt;->nextDexoptCommand()Ljava/lang/String;
+HSPLandroid/content/pm/IOtaDexopt;->prepare()V
+HSPLandroid/content/pm/IPackageManagerNative;->getNamesForUids([I)[Ljava/lang/String;
+HSPLandroid/content/pm/IPackageMoveObserver;->onCreated(ILandroid/os/Bundle;)V
+HSPLandroid/content/pm/IPackageMoveObserver;->onStatusChanged(IIJ)V
+HSPLandroid/content/pm/PackageManagerInternal$ExternalSourcesPolicy;->getPackageTrustedToInstallApps(Ljava/lang/String;I)I
+HSPLandroid/content/pm/PackageManagerInternal$SyncAdapterPackagesProvider;->getPackages(Ljava/lang/String;I)[Ljava/lang/String;
+HSPLandroid/content/pm/PackageManagerInternal;->addIsolatedUid(II)V
+HSPLandroid/content/pm/PackageManagerInternal;->canAccessInstantApps(II)Z
+HSPLandroid/content/pm/PackageManagerInternal;->getActivityInfo(Landroid/content/ComponentName;III)Landroid/content/pm/ActivityInfo;
+HSPLandroid/content/pm/PackageManagerInternal;->getApplicationInfo(Ljava/lang/String;III)Landroid/content/pm/ApplicationInfo;
+HSPLandroid/content/pm/PackageManagerInternal;->getHomeActivitiesAsUser(Ljava/util/List;I)Landroid/content/ComponentName;
+HSPLandroid/content/pm/PackageManagerInternal;->getNameForUid(I)Ljava/lang/String;
+HSPLandroid/content/pm/PackageManagerInternal;->getOverlayPackages(I)Ljava/util/List;
+HSPLandroid/content/pm/PackageManagerInternal;->getPackageInfo(Ljava/lang/String;III)Landroid/content/pm/PackageInfo;
+HSPLandroid/content/pm/PackageManagerInternal;->getSetupWizardPackageName()Ljava/lang/String;
+HSPLandroid/content/pm/PackageManagerInternal;->getTargetPackageNames(I)Ljava/util/List;
+HSPLandroid/content/pm/PackageManagerInternal;->getUidTargetSdkVersion(I)I
+HSPLandroid/content/pm/PackageManagerInternal;->grantDefaultPermissionsToDefaultDialerApp(Ljava/lang/String;I)V
+HSPLandroid/content/pm/PackageManagerInternal;->grantDefaultPermissionsToDefaultSimCallManager(Ljava/lang/String;I)V
+HSPLandroid/content/pm/PackageManagerInternal;->grantDefaultPermissionsToDefaultSmsApp(Ljava/lang/String;I)V
+HSPLandroid/content/pm/PackageManagerInternal;->grantEphemeralAccess(ILandroid/content/Intent;II)V
+HSPLandroid/content/pm/PackageManagerInternal;->grantRuntimePermission(Ljava/lang/String;Ljava/lang/String;IZ)V
+HSPLandroid/content/pm/PackageManagerInternal;->hasInstantApplicationMetadata(Ljava/lang/String;I)Z
+HSPLandroid/content/pm/PackageManagerInternal;->isInstantAppInstallerComponent(Landroid/content/ComponentName;)Z
+HSPLandroid/content/pm/PackageManagerInternal;->isPackageDataProtected(ILjava/lang/String;)Z
+HSPLandroid/content/pm/PackageManagerInternal;->isPackageEphemeral(ILjava/lang/String;)Z
+HSPLandroid/content/pm/PackageManagerInternal;->isPackagePersistent(Ljava/lang/String;)Z
+HSPLandroid/content/pm/PackageManagerInternal;->isPermissionsReviewRequired(Ljava/lang/String;I)Z
+HSPLandroid/content/pm/PackageManagerInternal;->notifyPackageUse(Ljava/lang/String;I)V
+HSPLandroid/content/pm/PackageManagerInternal;->pruneInstantApps()V
+HSPLandroid/content/pm/PackageManagerInternal;->queryIntentActivities(Landroid/content/Intent;III)Ljava/util/List;
+HSPLandroid/content/pm/PackageManagerInternal;->removeIsolatedUid(I)V
+HSPLandroid/content/pm/PackageManagerInternal;->requestInstantAppResolutionPhaseTwo(Landroid/content/pm/AuxiliaryResolveInfo;Landroid/content/Intent;Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;I)V
+HSPLandroid/content/pm/PackageManagerInternal;->resolveIntent(Landroid/content/Intent;Ljava/lang/String;II)Landroid/content/pm/ResolveInfo;
+HSPLandroid/content/pm/PackageManagerInternal;->resolveService(Landroid/content/Intent;Ljava/lang/String;III)Landroid/content/pm/ResolveInfo;
+HSPLandroid/content/pm/PackageManagerInternal;->revokeRuntimePermission(Ljava/lang/String;Ljava/lang/String;IZ)V
+HSPLandroid/content/pm/PackageManagerInternal;->setDeviceAndProfileOwnerPackages(ILjava/lang/String;Landroid/util/SparseArray;)V
+HSPLandroid/content/pm/PackageManagerInternal;->setDialerAppPackagesProvider(Landroid/content/pm/PackageManagerInternal$PackagesProvider;)V
+HSPLandroid/content/pm/PackageManagerInternal;->setEnabledOverlayPackages(ILjava/lang/String;Ljava/util/List;)Z
+HSPLandroid/content/pm/PackageManagerInternal;->setExternalSourcesPolicy(Landroid/content/pm/PackageManagerInternal$ExternalSourcesPolicy;)V
+HSPLandroid/content/pm/PackageManagerInternal;->setKeepUninstalledPackages(Ljava/util/List;)V
+HSPLandroid/content/pm/PackageManagerInternal;->setLocationPackagesProvider(Landroid/content/pm/PackageManagerInternal$PackagesProvider;)V
+HSPLandroid/content/pm/PackageManagerInternal;->setSimCallManagerPackagesProvider(Landroid/content/pm/PackageManagerInternal$PackagesProvider;)V
+HSPLandroid/content/pm/PackageManagerInternal;->setSmsAppPackagesProvider(Landroid/content/pm/PackageManagerInternal$PackagesProvider;)V
+HSPLandroid/content/pm/PackageManagerInternal;->setSyncAdapterPackagesprovider(Landroid/content/pm/PackageManagerInternal$SyncAdapterPackagesProvider;)V
+HSPLandroid/content/pm/PackageManagerInternal;->setVoiceInteractionPackagesProvider(Landroid/content/pm/PackageManagerInternal$PackagesProvider;)V
+HSPLandroid/content/pm/PackageManagerInternal;->wasPackageEverLaunched(Ljava/lang/String;I)Z
+HSPLandroid/content/pm/PackageParser$Callback;->getOverlayApks(Ljava/lang/String;)[Ljava/lang/String;
+HSPLandroid/content/pm/PackageParser$Callback;->getOverlayPaths(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;
+HSPLandroid/content/pm/PackageParser$Callback;->hasFeature(Ljava/lang/String;)Z
+HSPLandroid/content/pm/PackageParser$SplitNameComparator;-><init>(Landroid/content/pm/PackageParser$1;)V
+HSPLandroid/content/pm/ShortcutServiceInternal$ShortcutChangeListener;->onShortcutChanged(Ljava/lang/String;I)V
+HSPLandroid/content/pm/ShortcutServiceInternal;->addListener(Landroid/content/pm/ShortcutServiceInternal$ShortcutChangeListener;)V
+HSPLandroid/content/pm/ShortcutServiceInternal;->createShortcutIntents(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)[Landroid/content/Intent;
+HSPLandroid/content/pm/ShortcutServiceInternal;->getShortcutIconFd(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Landroid/os/ParcelFileDescriptor;
+HSPLandroid/content/pm/ShortcutServiceInternal;->getShortcutIconResId(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)I
+HSPLandroid/content/pm/ShortcutServiceInternal;->getShortcuts(ILjava/lang/String;JLjava/lang/String;Ljava/util/List;Landroid/content/ComponentName;II)Ljava/util/List;
+HSPLandroid/content/pm/ShortcutServiceInternal;->hasShortcutHostPermission(ILjava/lang/String;)Z
+HSPLandroid/content/pm/ShortcutServiceInternal;->isPinnedByCaller(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Z
+HSPLandroid/content/pm/ShortcutServiceInternal;->isRequestPinItemSupported(II)Z
+HSPLandroid/content/pm/ShortcutServiceInternal;->pinShortcuts(ILjava/lang/String;Ljava/lang/String;Ljava/util/List;I)V
+HSPLandroid/content/pm/ShortcutServiceInternal;->requestPinAppWidget(Ljava/lang/String;Landroid/appwidget/AppWidgetProviderInfo;Landroid/os/Bundle;Landroid/content/IntentSender;I)Z
+HSPLandroid/database/sqlite/SQLiteDatabase$$Lambda$0;->get()Ljava/lang/Object;
+HSPLandroid/database/sqlite/SQLiteDatabase$OpenParams$Builder;->setIdleConnectionTimeout(J)Landroid/database/sqlite/SQLiteDatabase$OpenParams$Builder;
+HSPLandroid/database/sqlite/SQLiteOpenHelper;->setIdleConnectionTimeout(J)V
+HSPLandroid/hardware/ICameraServiceProxy;->notifyCameraState(Ljava/lang/String;IILjava/lang/String;)V
+HSPLandroid/hardware/ICameraServiceProxy;->pingForUserUpdate()V
+HSPLandroid/hardware/IConsumerIrService;->getCarrierFrequencies()[I
+HSPLandroid/hardware/IConsumerIrService;->hasIrEmitter()Z
+HSPLandroid/hardware/IConsumerIrService;->transmit(Ljava/lang/String;I[I)V
+HSPLandroid/hardware/ISerialManager;->getSerialPorts()[Ljava/lang/String;
+HSPLandroid/hardware/ISerialManager;->openSerialPort(Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
+HSPLandroid/hardware/display/DisplayManagerInternal$DisplayPowerCallbacks;->acquireSuspendBlocker()V
+HSPLandroid/hardware/display/DisplayManagerInternal$DisplayPowerCallbacks;->onDisplayStateChange(I)V
+HSPLandroid/hardware/display/DisplayManagerInternal$DisplayPowerCallbacks;->onProximityNegative()V
+HSPLandroid/hardware/display/DisplayManagerInternal$DisplayPowerCallbacks;->onProximityPositive()V
+HSPLandroid/hardware/display/DisplayManagerInternal$DisplayPowerCallbacks;->onStateChanged()V
+HSPLandroid/hardware/display/DisplayManagerInternal$DisplayPowerCallbacks;->releaseSuspendBlocker()V
+HSPLandroid/hardware/display/DisplayManagerInternal;->getDisplayInfo(I)Landroid/view/DisplayInfo;
+HSPLandroid/hardware/display/DisplayManagerInternal;->getNonOverrideDisplayInfo(ILandroid/view/DisplayInfo;)V
+HSPLandroid/hardware/display/DisplayManagerInternal;->initPowerManagement(Landroid/hardware/display/DisplayManagerInternal$DisplayPowerCallbacks;Landroid/os/Handler;Landroid/hardware/SensorManager;)V
+HSPLandroid/hardware/display/DisplayManagerInternal;->isProximitySensorAvailable()Z
+HSPLandroid/hardware/display/DisplayManagerInternal;->isUidPresentOnDisplay(II)Z
+HSPLandroid/hardware/display/DisplayManagerInternal;->performTraversalInTransactionFromWindowManager()V
+HSPLandroid/hardware/display/DisplayManagerInternal;->registerDisplayTransactionListener(Landroid/hardware/display/DisplayManagerInternal$DisplayTransactionListener;)V
+HSPLandroid/hardware/display/DisplayManagerInternal;->requestPowerState(Landroid/hardware/display/DisplayManagerInternal$DisplayPowerRequest;Z)Z
+HSPLandroid/hardware/display/DisplayManagerInternal;->setDisplayAccessUIDs(Landroid/util/SparseArray;)V
+HSPLandroid/hardware/display/DisplayManagerInternal;->setDisplayInfoOverrideFromWindowManager(ILandroid/view/DisplayInfo;)V
+HSPLandroid/hardware/display/DisplayManagerInternal;->setDisplayOffsets(III)V
+HSPLandroid/hardware/display/DisplayManagerInternal;->setDisplayProperties(IZFIZ)V
+HSPLandroid/hardware/display/DisplayManagerInternal;->unregisterDisplayTransactionListener(Landroid/hardware/display/DisplayManagerInternal$DisplayTransactionListener;)V
+HSPLandroid/hardware/hdmi/HdmiPlaybackClient$DisplayStatusCallback;->onComplete(I)V
+HSPLandroid/hardware/input/InputManagerInternal;->injectInputEvent(Landroid/view/InputEvent;II)Z
+HSPLandroid/hardware/input/InputManagerInternal;->onInputMethodSubtypeChanged(ILandroid/view/inputmethod/InputMethodInfo;Landroid/view/inputmethod/InputMethodSubtype;)V
+HSPLandroid/hardware/input/InputManagerInternal;->setDisplayViewports(Landroid/hardware/display/DisplayViewport;Landroid/hardware/display/DisplayViewport;Ljava/util/List;)V
+HSPLandroid/hardware/input/InputManagerInternal;->setInteractive(Z)V
+HSPLandroid/hardware/input/InputManagerInternal;->setPulseGestureEnabled(Z)V
+HSPLandroid/hardware/input/InputManagerInternal;->toggleCapsLock(I)V
+HSPLandroid/hardware/location/IContextHubService;->findNanoAppOnHub(ILandroid/hardware/location/NanoAppFilter;)[I
+HSPLandroid/hardware/location/IContextHubService;->getContextHubHandles()[I
+HSPLandroid/hardware/location/IContextHubService;->getContextHubInfo(I)Landroid/hardware/location/ContextHubInfo;
+HSPLandroid/hardware/location/IContextHubService;->getNanoAppInstanceInfo(I)Landroid/hardware/location/NanoAppInstanceInfo;
+HSPLandroid/hardware/location/IContextHubService;->loadNanoApp(ILandroid/hardware/location/NanoApp;)I
+HSPLandroid/hardware/location/IContextHubService;->registerCallback(Landroid/hardware/location/IContextHubCallback;)I
+HSPLandroid/hardware/location/IContextHubService;->sendMessage(IILandroid/hardware/location/ContextHubMessage;)I
+HSPLandroid/hardware/location/IContextHubService;->unloadNanoApp(I)I
+HSPLandroid/hardware/location/IGeofenceHardware;->addCircularFence(ILandroid/hardware/location/GeofenceHardwareRequestParcelable;Landroid/hardware/location/IGeofenceHardwareCallback;)Z
+HSPLandroid/hardware/location/IGeofenceHardware;->getMonitoringTypes()[I
+HSPLandroid/hardware/location/IGeofenceHardware;->getStatusOfMonitoringType(I)I
+HSPLandroid/hardware/location/IGeofenceHardware;->pauseGeofence(II)Z
+HSPLandroid/hardware/location/IGeofenceHardware;->registerForMonitorStateChangeCallback(ILandroid/hardware/location/IGeofenceHardwareMonitorCallback;)Z
+HSPLandroid/hardware/location/IGeofenceHardware;->removeGeofence(II)Z
+HSPLandroid/hardware/location/IGeofenceHardware;->resumeGeofence(III)Z
+HSPLandroid/hardware/location/IGeofenceHardware;->setFusedGeofenceHardware(Landroid/location/IFusedGeofenceHardware;)V
+HSPLandroid/hardware/location/IGeofenceHardware;->setGpsGeofenceHardware(Landroid/location/IGpsGeofenceHardware;)V
+HSPLandroid/hardware/location/IGeofenceHardware;->unregisterForMonitorStateChangeCallback(ILandroid/hardware/location/IGeofenceHardwareMonitorCallback;)Z
+HSPLandroid/hardware/radio/ITuner;->cancel()V
+HSPLandroid/hardware/radio/ITuner;->cancelAnnouncement()V
+HSPLandroid/hardware/radio/ITuner;->close()V
+HSPLandroid/hardware/radio/ITuner;->getConfiguration()Landroid/hardware/radio/RadioManager$BandConfig;
+HSPLandroid/hardware/radio/ITuner;->getImage(I)Landroid/graphics/Bitmap;
+HSPLandroid/hardware/radio/ITuner;->getProgramInformation()Landroid/hardware/radio/RadioManager$ProgramInfo;
+HSPLandroid/hardware/radio/ITuner;->getProgramList(Ljava/util/Map;)Ljava/util/List;
+HSPLandroid/hardware/radio/ITuner;->isAnalogForced()Z
+HSPLandroid/hardware/radio/ITuner;->isAntennaConnected()Z
+HSPLandroid/hardware/radio/ITuner;->isClosed()Z
+HSPLandroid/hardware/radio/ITuner;->isMuted()Z
+HSPLandroid/hardware/radio/ITuner;->scan(ZZ)V
+HSPLandroid/hardware/radio/ITuner;->setAnalogForced(Z)V
+HSPLandroid/hardware/radio/ITuner;->setConfiguration(Landroid/hardware/radio/RadioManager$BandConfig;)V
+HSPLandroid/hardware/radio/ITuner;->setMuted(Z)V
+HSPLandroid/hardware/radio/ITuner;->startBackgroundScan()Z
+HSPLandroid/hardware/radio/ITuner;->step(ZZ)V
+HSPLandroid/hardware/radio/ITuner;->tune(Landroid/hardware/radio/ProgramSelector;)V
+HSPLandroid/hardware/radio/ITunerCallback;->onAntennaState(Z)V
+HSPLandroid/hardware/radio/ITunerCallback;->onBackgroundScanAvailabilityChange(Z)V
+HSPLandroid/hardware/radio/ITunerCallback;->onBackgroundScanComplete()V
+HSPLandroid/hardware/radio/ITunerCallback;->onConfigurationChanged(Landroid/hardware/radio/RadioManager$BandConfig;)V
+HSPLandroid/hardware/radio/ITunerCallback;->onCurrentProgramInfoChanged(Landroid/hardware/radio/RadioManager$ProgramInfo;)V
+HSPLandroid/hardware/radio/ITunerCallback;->onEmergencyAnnouncement(Z)V
+HSPLandroid/hardware/radio/ITunerCallback;->onError(I)V
+HSPLandroid/hardware/radio/ITunerCallback;->onProgramListChanged()V
+HSPLandroid/hardware/radio/ITunerCallback;->onTrafficAnnouncement(Z)V
+HSPLandroid/hardware/soundtrigger/SoundTrigger$StatusListener;->onRecognition(Landroid/hardware/soundtrigger/SoundTrigger$RecognitionEvent;)V
+HSPLandroid/hardware/soundtrigger/SoundTrigger$StatusListener;->onServiceDied()V
+HSPLandroid/hardware/soundtrigger/SoundTrigger$StatusListener;->onServiceStateChange(I)V
+HSPLandroid/hardware/soundtrigger/SoundTrigger$StatusListener;->onSoundModelUpdate(Landroid/hardware/soundtrigger/SoundTrigger$SoundModelEvent;)V
+HSPLandroid/hardware/usb/IUsbManager;->allowUsbDebugging(ZLjava/lang/String;)V
+HSPLandroid/hardware/usb/IUsbManager;->clearDefaults(Ljava/lang/String;I)V
+HSPLandroid/hardware/usb/IUsbManager;->clearUsbDebuggingKeys()V
+HSPLandroid/hardware/usb/IUsbManager;->denyUsbDebugging()V
+HSPLandroid/hardware/usb/IUsbManager;->getCurrentAccessory()Landroid/hardware/usb/UsbAccessory;
+HSPLandroid/hardware/usb/IUsbManager;->getDeviceList(Landroid/os/Bundle;)V
+HSPLandroid/hardware/usb/IUsbManager;->getPortStatus(Ljava/lang/String;)Landroid/hardware/usb/UsbPortStatus;
+HSPLandroid/hardware/usb/IUsbManager;->getPorts()[Landroid/hardware/usb/UsbPort;
+HSPLandroid/hardware/usb/IUsbManager;->grantAccessoryPermission(Landroid/hardware/usb/UsbAccessory;I)V
+HSPLandroid/hardware/usb/IUsbManager;->grantDevicePermission(Landroid/hardware/usb/UsbDevice;I)V
+HSPLandroid/hardware/usb/IUsbManager;->hasAccessoryPermission(Landroid/hardware/usb/UsbAccessory;)Z
+HSPLandroid/hardware/usb/IUsbManager;->hasDefaults(Ljava/lang/String;I)Z
+HSPLandroid/hardware/usb/IUsbManager;->hasDevicePermission(Landroid/hardware/usb/UsbDevice;)Z
+HSPLandroid/hardware/usb/IUsbManager;->isFunctionEnabled(Ljava/lang/String;)Z
+HSPLandroid/hardware/usb/IUsbManager;->openAccessory(Landroid/hardware/usb/UsbAccessory;)Landroid/os/ParcelFileDescriptor;
+HSPLandroid/hardware/usb/IUsbManager;->openDevice(Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
+HSPLandroid/hardware/usb/IUsbManager;->requestAccessoryPermission(Landroid/hardware/usb/UsbAccessory;Ljava/lang/String;Landroid/app/PendingIntent;)V
+HSPLandroid/hardware/usb/IUsbManager;->requestDevicePermission(Landroid/hardware/usb/UsbDevice;Ljava/lang/String;Landroid/app/PendingIntent;)V
+HSPLandroid/hardware/usb/IUsbManager;->setAccessoryPackage(Landroid/hardware/usb/UsbAccessory;Ljava/lang/String;I)V
+HSPLandroid/hardware/usb/IUsbManager;->setCurrentFunction(Ljava/lang/String;Z)V
+HSPLandroid/hardware/usb/IUsbManager;->setDevicePackage(Landroid/hardware/usb/UsbDevice;Ljava/lang/String;I)V
+HSPLandroid/hardware/usb/IUsbManager;->setPortRoles(Ljava/lang/String;II)V
+HSPLandroid/hardware/usb/IUsbManager;->setUsbDeviceConnectionHandler(Landroid/content/ComponentName;)V
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->add(Ljava/lang/String;Landroid/hidl/base/V1_0/IBase;)Z
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->asBinder()Landroid/os/IHwBinder;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->debugDump()Ljava/util/ArrayList;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->get(Ljava/lang/String;Ljava/lang/String;)Landroid/hidl/base/V1_0/IBase;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->getDebugInfo()Landroid/hidl/base/V1_0/DebugInfo;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->getHashChain()Ljava/util/ArrayList;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->getTransport(Ljava/lang/String;Ljava/lang/String;)B
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->interfaceChain()Ljava/util/ArrayList;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->interfaceDescriptor()Ljava/lang/String;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->linkToDeath(Landroid/os/IHwBinder$DeathRecipient;J)Z
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->list()Ljava/util/ArrayList;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->listByInterface(Ljava/lang/String;)Ljava/util/ArrayList;
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->notifySyspropsChanged()V
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->ping()V
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->registerForNotifications(Ljava/lang/String;Ljava/lang/String;Landroid/hidl/manager/V1_0/IServiceNotification;)Z
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->registerPassthroughClient(Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->setHALInstrumentation()V
+HSPLandroid/hidl/manager/V1_0/IServiceManager;->unlinkToDeath(Landroid/os/IHwBinder$DeathRecipient;)Z
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->asBinder()Landroid/os/IHwBinder;
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->getDebugInfo()Landroid/hidl/base/V1_0/DebugInfo;
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->getHashChain()Ljava/util/ArrayList;
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->interfaceChain()Ljava/util/ArrayList;
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->interfaceDescriptor()Ljava/lang/String;
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->linkToDeath(Landroid/os/IHwBinder$DeathRecipient;J)Z
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->notifySyspropsChanged()V
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->ping()V
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->setHALInstrumentation()V
+HSPLandroid/hidl/manager/V1_0/IServiceNotification;->unlinkToDeath(Landroid/os/IHwBinder$DeathRecipient;)Z
+HSPLandroid/icu/impl/LocaleDisplayNamesImpl$Cache;-><init>(Landroid/icu/impl/LocaleDisplayNamesImpl$1;)V
+HSPLandroid/icu/impl/LocaleDisplayNamesImpl$DataTableType;-><init>(Ljava/lang/String;I)V
+HSPLandroid/icu/impl/LocaleDisplayNamesImpl$DataTableType;->values()[Landroid/icu/impl/LocaleDisplayNamesImpl$DataTableType;
+HSPLandroid/icu/impl/TimeZoneNamesImpl$MZ2TZsCache;-><init>(Landroid/icu/impl/TimeZoneNamesImpl$1;)V
+HSPLandroid/icu/impl/TimeZoneNamesImpl$TZ2MZsCache;-><init>(Landroid/icu/impl/TimeZoneNamesImpl$1;)V
+HSPLandroid/icu/impl/ZoneMeta$CustomTimeZoneCache;-><init>(Landroid/icu/impl/ZoneMeta$1;)V
+HSPLandroid/icu/impl/ZoneMeta$SystemTimeZoneCache;-><init>(Landroid/icu/impl/ZoneMeta$1;)V
+HSPLandroid/icu/impl/number/AffixPatternUtils;->hasCurrencySymbols(Ljava/lang/CharSequence;)Z
+HSPLandroid/icu/impl/number/AffixPatternUtils;->unescape(Ljava/lang/CharSequence;Landroid/icu/text/DecimalFormatSymbols;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/icu/impl/number/NumberStringBuilder;)V
+HSPLandroid/icu/impl/number/Endpoint$3;->initialValue()Ljava/lang/Object;
+HSPLandroid/icu/impl/number/Endpoint$3;->initialValue()Ljava/util/Map;
+HSPLandroid/icu/impl/number/Endpoint$IProperties;->getPluralRules()Landroid/icu/text/PluralRules;
+HSPLandroid/icu/impl/number/Endpoint$IProperties;->setPluralRules(Landroid/icu/text/PluralRules;)Landroid/icu/impl/number/Endpoint$IProperties;
+HSPLandroid/icu/impl/number/Endpoint;->fromBTA(Landroid/icu/impl/number/Properties;Landroid/icu/text/DecimalFormatSymbols;)Landroid/icu/impl/number/Format$SingularFormat;
+HSPLandroid/icu/impl/number/Endpoint;->getPluralRules(Landroid/icu/util/ULocale;Landroid/icu/impl/number/Properties;)Landroid/icu/text/PluralRules;
+HSPLandroid/icu/impl/number/Format$1;->initialValue()Landroid/icu/impl/number/NumberStringBuilder;
+HSPLandroid/icu/impl/number/Format$1;->initialValue()Ljava/lang/Object;
+HSPLandroid/icu/impl/number/Format$2;->initialValue()Landroid/icu/impl/number/ModifierHolder;
+HSPLandroid/icu/impl/number/Format$2;->initialValue()Ljava/lang/Object;
+HSPLandroid/icu/impl/number/Format$AfterFormat;->after(Landroid/icu/impl/number/ModifierHolder;Landroid/icu/impl/number/NumberStringBuilder;II)I
+HSPLandroid/icu/impl/number/Format$BeforeFormat;-><init>()V
+HSPLandroid/icu/impl/number/Format$BeforeTargetAfterFormat;-><init>(Landroid/icu/text/PluralRules;)V
+HSPLandroid/icu/impl/number/Format$BeforeTargetAfterFormat;->addBeforeFormat(Landroid/icu/impl/number/Format$BeforeFormat;)V
+HSPLandroid/icu/impl/number/Format$BeforeTargetAfterFormat;->setTargetFormat(Landroid/icu/impl/number/Format$TargetFormat;)V
+HSPLandroid/icu/impl/number/Format$PositiveNegativeRounderTargetFormat;-><init>(Landroid/icu/impl/number/Modifier$PositiveNegativeModifier;Landroid/icu/impl/number/Rounder;Landroid/icu/impl/number/Format$TargetFormat;)V
+HSPLandroid/icu/impl/number/Format$PositiveNegativeRounderTargetFormat;->export(Landroid/icu/impl/number/Properties;)V
+HSPLandroid/icu/impl/number/Format$PositiveNegativeRounderTargetFormat;->process(Landroid/icu/impl/number/FormatQuantity;Landroid/icu/impl/number/ModifierHolder;Landroid/icu/impl/number/NumberStringBuilder;I)I
+HSPLandroid/icu/impl/number/Format$SingularFormat;-><init>()V
+HSPLandroid/icu/impl/number/Format$SingularFormat;->format(Landroid/icu/impl/number/FormatQuantity;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)V
+HSPLandroid/icu/impl/number/Format$SingularFormat;->formatToStringBuilder(Landroid/icu/impl/number/FormatQuantity;)Landroid/icu/impl/number/NumberStringBuilder;
+HSPLandroid/icu/impl/number/Format$TargetFormat;->target(Landroid/icu/impl/number/FormatQuantity;Landroid/icu/impl/number/NumberStringBuilder;I)I
+HSPLandroid/icu/impl/number/Format;-><init>()V
+HSPLandroid/icu/impl/number/Format;->process(Ljava/util/Deque;Landroid/icu/impl/number/ModifierHolder;Landroid/icu/impl/number/NumberStringBuilder;I)I
+HSPLandroid/icu/impl/number/FormatQuantity4;->compact()V
+HSPLandroid/icu/impl/number/FormatQuantity4;->getDigitPos(I)B
+HSPLandroid/icu/impl/number/FormatQuantity4;->readIntToBcd(I)V
+HSPLandroid/icu/impl/number/FormatQuantity4;->setBcdToZero()V
+HSPLandroid/icu/impl/number/FormatQuantity;->adjustMagnitude(I)V
+HSPLandroid/icu/impl/number/FormatQuantity;->copyFrom(Landroid/icu/impl/number/FormatQuantity;)V
+HSPLandroid/icu/impl/number/FormatQuantity;->createCopy()Landroid/icu/impl/number/FormatQuantity;
+HSPLandroid/icu/impl/number/FormatQuantity;->getDigit(I)B
+HSPLandroid/icu/impl/number/FormatQuantity;->getLowerDisplayMagnitude()I
+HSPLandroid/icu/impl/number/FormatQuantity;->getMagnitude()I
+HSPLandroid/icu/impl/number/FormatQuantity;->getPositionFingerprint()J
+HSPLandroid/icu/impl/number/FormatQuantity;->getStandardPlural(Landroid/icu/text/PluralRules;)Landroid/icu/impl/StandardPlural;
+HSPLandroid/icu/impl/number/FormatQuantity;->getUpperDisplayMagnitude()I
+HSPLandroid/icu/impl/number/FormatQuantity;->isInfinite()Z
+HSPLandroid/icu/impl/number/FormatQuantity;->isNaN()Z
+HSPLandroid/icu/impl/number/FormatQuantity;->isNegative()Z
+HSPLandroid/icu/impl/number/FormatQuantity;->isZero()Z
+HSPLandroid/icu/impl/number/FormatQuantity;->maxRepresentableDigits()I
+HSPLandroid/icu/impl/number/FormatQuantity;->multiplyBy(Ljava/math/BigDecimal;)V
+HSPLandroid/icu/impl/number/FormatQuantity;->roundToIncrement(Ljava/math/BigDecimal;Ljava/math/MathContext;)V
+HSPLandroid/icu/impl/number/FormatQuantity;->roundToInfinity()V
+HSPLandroid/icu/impl/number/FormatQuantity;->roundToMagnitude(ILjava/math/MathContext;)V
+HSPLandroid/icu/impl/number/FormatQuantity;->setIntegerFractionLength(IIII)V
+HSPLandroid/icu/impl/number/FormatQuantity;->toBigDecimal()Ljava/math/BigDecimal;
+HSPLandroid/icu/impl/number/FormatQuantity;->toDouble()D
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->_setToLong(J)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->bcdToBigDecimal()Ljava/math/BigDecimal;
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->compact()V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->copyBcdFrom(Landroid/icu/impl/number/FormatQuantity;)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->getDigit(I)B
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->getDigitPos(I)B
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->getLowerDisplayMagnitude()I
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->getUpperDisplayMagnitude()I
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->isInfinite()Z
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->isNaN()Z
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->isNegative()Z
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->readBigIntegerToBcd(Ljava/math/BigInteger;)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->readIntToBcd(I)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->readLongToBcd(J)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->roundToMagnitude(ILjava/math/MathContext;)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->safeSubtract(II)I
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->setBcdToZero()V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->setDigitPos(IB)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->setIntegerFractionLength(IIII)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->shiftLeft(I)V
+HSPLandroid/icu/impl/number/FormatQuantityBCD;->shiftRight(I)V
+HSPLandroid/icu/impl/number/Modifier$BaseModifier;-><init>()V
+HSPLandroid/icu/impl/number/ModifierHolder;-><init>()V
+HSPLandroid/icu/impl/number/ModifierHolder;->applyAll(Landroid/icu/impl/number/NumberStringBuilder;II)I
+HSPLandroid/icu/impl/number/ModifierHolder;->clear()Landroid/icu/impl/number/ModifierHolder;
+HSPLandroid/icu/impl/number/NumberStringBuilder;-><init>()V
+HSPLandroid/icu/impl/number/NumberStringBuilder;-><init>(I)V
+HSPLandroid/icu/impl/number/NumberStringBuilder;->charAt(I)C
+HSPLandroid/icu/impl/number/NumberStringBuilder;->clear()Landroid/icu/impl/number/NumberStringBuilder;
+HSPLandroid/icu/impl/number/NumberStringBuilder;->contentEquals([C[Landroid/icu/text/NumberFormat$Field;)Z
+HSPLandroid/icu/impl/number/NumberStringBuilder;->insert(ILjava/lang/CharSequence;Landroid/icu/text/NumberFormat$Field;)I
+HSPLandroid/icu/impl/number/NumberStringBuilder;->insertCodePoint(IILandroid/icu/text/NumberFormat$Field;)I
+HSPLandroid/icu/impl/number/NumberStringBuilder;->length()I
+HSPLandroid/icu/impl/number/NumberStringBuilder;->populateFieldPosition(Ljava/text/FieldPosition;I)V
+HSPLandroid/icu/impl/number/NumberStringBuilder;->prepareForInsert(II)I
+HSPLandroid/icu/impl/number/NumberStringBuilder;->toCharArray()[C
+HSPLandroid/icu/impl/number/NumberStringBuilder;->toFieldArray()[Landroid/icu/text/NumberFormat$Field;
+HSPLandroid/icu/impl/number/PNAffixGenerator$1;->initialValue()Landroid/icu/impl/number/PNAffixGenerator;
+HSPLandroid/icu/impl/number/PNAffixGenerator$1;->initialValue()Ljava/lang/Object;
+HSPLandroid/icu/impl/number/PNAffixGenerator$Result;-><init>()V
+HSPLandroid/icu/impl/number/PNAffixGenerator;-><init>()V
+HSPLandroid/icu/impl/number/PNAffixGenerator;->getModifiers(Landroid/icu/text/DecimalFormatSymbols;Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;)Landroid/icu/impl/number/PNAffixGenerator$Result;
+HSPLandroid/icu/impl/number/PNAffixGenerator;->getModifiers(Landroid/icu/text/DecimalFormatSymbols;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;)Landroid/icu/impl/number/PNAffixGenerator$Result;
+HSPLandroid/icu/impl/number/PNAffixGenerator;->getThreadLocalInstance()Landroid/icu/impl/number/PNAffixGenerator;
+HSPLandroid/icu/impl/number/PNAffixGenerator;->setNegativeResult(Landroid/icu/impl/number/NumberStringBuilder;Landroid/icu/impl/number/NumberStringBuilder;Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;)V
+HSPLandroid/icu/impl/number/PNAffixGenerator;->setPositiveResult(Landroid/icu/impl/number/NumberStringBuilder;Landroid/icu/impl/number/NumberStringBuilder;Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;)V
+HSPLandroid/icu/impl/number/Parse$IProperties;->getDecimalPatternMatchRequired()Z
+HSPLandroid/icu/impl/number/Parse$IProperties;->getParseCaseSensitive()Z
+HSPLandroid/icu/impl/number/Parse$IProperties;->getParseGroupingMode()Landroid/icu/impl/number/Parse$GroupingMode;
+HSPLandroid/icu/impl/number/Parse$IProperties;->getParseIntegerOnly()Z
+HSPLandroid/icu/impl/number/Parse$IProperties;->getParseMode()Landroid/icu/impl/number/Parse$ParseMode;
+HSPLandroid/icu/impl/number/Parse$IProperties;->getParseNoExponent()Z
+HSPLandroid/icu/impl/number/Parse$IProperties;->getParseToBigDecimal()Z
+HSPLandroid/icu/impl/number/Parse$IProperties;->setDecimalPatternMatchRequired(Z)Landroid/icu/impl/number/Parse$IProperties;
+HSPLandroid/icu/impl/number/Parse$IProperties;->setParseCaseSensitive(Z)Landroid/icu/impl/number/Parse$IProperties;
+HSPLandroid/icu/impl/number/Parse$IProperties;->setParseGroupingMode(Landroid/icu/impl/number/Parse$GroupingMode;)Landroid/icu/impl/number/Parse$IProperties;
+HSPLandroid/icu/impl/number/Parse$IProperties;->setParseIntegerOnly(Z)Landroid/icu/impl/number/Parse$IProperties;
+HSPLandroid/icu/impl/number/Parse$IProperties;->setParseMode(Landroid/icu/impl/number/Parse$ParseMode;)Landroid/icu/impl/number/Parse$IProperties;
+HSPLandroid/icu/impl/number/Parse$IProperties;->setParseNoExponent(Z)Landroid/icu/impl/number/Parse$IProperties;
+HSPLandroid/icu/impl/number/Parse$IProperties;->setParseToBigDecimal(Z)Landroid/icu/impl/number/Parse$IProperties;
+HSPLandroid/icu/impl/number/Properties;->_clear()Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->clear()Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->clone()Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->getCompactStyle()Landroid/icu/text/CompactDecimalFormat$CompactStyle;
+HSPLandroid/icu/impl/number/Properties;->getCurrency()Landroid/icu/util/Currency;
+HSPLandroid/icu/impl/number/Properties;->getCurrencyPluralInfo()Landroid/icu/text/CurrencyPluralInfo;
+HSPLandroid/icu/impl/number/Properties;->getCurrencyUsage()Landroid/icu/util/Currency$CurrencyUsage;
+HSPLandroid/icu/impl/number/Properties;->getDecimalSeparatorAlwaysShown()Z
+HSPLandroid/icu/impl/number/Properties;->getFormatWidth()I
+HSPLandroid/icu/impl/number/Properties;->getGroupingSize()I
+HSPLandroid/icu/impl/number/Properties;->getMagnitudeMultiplier()I
+HSPLandroid/icu/impl/number/Properties;->getMathContext()Ljava/math/MathContext;
+HSPLandroid/icu/impl/number/Properties;->getMaximumFractionDigits()I
+HSPLandroid/icu/impl/number/Properties;->getMaximumIntegerDigits()I
+HSPLandroid/icu/impl/number/Properties;->getMaximumSignificantDigits()I
+HSPLandroid/icu/impl/number/Properties;->getMeasureUnit()Landroid/icu/util/MeasureUnit;
+HSPLandroid/icu/impl/number/Properties;->getMinimumExponentDigits()I
+HSPLandroid/icu/impl/number/Properties;->getMinimumFractionDigits()I
+HSPLandroid/icu/impl/number/Properties;->getMinimumGroupingDigits()I
+HSPLandroid/icu/impl/number/Properties;->getMinimumIntegerDigits()I
+HSPLandroid/icu/impl/number/Properties;->getMinimumSignificantDigits()I
+HSPLandroid/icu/impl/number/Properties;->getMultiplier()Ljava/math/BigDecimal;
+HSPLandroid/icu/impl/number/Properties;->getNegativePrefix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/Properties;->getNegativePrefixPattern()Ljava/lang/String;
+HSPLandroid/icu/impl/number/Properties;->getNegativeSuffix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/Properties;->getNegativeSuffixPattern()Ljava/lang/String;
+HSPLandroid/icu/impl/number/Properties;->getPluralRules()Landroid/icu/text/PluralRules;
+HSPLandroid/icu/impl/number/Properties;->getPositivePrefix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/Properties;->getPositivePrefixPattern()Ljava/lang/String;
+HSPLandroid/icu/impl/number/Properties;->getPositiveSuffix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/Properties;->getPositiveSuffixPattern()Ljava/lang/String;
+HSPLandroid/icu/impl/number/Properties;->getRoundingIncrement()Ljava/math/BigDecimal;
+HSPLandroid/icu/impl/number/Properties;->getRoundingMode()Ljava/math/RoundingMode;
+HSPLandroid/icu/impl/number/Properties;->getSecondaryGroupingSize()I
+HSPLandroid/icu/impl/number/Properties;->getSignAlwaysShown()Z
+HSPLandroid/icu/impl/number/Properties;->getSignificantDigitsMode()Landroid/icu/text/DecimalFormat$SignificantDigitsMode;
+HSPLandroid/icu/impl/number/Properties;->setDecimalSeparatorAlwaysShown(Z)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setGroupingSize(I)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setMathContext(Ljava/math/MathContext;)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setMaximumFractionDigits(I)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setMaximumIntegerDigits(I)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setMinimumFractionDigits(I)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setMinimumGroupingDigits(I)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setMinimumIntegerDigits(I)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setNegativePrefix(Ljava/lang/String;)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setNegativeSuffix(Ljava/lang/String;)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setPositivePrefix(Ljava/lang/String;)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setPositiveSuffix(Ljava/lang/String;)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setRoundingMode(Ljava/math/RoundingMode;)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Properties;->setSecondaryGroupingSize(I)Landroid/icu/impl/number/Properties;
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->getMathContext()Ljava/math/MathContext;
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->getMaximumFractionDigits()I
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->getMaximumIntegerDigits()I
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->getMinimumFractionDigits()I
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->getMinimumIntegerDigits()I
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->getRoundingMode()Ljava/math/RoundingMode;
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->setMathContext(Ljava/math/MathContext;)Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->setMaximumFractionDigits(I)Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->setMaximumIntegerDigits(I)Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->setMinimumFractionDigits(I)Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->setMinimumIntegerDigits(I)Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;
+HSPLandroid/icu/impl/number/Rounder$IBasicRoundingProperties;->setRoundingMode(Ljava/math/RoundingMode;)Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;
+HSPLandroid/icu/impl/number/Rounder$MultiplierGenerator;->getMultiplier(I)I
+HSPLandroid/icu/impl/number/Rounder;-><init>(Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;)V
+HSPLandroid/icu/impl/number/Rounder;->applyDefaults(Landroid/icu/impl/number/FormatQuantity;)V
+HSPLandroid/icu/impl/number/Rounder;->export(Landroid/icu/impl/number/Properties;)V
+HSPLandroid/icu/impl/number/RoundingUtils;->getMathContextOrUnlimited(Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;)Ljava/math/MathContext;
+HSPLandroid/icu/impl/number/formatters/BigDecimalMultiplier$IProperties;->getMultiplier()Ljava/math/BigDecimal;
+HSPLandroid/icu/impl/number/formatters/BigDecimalMultiplier$IProperties;->setMultiplier(Ljava/math/BigDecimal;)Landroid/icu/impl/number/formatters/BigDecimalMultiplier$IProperties;
+HSPLandroid/icu/impl/number/formatters/BigDecimalMultiplier;->useMultiplier(Landroid/icu/impl/number/formatters/BigDecimalMultiplier$IProperties;)Z
+HSPLandroid/icu/impl/number/formatters/CompactDecimalFormat$IProperties;->getCompactCustomData()Ljava/util/Map;
+HSPLandroid/icu/impl/number/formatters/CompactDecimalFormat$IProperties;->getCompactStyle()Landroid/icu/text/CompactDecimalFormat$CompactStyle;
+HSPLandroid/icu/impl/number/formatters/CompactDecimalFormat$IProperties;->setCompactCustomData(Ljava/util/Map;)Landroid/icu/impl/number/formatters/CompactDecimalFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/CompactDecimalFormat$IProperties;->setCompactStyle(Landroid/icu/text/CompactDecimalFormat$CompactStyle;)Landroid/icu/impl/number/formatters/CompactDecimalFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/CompactDecimalFormat;->useCompactDecimalFormat(Landroid/icu/impl/number/formatters/CompactDecimalFormat$IProperties;)Z
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat$ICurrencyProperties;->getCurrency()Landroid/icu/util/Currency;
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat$ICurrencyProperties;->getCurrencyPluralInfo()Landroid/icu/text/CurrencyPluralInfo;
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat$ICurrencyProperties;->getCurrencyStyle()Landroid/icu/impl/number/formatters/CurrencyFormat$CurrencyStyle;
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat$ICurrencyProperties;->getCurrencyUsage()Landroid/icu/util/Currency$CurrencyUsage;
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat$ICurrencyProperties;->setCurrency(Landroid/icu/util/Currency;)Landroid/icu/impl/number/formatters/CurrencyFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat$ICurrencyProperties;->setCurrencyPluralInfo(Landroid/icu/text/CurrencyPluralInfo;)Landroid/icu/impl/number/formatters/CurrencyFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat$ICurrencyProperties;->setCurrencyStyle(Landroid/icu/impl/number/formatters/CurrencyFormat$CurrencyStyle;)Landroid/icu/impl/number/formatters/CurrencyFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat$ICurrencyProperties;->setCurrencyUsage(Landroid/icu/util/Currency$CurrencyUsage;)Landroid/icu/impl/number/formatters/CurrencyFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/CurrencyFormat;->useCurrency(Landroid/icu/impl/number/formatters/CurrencyFormat$IProperties;)Z
+HSPLandroid/icu/impl/number/formatters/MagnitudeMultiplier$IProperties;->getMagnitudeMultiplier()I
+HSPLandroid/icu/impl/number/formatters/MagnitudeMultiplier$IProperties;->setMagnitudeMultiplier(I)Landroid/icu/impl/number/formatters/MagnitudeMultiplier$IProperties;
+HSPLandroid/icu/impl/number/formatters/MagnitudeMultiplier;->useMagnitudeMultiplier(Landroid/icu/impl/number/formatters/MagnitudeMultiplier$IProperties;)Z
+HSPLandroid/icu/impl/number/formatters/MeasureFormat$IProperties;->getMeasureFormatWidth()Landroid/icu/text/MeasureFormat$FormatWidth;
+HSPLandroid/icu/impl/number/formatters/MeasureFormat$IProperties;->getMeasureUnit()Landroid/icu/util/MeasureUnit;
+HSPLandroid/icu/impl/number/formatters/MeasureFormat$IProperties;->setMeasureFormatWidth(Landroid/icu/text/MeasureFormat$FormatWidth;)Landroid/icu/impl/number/formatters/MeasureFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/MeasureFormat$IProperties;->setMeasureUnit(Landroid/icu/util/MeasureUnit;)Landroid/icu/impl/number/formatters/MeasureFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/MeasureFormat;->useMeasureFormat(Landroid/icu/impl/number/formatters/MeasureFormat$IProperties;)Z
+HSPLandroid/icu/impl/number/formatters/PaddingFormat$IProperties;->getFormatWidth()I
+HSPLandroid/icu/impl/number/formatters/PaddingFormat$IProperties;->getPadPosition()Landroid/icu/impl/number/formatters/PaddingFormat$PadPosition;
+HSPLandroid/icu/impl/number/formatters/PaddingFormat$IProperties;->getPadString()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PaddingFormat$IProperties;->setFormatWidth(I)Landroid/icu/impl/number/formatters/PaddingFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PaddingFormat$IProperties;->setPadPosition(Landroid/icu/impl/number/formatters/PaddingFormat$PadPosition;)Landroid/icu/impl/number/formatters/PaddingFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PaddingFormat$IProperties;->setPadString(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PaddingFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PaddingFormat;->usePadding(Landroid/icu/impl/number/formatters/PaddingFormat$IProperties;)Z
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;->getDecimalSeparatorAlwaysShown()Z
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;->getGroupingSize()I
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;->getMinimumGroupingDigits()I
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;->getSecondaryGroupingSize()I
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;->setDecimalSeparatorAlwaysShown(Z)Landroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;->setGroupingSize(I)Landroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;->setMinimumGroupingDigits(I)Landroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;->setSecondaryGroupingSize(I)Landroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat;-><init>(Landroid/icu/text/DecimalFormatSymbols;Landroid/icu/impl/number/formatters/PositiveDecimalFormat$IProperties;)V
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat;->addDigit(BLandroid/icu/impl/number/NumberStringBuilder;ILandroid/icu/text/NumberFormat$Field;)I
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat;->addFractionDigits(Landroid/icu/impl/number/FormatQuantity;Landroid/icu/impl/number/NumberStringBuilder;I)I
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat;->addIntegerDigits(Landroid/icu/impl/number/FormatQuantity;Landroid/icu/impl/number/NumberStringBuilder;I)I
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat;->export(Landroid/icu/impl/number/Properties;)V
+HSPLandroid/icu/impl/number/formatters/PositiveDecimalFormat;->target(Landroid/icu/impl/number/FormatQuantity;Landroid/icu/impl/number/NumberStringBuilder;I)I
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getNegativePrefix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getNegativePrefixPattern()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getNegativeSuffix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getNegativeSuffixPattern()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getPositivePrefix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getPositivePrefixPattern()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getPositiveSuffix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getPositiveSuffixPattern()Ljava/lang/String;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->getSignAlwaysShown()Z
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setNegativePrefix(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setNegativePrefixPattern(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setNegativeSuffix(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setNegativeSuffixPattern(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setPositivePrefix(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setPositivePrefixPattern(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setPositiveSuffix(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setPositiveSuffixPattern(Ljava/lang/String;)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;->setSignAlwaysShown(Z)Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/PositiveNegativeAffixFormat;->getInstance(Landroid/icu/text/DecimalFormatSymbols;Landroid/icu/impl/number/formatters/PositiveNegativeAffixFormat$IProperties;)Landroid/icu/impl/number/modifiers/PositiveNegativeAffixModifier;
+HSPLandroid/icu/impl/number/formatters/RoundingFormat;->getDefaultOrNoRounder(Landroid/icu/impl/number/formatters/RoundingFormat$IProperties;)Landroid/icu/impl/number/Rounder;
+HSPLandroid/icu/impl/number/formatters/RoundingFormat;->getDefaultOrNull(Landroid/icu/impl/number/formatters/RoundingFormat$IProperties;)Landroid/icu/impl/number/Rounder;
+HSPLandroid/icu/impl/number/formatters/ScientificFormat$IProperties;->getExponentSignAlwaysShown()Z
+HSPLandroid/icu/impl/number/formatters/ScientificFormat$IProperties;->getMinimumExponentDigits()I
+HSPLandroid/icu/impl/number/formatters/ScientificFormat$IProperties;->setExponentSignAlwaysShown(Z)Landroid/icu/impl/number/formatters/ScientificFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/ScientificFormat$IProperties;->setMinimumExponentDigits(I)Landroid/icu/impl/number/formatters/ScientificFormat$IProperties;
+HSPLandroid/icu/impl/number/formatters/ScientificFormat;->useScientificNotation(Landroid/icu/impl/number/formatters/ScientificFormat$IProperties;)Z
+HSPLandroid/icu/impl/number/modifiers/ConstantAffixModifier;->apply(Landroid/icu/impl/number/NumberStringBuilder;II)I
+HSPLandroid/icu/impl/number/modifiers/ConstantAffixModifier;->getPrefix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/modifiers/ConstantAffixModifier;->getSuffix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/modifiers/ConstantMultiFieldModifier;-><init>(Landroid/icu/impl/number/NumberStringBuilder;Landroid/icu/impl/number/NumberStringBuilder;Z)V
+HSPLandroid/icu/impl/number/modifiers/ConstantMultiFieldModifier;->contentEquals(Landroid/icu/impl/number/NumberStringBuilder;Landroid/icu/impl/number/NumberStringBuilder;)Z
+HSPLandroid/icu/impl/number/modifiers/ConstantMultiFieldModifier;->getPrefix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/modifiers/ConstantMultiFieldModifier;->getSuffix()Ljava/lang/String;
+HSPLandroid/icu/impl/number/modifiers/PositiveNegativeAffixModifier;-><init>(Landroid/icu/impl/number/Modifier$AffixModifier;Landroid/icu/impl/number/Modifier$AffixModifier;)V
+HSPLandroid/icu/impl/number/modifiers/PositiveNegativeAffixModifier;->export(Landroid/icu/impl/number/Properties;)V
+HSPLandroid/icu/impl/number/modifiers/PositiveNegativeAffixModifier;->exportPositiveNegative(Landroid/icu/impl/number/Properties;Landroid/icu/impl/number/Modifier;Landroid/icu/impl/number/Modifier;)V
+HSPLandroid/icu/impl/number/modifiers/PositiveNegativeAffixModifier;->getModifier(Z)Landroid/icu/impl/number/Modifier;
+HSPLandroid/icu/impl/number/rounders/IncrementRounder$IProperties;->getRoundingIncrement()Ljava/math/BigDecimal;
+HSPLandroid/icu/impl/number/rounders/IncrementRounder$IProperties;->setRoundingIncrement(Ljava/math/BigDecimal;)Landroid/icu/impl/number/rounders/IncrementRounder$IProperties;
+HSPLandroid/icu/impl/number/rounders/IncrementRounder;->useRoundingIncrement(Landroid/icu/impl/number/rounders/IncrementRounder$IProperties;)Z
+HSPLandroid/icu/impl/number/rounders/MagnitudeRounder;-><init>(Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;)V
+HSPLandroid/icu/impl/number/rounders/MagnitudeRounder;->apply(Landroid/icu/impl/number/FormatQuantity;)V
+HSPLandroid/icu/impl/number/rounders/MagnitudeRounder;->getInstance(Landroid/icu/impl/number/Rounder$IBasicRoundingProperties;)Landroid/icu/impl/number/rounders/MagnitudeRounder;
+HSPLandroid/icu/impl/number/rounders/MagnitudeRounder;->useFractionFormat(Landroid/icu/impl/number/rounders/MagnitudeRounder$IProperties;)Z
+HSPLandroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;->getMaximumSignificantDigits()I
+HSPLandroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;->getMinimumSignificantDigits()I
+HSPLandroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;->getSignificantDigitsMode()Landroid/icu/text/DecimalFormat$SignificantDigitsMode;
+HSPLandroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;->setMaximumSignificantDigits(I)Landroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;
+HSPLandroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;->setMinimumSignificantDigits(I)Landroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;
+HSPLandroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;->setSignificantDigitsMode(Landroid/icu/text/DecimalFormat$SignificantDigitsMode;)Landroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;
+HSPLandroid/icu/impl/number/rounders/SignificantDigitsRounder;->useSignificantDigits(Landroid/icu/impl/number/rounders/SignificantDigitsRounder$IProperties;)Z
+HSPLandroid/icu/text/DecimalFormat;->refreshFormatter()V
+HSPLandroid/icu/text/LocaleDisplayNames;->getContext(Landroid/icu/text/DisplayContext$Type;)Landroid/icu/text/DisplayContext;
+HSPLandroid/icu/text/LocaleDisplayNames;->getDialectHandling()Landroid/icu/text/LocaleDisplayNames$DialectHandling;
+HSPLandroid/icu/text/LocaleDisplayNames;->getLocale()Landroid/icu/util/ULocale;
+HSPLandroid/icu/text/LocaleDisplayNames;->getUiListCompareWholeItems(Ljava/util/Set;Ljava/util/Comparator;)Ljava/util/List;
+HSPLandroid/icu/text/LocaleDisplayNames;->keyDisplayName(Ljava/lang/String;)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->keyValueDisplayName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->languageDisplayName(Ljava/lang/String;)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->localeDisplayName(Landroid/icu/util/ULocale;)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->localeDisplayName(Ljava/lang/String;)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->localeDisplayName(Ljava/util/Locale;)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->regionDisplayName(Ljava/lang/String;)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->scriptDisplayName(I)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->scriptDisplayName(Ljava/lang/String;)Ljava/lang/String;
+HSPLandroid/icu/text/LocaleDisplayNames;->variantDisplayName(Ljava/lang/String;)Ljava/lang/String;
+HSPLandroid/icu/text/TimeZoneNames$Cache;-><init>(Landroid/icu/text/TimeZoneNames$1;)V
+HSPLandroid/icu/text/TimeZoneNames;->getAvailableMetaZoneIDs()Ljava/util/Set;
+HSPLandroid/icu/text/TimeZoneNames;->getAvailableMetaZoneIDs(Ljava/lang/String;)Ljava/util/Set;
+HSPLandroid/icu/text/TimeZoneNames;->getMetaZoneDisplayName(Ljava/lang/String;Landroid/icu/text/TimeZoneNames$NameType;)Ljava/lang/String;
+HSPLandroid/icu/text/TimeZoneNames;->getMetaZoneID(Ljava/lang/String;J)Ljava/lang/String;
+HSPLandroid/icu/text/TimeZoneNames;->getReferenceZoneID(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+HSPLandroid/icu/text/TimeZoneNames;->getTimeZoneDisplayName(Ljava/lang/String;Landroid/icu/text/TimeZoneNames$NameType;)Ljava/lang/String;
+HSPLandroid/location/IGnssStatusProvider;->registerGnssStatusCallback(Landroid/location/IGnssStatusListener;)V
+HSPLandroid/location/IGnssStatusProvider;->unregisterGnssStatusCallback(Landroid/location/IGnssStatusListener;)V
+HSPLandroid/location/IGpsGeofenceHardware;->addCircularHardwareGeofence(IDDDIIII)Z
+HSPLandroid/location/IGpsGeofenceHardware;->isHardwareGeofenceSupported()Z
+HSPLandroid/location/IGpsGeofenceHardware;->pauseHardwareGeofence(I)Z
+HSPLandroid/location/IGpsGeofenceHardware;->removeHardwareGeofence(I)Z
+HSPLandroid/location/IGpsGeofenceHardware;->resumeHardwareGeofence(II)Z
+HSPLandroid/location/INetInitiatedListener;->sendNiResponse(II)Z
+HSPLandroid/media/AudioManager$OnAudioPortUpdateListener;->onAudioPatchListUpdate([Landroid/media/AudioPatch;)V
+HSPLandroid/media/AudioManager$OnAudioPortUpdateListener;->onAudioPortListUpdate([Landroid/media/AudioPort;)V
+HSPLandroid/media/AudioManager$OnAudioPortUpdateListener;->onServiceDied()V
+HSPLandroid/media/AudioManagerInternal$RingerModeDelegate;->canVolumeDownEnterSilent()Z
+HSPLandroid/media/AudioManagerInternal$RingerModeDelegate;->getRingerModeAffectedStreams(I)I
+HSPLandroid/media/AudioManagerInternal$RingerModeDelegate;->onSetRingerModeExternal(IILjava/lang/String;ILandroid/media/VolumePolicy;)I
+HSPLandroid/media/AudioManagerInternal$RingerModeDelegate;->onSetRingerModeInternal(IILjava/lang/String;ILandroid/media/VolumePolicy;)I
+HSPLandroid/media/AudioManagerInternal;->adjustStreamVolumeForUid(IIILjava/lang/String;I)V
+HSPLandroid/media/AudioManagerInternal;->adjustSuggestedStreamVolumeForUid(IIILjava/lang/String;I)V
+HSPLandroid/media/AudioManagerInternal;->getRingerModeInternal()I
+HSPLandroid/media/AudioManagerInternal;->setAccessibilityServiceUids(Landroid/util/IntArray;)V
+HSPLandroid/media/AudioManagerInternal;->setRingerModeDelegate(Landroid/media/AudioManagerInternal$RingerModeDelegate;)V
+HSPLandroid/media/AudioManagerInternal;->setRingerModeInternal(ILjava/lang/String;)V
+HSPLandroid/media/AudioManagerInternal;->setStreamVolumeForUid(IIILjava/lang/String;I)V
+HSPLandroid/media/AudioManagerInternal;->updateRingerModeAffectedStreamsInternal()V
+HSPLandroid/media/AudioPlaybackConfiguration$PlayerDeathMonitor;->playerDeath(I)V
+HSPLandroid/media/AudioSystem$AudioRecordingCallback;->onRecordingConfigurationChanged(IIII[ILjava/lang/String;)V
+HSPLandroid/media/AudioSystem$DynamicPolicyCallback;->onDynamicPolicyMixStateUpdate(Ljava/lang/String;I)V
+HSPLandroid/media/AudioSystem$ErrorCallback;->onError(I)V
+HSPLandroid/media/IMediaResourceMonitor;->notifyResourceGranted(II)V
+HSPLandroid/media/IRemoteVolumeController;->remoteVolumeChanged(Landroid/media/session/ISessionController;I)V
+HSPLandroid/media/IRemoteVolumeController;->updateRemoteController(Landroid/media/session/ISessionController;)V
+HSPLandroid/media/IVolumeController;->dismiss()V
+HSPLandroid/media/IVolumeController;->displaySafeVolumeWarning(I)V
+HSPLandroid/media/IVolumeController;->masterMuteChanged(I)V
+HSPLandroid/media/IVolumeController;->setA11yMode(I)V
+HSPLandroid/media/IVolumeController;->setLayoutDirection(I)V
+HSPLandroid/media/IVolumeController;->volumeChanged(II)V
+HSPLandroid/media/SoundPool$OnLoadCompleteListener;->onLoadComplete(Landroid/media/SoundPool;II)V
+HSPLandroid/media/midi/IMidiManager;->closeDevice(Landroid/os/IBinder;Landroid/os/IBinder;)V
+HSPLandroid/media/midi/IMidiManager;->getDeviceStatus(Landroid/media/midi/MidiDeviceInfo;)Landroid/media/midi/MidiDeviceStatus;
+HSPLandroid/media/midi/IMidiManager;->getDevices()[Landroid/media/midi/MidiDeviceInfo;
+HSPLandroid/media/midi/IMidiManager;->getServiceDeviceInfo(Ljava/lang/String;Ljava/lang/String;)Landroid/media/midi/MidiDeviceInfo;
+HSPLandroid/media/midi/IMidiManager;->openBluetoothDevice(Landroid/os/IBinder;Landroid/bluetooth/BluetoothDevice;Landroid/media/midi/IMidiDeviceOpenCallback;)V
+HSPLandroid/media/midi/IMidiManager;->openDevice(Landroid/os/IBinder;Landroid/media/midi/MidiDeviceInfo;Landroid/media/midi/IMidiDeviceOpenCallback;)V
+HSPLandroid/media/midi/IMidiManager;->registerDeviceServer(Landroid/media/midi/IMidiDeviceServer;II[Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;I)Landroid/media/midi/MidiDeviceInfo;
+HSPLandroid/media/midi/IMidiManager;->registerListener(Landroid/os/IBinder;Landroid/media/midi/IMidiDeviceListener;)V
+HSPLandroid/media/midi/IMidiManager;->setDeviceStatus(Landroid/media/midi/IMidiDeviceServer;Landroid/media/midi/MidiDeviceStatus;)V
+HSPLandroid/media/midi/IMidiManager;->unregisterDeviceServer(Landroid/media/midi/IMidiDeviceServer;)V
+HSPLandroid/media/midi/IMidiManager;->unregisterListener(Landroid/os/IBinder;Landroid/media/midi/IMidiDeviceListener;)V
+HSPLandroid/media/projection/IMediaProjectionManager;->addCallback(Landroid/media/projection/IMediaProjectionWatcherCallback;)V
+HSPLandroid/media/projection/IMediaProjectionManager;->createProjection(ILjava/lang/String;IZ)Landroid/media/projection/IMediaProjection;
+HSPLandroid/media/projection/IMediaProjectionManager;->getActiveProjectionInfo()Landroid/media/projection/MediaProjectionInfo;
+HSPLandroid/media/projection/IMediaProjectionManager;->hasProjectionPermission(ILjava/lang/String;)Z
+HSPLandroid/media/projection/IMediaProjectionManager;->isValidMediaProjection(Landroid/media/projection/IMediaProjection;)Z
+HSPLandroid/media/projection/IMediaProjectionManager;->removeCallback(Landroid/media/projection/IMediaProjectionWatcherCallback;)V
+HSPLandroid/media/projection/IMediaProjectionManager;->stopActiveProjection()V
+HSPLandroid/media/projection/IMediaProjectionWatcherCallback;->onStart(Landroid/media/projection/MediaProjectionInfo;)V
+HSPLandroid/media/projection/IMediaProjectionWatcherCallback;->onStop(Landroid/media/projection/MediaProjectionInfo;)V
+HSPLandroid/media/session/ICallback;->onAddressedPlayerChangedToMediaButtonReceiver(Landroid/content/ComponentName;)V
+HSPLandroid/media/session/ICallback;->onAddressedPlayerChangedToMediaSession(Landroid/media/session/MediaSession$Token;)V
+HSPLandroid/media/session/ICallback;->onMediaKeyEventDispatchedToMediaButtonReceiver(Landroid/view/KeyEvent;Landroid/content/ComponentName;)V
+HSPLandroid/media/session/ICallback;->onMediaKeyEventDispatchedToMediaSession(Landroid/view/KeyEvent;Landroid/media/session/MediaSession$Token;)V
+HSPLandroid/net/ConnectivityManager$OnNetworkActiveListener;->onNetworkActive()V
+HSPLandroid/net/ConnectivityThread;->access$000()Landroid/net/ConnectivityThread;
+HSPLandroid/net/IEthernetManager;->addListener(Landroid/net/IEthernetServiceListener;)V
+HSPLandroid/net/IEthernetManager;->getConfiguration()Landroid/net/IpConfiguration;
+HSPLandroid/net/IEthernetManager;->isAvailable()Z
+HSPLandroid/net/IEthernetManager;->removeListener(Landroid/net/IEthernetServiceListener;)V
+HSPLandroid/net/IEthernetManager;->setConfiguration(Landroid/net/IpConfiguration;)V
+HSPLandroid/net/IEthernetServiceListener;->onAvailabilityChanged(Z)V
+HSPLandroid/net/IIpConnectivityMetrics;->logEvent(Landroid/net/ConnectivityMetricsEvent;)I
+HSPLandroid/net/IIpConnectivityMetrics;->registerNetdEventCallback(Landroid/net/INetdEventCallback;)Z
+HSPLandroid/net/IIpConnectivityMetrics;->unregisterNetdEventCallback()Z
+HSPLandroid/net/INetd$Stub$Proxy;->tetherGetStats()Landroid/os/PersistableBundle;
+HSPLandroid/net/INetd;->addPrivateDnsServer(Ljava/lang/String;ILjava/lang/String;[Ljava/lang/String;)V
+HSPLandroid/net/INetd;->bandwidthEnableDataSaver(Z)Z
+HSPLandroid/net/INetd;->firewallReplaceUidChain(Ljava/lang/String;Z[I)Z
+HSPLandroid/net/INetd;->getMetricsReportingLevel()I
+HSPLandroid/net/INetd;->getResolverInfo(I[Ljava/lang/String;[Ljava/lang/String;[I[I)V
+HSPLandroid/net/INetd;->interfaceAddAddress(Ljava/lang/String;Ljava/lang/String;I)V
+HSPLandroid/net/INetd;->interfaceDelAddress(Ljava/lang/String;Ljava/lang/String;I)V
+HSPLandroid/net/INetd;->ipSecAddSecurityAssociation(IIILjava/lang/String;Ljava/lang/String;JILjava/lang/String;[BILjava/lang/String;[BIIII)V
+HSPLandroid/net/INetd;->ipSecAllocateSpi(IILjava/lang/String;Ljava/lang/String;I)I
+HSPLandroid/net/INetd;->ipSecApplyTransportModeTransform(Ljava/io/FileDescriptor;IILjava/lang/String;Ljava/lang/String;I)V
+HSPLandroid/net/INetd;->ipSecDeleteSecurityAssociation(IILjava/lang/String;Ljava/lang/String;I)V
+HSPLandroid/net/INetd;->ipSecRemoveTransportModeTransform(Ljava/io/FileDescriptor;)V
+HSPLandroid/net/INetd;->isAlive()Z
+HSPLandroid/net/INetd;->networkRejectNonSecureVpn(Z[Landroid/net/UidRange;)V
+HSPLandroid/net/INetd;->removePrivateDnsServer(Ljava/lang/String;)V
+HSPLandroid/net/INetd;->setIPv6AddrGenMode(Ljava/lang/String;I)V
+HSPLandroid/net/INetd;->setMetricsReportingLevel(I)V
+HSPLandroid/net/INetd;->setProcSysNet(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/net/INetd;->setResolverConfiguration(I[Ljava/lang/String;[Ljava/lang/String;[I)V
+HSPLandroid/net/INetd;->socketDestroy([Landroid/net/UidRange;[I)V
+HSPLandroid/net/INetd;->tetherApplyDnsInterfaces()Z
+HSPLandroid/net/INetd;->tetherGetStats()Landroid/os/PersistableBundle;
+HSPLandroid/net/INetd;->wakeupAddInterface(Ljava/lang/String;Ljava/lang/String;II)V
+HSPLandroid/net/INetd;->wakeupDelInterface(Ljava/lang/String;Ljava/lang/String;II)V
+HSPLandroid/net/INetworkScoreCache;->clearScores()V
+HSPLandroid/net/INetworkScoreCache;->updateScores(Ljava/util/List;)V
+HSPLandroid/net/NetworkStats$NonMonotonicObserver;->foundNonMonotonic(Landroid/net/NetworkStats;ILandroid/net/NetworkStats;ILjava/lang/Object;)V
+HSPLandroid/net/nsd/INsdManager;->getMessenger()Landroid/os/Messenger;
+HSPLandroid/net/nsd/INsdManager;->setEnabled(Z)V
+HSPLandroid/net/wifi/IRttManager;->getMessenger(Landroid/os/IBinder;[I)Landroid/os/Messenger;
+HSPLandroid/net/wifi/IRttManager;->getRttCapabilities()Landroid/net/wifi/RttManager$RttCapabilities;
+HSPLandroid/net/wifi/IWifiScanner;->getAvailableChannels(I)Landroid/os/Bundle;
+HSPLandroid/net/wifi/IWifiScanner;->getMessenger()Landroid/os/Messenger;
+HSPLandroid/net/wifi/WifiScanner$PnoScanListener;->onPnoNetworkFound([Landroid/net/wifi/ScanResult;)V
+HSPLandroid/net/wifi/p2p/IWifiP2pManager;->checkConfigureWifiDisplayPermission()V
+HSPLandroid/net/wifi/p2p/IWifiP2pManager;->close(Landroid/os/IBinder;)V
+HSPLandroid/net/wifi/p2p/IWifiP2pManager;->getMessenger(Landroid/os/IBinder;)Landroid/os/Messenger;
+HSPLandroid/net/wifi/p2p/IWifiP2pManager;->getP2pStateMachineMessenger()Landroid/os/Messenger;
+HSPLandroid/net/wifi/p2p/IWifiP2pManager;->setMiracastMode(I)V
+HSPLandroid/net/wifi/p2p/WifiP2pGroupList$2;-><init>()V
+HSPLandroid/net/wifi/p2p/WifiP2pGroupList$GroupDeleteListener;->onDeleteGroup(I)V
+HSPLandroid/os/BatteryManagerInternal;->getBatteryLevel()I
+HSPLandroid/os/BatteryManagerInternal;->getBatteryLevelLow()Z
+HSPLandroid/os/BatteryManagerInternal;->getInvalidCharger()I
+HSPLandroid/os/BatteryManagerInternal;->getPlugType()I
+HSPLandroid/os/BatteryManagerInternal;->isPowered(I)Z
+HSPLandroid/os/BatteryStats$$Lambda$0;-><init>()V
+HSPLandroid/os/BatteryStats$$Lambda$1;-><init>()V
+HSPLandroid/os/BatteryStats$DailyItem;-><init>()V
+HSPLandroid/os/BatteryStats$LevelStepTracker;->decodeEntryAt(ILjava/lang/String;)V
+HSPLandroid/os/BatteryStats;->commitCurrentHistoryBatchLocked()V
+HSPLandroid/os/BatteryStats;->computeBatteryRealtime(JI)J
+HSPLandroid/os/BatteryStats;->computeBatteryScreenOffRealtime(JI)J
+HSPLandroid/os/BatteryStats;->computeBatteryScreenOffUptime(JI)J
+HSPLandroid/os/BatteryStats;->computeBatteryTimeRemaining(J)J
+HSPLandroid/os/BatteryStats;->computeBatteryUptime(JI)J
+HSPLandroid/os/BatteryStats;->computeChargeTimeRemaining(J)J
+HSPLandroid/os/BatteryStats;->computeRealtime(JI)J
+HSPLandroid/os/BatteryStats;->computeUptime(JI)J
+HSPLandroid/os/BatteryStats;->finishIteratingHistoryLocked()V
+HSPLandroid/os/BatteryStats;->finishIteratingOldHistoryLocked()V
+HSPLandroid/os/BatteryStats;->getBatteryRealtime(J)J
+HSPLandroid/os/BatteryStats;->getBatteryUptime(J)J
+HSPLandroid/os/BatteryStats;->getBluetoothControllerActivity()Landroid/os/BatteryStats$ControllerActivityCounter;
+HSPLandroid/os/BatteryStats;->getBluetoothScanTime(JI)J
+HSPLandroid/os/BatteryStats;->getCameraOnTime(JI)J
+HSPLandroid/os/BatteryStats;->getChargeLevelStepTracker()Landroid/os/BatteryStats$LevelStepTracker;
+HSPLandroid/os/BatteryStats;->getCpuFreqs()[J
+HSPLandroid/os/BatteryStats;->getCurrentDailyStartTime()J
+HSPLandroid/os/BatteryStats;->getDailyChargeLevelStepTracker()Landroid/os/BatteryStats$LevelStepTracker;
+HSPLandroid/os/BatteryStats;->getDailyDischargeLevelStepTracker()Landroid/os/BatteryStats$LevelStepTracker;
+HSPLandroid/os/BatteryStats;->getDailyItemLocked(I)Landroid/os/BatteryStats$DailyItem;
+HSPLandroid/os/BatteryStats;->getDailyPackageChanges()Ljava/util/ArrayList;
+HSPLandroid/os/BatteryStats;->getDeviceIdleModeCount(II)I
+HSPLandroid/os/BatteryStats;->getDeviceIdleModeTime(IJI)J
+HSPLandroid/os/BatteryStats;->getDeviceIdlingCount(II)I
+HSPLandroid/os/BatteryStats;->getDeviceIdlingTime(IJI)J
+HSPLandroid/os/BatteryStats;->getDischargeAmount(I)I
+HSPLandroid/os/BatteryStats;->getDischargeAmountScreenOff()I
+HSPLandroid/os/BatteryStats;->getDischargeAmountScreenOffSinceCharge()I
+HSPLandroid/os/BatteryStats;->getDischargeAmountScreenOn()I
+HSPLandroid/os/BatteryStats;->getDischargeAmountScreenOnSinceCharge()I
+HSPLandroid/os/BatteryStats;->getDischargeCoulombCounter()Landroid/os/BatteryStats$LongCounter;
+HSPLandroid/os/BatteryStats;->getDischargeCurrentLevel()I
+HSPLandroid/os/BatteryStats;->getDischargeLevelStepTracker()Landroid/os/BatteryStats$LevelStepTracker;
+HSPLandroid/os/BatteryStats;->getDischargeScreenOffCoulombCounter()Landroid/os/BatteryStats$LongCounter;
+HSPLandroid/os/BatteryStats;->getDischargeStartLevel()I
+HSPLandroid/os/BatteryStats;->getEndPlatformVersion()Ljava/lang/String;
+HSPLandroid/os/BatteryStats;->getEstimatedBatteryCapacity()I
+HSPLandroid/os/BatteryStats;->getFlashlightOnCount(I)J
+HSPLandroid/os/BatteryStats;->getFlashlightOnTime(JI)J
+HSPLandroid/os/BatteryStats;->getGlobalWifiRunningTime(JI)J
+HSPLandroid/os/BatteryStats;->getHighDischargeAmountSinceCharge()I
+HSPLandroid/os/BatteryStats;->getHistoryBaseTime()J
+HSPLandroid/os/BatteryStats;->getHistoryStringPoolBytes()I
+HSPLandroid/os/BatteryStats;->getHistoryStringPoolSize()I
+HSPLandroid/os/BatteryStats;->getHistoryTagPoolString(I)Ljava/lang/String;
+HSPLandroid/os/BatteryStats;->getHistoryTagPoolUid(I)I
+HSPLandroid/os/BatteryStats;->getHistoryTotalSize()I
+HSPLandroid/os/BatteryStats;->getHistoryUsedSize()I
+HSPLandroid/os/BatteryStats;->getInteractiveTime(JI)J
+HSPLandroid/os/BatteryStats;->getIsOnBattery()Z
+HSPLandroid/os/BatteryStats;->getKernelMemoryStats()Landroid/util/LongSparseArray;
+HSPLandroid/os/BatteryStats;->getKernelWakelockStats()Ljava/util/Map;
+HSPLandroid/os/BatteryStats;->getLongestDeviceIdleModeTime(I)J
+HSPLandroid/os/BatteryStats;->getLowDischargeAmountSinceCharge()I
+HSPLandroid/os/BatteryStats;->getMaxLearnedBatteryCapacity()I
+HSPLandroid/os/BatteryStats;->getMinLearnedBatteryCapacity()I
+HSPLandroid/os/BatteryStats;->getMobileRadioActiveAdjustedTime(I)J
+HSPLandroid/os/BatteryStats;->getMobileRadioActiveCount(I)I
+HSPLandroid/os/BatteryStats;->getMobileRadioActiveTime(JI)J
+HSPLandroid/os/BatteryStats;->getMobileRadioActiveUnknownCount(I)I
+HSPLandroid/os/BatteryStats;->getMobileRadioActiveUnknownTime(I)J
+HSPLandroid/os/BatteryStats;->getModemControllerActivity()Landroid/os/BatteryStats$ControllerActivityCounter;
+HSPLandroid/os/BatteryStats;->getNetworkActivityBytes(II)J
+HSPLandroid/os/BatteryStats;->getNetworkActivityPackets(II)J
+HSPLandroid/os/BatteryStats;->getNextHistoryLocked(Landroid/os/BatteryStats$HistoryItem;)Z
+HSPLandroid/os/BatteryStats;->getNextMaxDailyDeadline()J
+HSPLandroid/os/BatteryStats;->getNextMinDailyDeadline()J
+HSPLandroid/os/BatteryStats;->getNextOldHistoryLocked(Landroid/os/BatteryStats$HistoryItem;)Z
+HSPLandroid/os/BatteryStats;->getNumConnectivityChange(I)I
+HSPLandroid/os/BatteryStats;->getParcelVersion()I
+HSPLandroid/os/BatteryStats;->getPhoneDataConnectionCount(II)I
+HSPLandroid/os/BatteryStats;->getPhoneDataConnectionTime(IJI)J
+HSPLandroid/os/BatteryStats;->getPhoneOnCount(I)I
+HSPLandroid/os/BatteryStats;->getPhoneOnTime(JI)J
+HSPLandroid/os/BatteryStats;->getPhoneSignalScanningTime(JI)J
+HSPLandroid/os/BatteryStats;->getPhoneSignalStrengthCount(II)I
+HSPLandroid/os/BatteryStats;->getPhoneSignalStrengthTime(IJI)J
+HSPLandroid/os/BatteryStats;->getPowerSaveModeEnabledCount(I)I
+HSPLandroid/os/BatteryStats;->getPowerSaveModeEnabledTime(JI)J
+HSPLandroid/os/BatteryStats;->getScreenBrightnessTime(IJI)J
+HSPLandroid/os/BatteryStats;->getScreenOnCount(I)I
+HSPLandroid/os/BatteryStats;->getScreenOnTime(JI)J
+HSPLandroid/os/BatteryStats;->getStartClockTime()J
+HSPLandroid/os/BatteryStats;->getStartCount()I
+HSPLandroid/os/BatteryStats;->getStartPlatformVersion()Ljava/lang/String;
+HSPLandroid/os/BatteryStats;->getUidStats()Landroid/util/SparseArray;
+HSPLandroid/os/BatteryStats;->getWakeupReasonStats()Ljava/util/Map;
+HSPLandroid/os/BatteryStats;->getWifiControllerActivity()Landroid/os/BatteryStats$ControllerActivityCounter;
+HSPLandroid/os/BatteryStats;->getWifiOnTime(JI)J
+HSPLandroid/os/BatteryStats;->getWifiSignalStrengthCount(II)I
+HSPLandroid/os/BatteryStats;->getWifiSignalStrengthTime(IJI)J
+HSPLandroid/os/BatteryStats;->getWifiStateCount(II)I
+HSPLandroid/os/BatteryStats;->getWifiStateTime(IJI)J
+HSPLandroid/os/BatteryStats;->getWifiSupplStateCount(II)I
+HSPLandroid/os/BatteryStats;->getWifiSupplStateTime(IJI)J
+HSPLandroid/os/BatteryStats;->hasBluetoothActivityReporting()Z
+HSPLandroid/os/BatteryStats;->hasModemActivityReporting()Z
+HSPLandroid/os/BatteryStats;->hasWifiActivityReporting()Z
+HSPLandroid/os/BatteryStats;->startIteratingHistoryLocked()Z
+HSPLandroid/os/BatteryStats;->startIteratingOldHistoryLocked()Z
+HSPLandroid/os/BatteryStats;->writeToParcelWithoutUids(Landroid/os/Parcel;I)V
+HSPLandroid/os/CommonTimeConfig$OnServerDiedListener;->onServerDied()V
+HSPLandroid/os/Handler;->hasMessagesOrCallbacks()Z
+HSPLandroid/os/IBatteryPropertiesListener;->batteryPropertiesChanged(Landroid/os/BatteryProperties;)V
+HSPLandroid/os/IBinder$DeathRecipient;->binderDied()V
+HSPLandroid/os/IDeviceIdentifiersPolicyService;->getSerial()Ljava/lang/String;
+HSPLandroid/os/IIncidentManager$Stub$Proxy;->systemRunning()V
+HSPLandroid/os/IIncidentManager;->reportIncident(Landroid/os/IncidentReportArgs;)V
+HSPLandroid/os/IIncidentManager;->reportIncidentToStream(Landroid/os/IncidentReportArgs;Landroid/os/IIncidentReportStatusListener;Ljava/io/FileDescriptor;)V
+HSPLandroid/os/IIncidentManager;->systemRunning()V
+HSPLandroid/os/IInstalld;->clearAppData(Ljava/lang/String;Ljava/lang/String;IIJ)V
+HSPLandroid/os/IInstalld;->clearAppProfiles(Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->copySystemProfile(Ljava/lang/String;ILjava/lang/String;)Z
+HSPLandroid/os/IInstalld;->createAppData(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;I)J
+HSPLandroid/os/IInstalld;->createOatDir(Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->createUserData(Ljava/lang/String;III)V
+HSPLandroid/os/IInstalld;->deleteOdex(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->destroyAppData(Ljava/lang/String;Ljava/lang/String;IIJ)V
+HSPLandroid/os/IInstalld;->destroyAppProfiles(Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->destroyUserData(Ljava/lang/String;II)V
+HSPLandroid/os/IInstalld;->dexopt(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V
+HSPLandroid/os/IInstalld;->dumpProfiles(ILjava/lang/String;Ljava/lang/String;)Z
+HSPLandroid/os/IInstalld;->fixupAppData(Ljava/lang/String;I)V
+HSPLandroid/os/IInstalld;->freeCache(Ljava/lang/String;JJI)V
+HSPLandroid/os/IInstalld;->getAppSize(Ljava/lang/String;[Ljava/lang/String;III[J[Ljava/lang/String;)[J
+HSPLandroid/os/IInstalld;->getExternalSize(Ljava/lang/String;II[I)[J
+HSPLandroid/os/IInstalld;->getUserSize(Ljava/lang/String;II[I)[J
+HSPLandroid/os/IInstalld;->idmap(Ljava/lang/String;Ljava/lang/String;I)V
+HSPLandroid/os/IInstalld;->invalidateMounts()V
+HSPLandroid/os/IInstalld;->isQuotaSupported(Ljava/lang/String;)Z
+HSPLandroid/os/IInstalld;->linkFile(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->linkNativeLibraryDirectory(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
+HSPLandroid/os/IInstalld;->markBootComplete(Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->mergeProfiles(ILjava/lang/String;)Z
+HSPLandroid/os/IInstalld;->migrateAppData(Ljava/lang/String;Ljava/lang/String;II)V
+HSPLandroid/os/IInstalld;->moveAb(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->moveCompleteApp(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;I)V
+HSPLandroid/os/IInstalld;->reconcileSecondaryDexFile(Ljava/lang/String;Ljava/lang/String;I[Ljava/lang/String;Ljava/lang/String;I)Z
+HSPLandroid/os/IInstalld;->removeIdmap(Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->restoreconAppData(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;)V
+HSPLandroid/os/IInstalld;->rmPackageDir(Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->rmdex(Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/os/IInstalld;->setAppQuota(Ljava/lang/String;IIJ)V
+HSPLandroid/os/IPermissionController;->checkPermission(Ljava/lang/String;II)Z
+HSPLandroid/os/IPermissionController;->getPackagesForUid(I)[Ljava/lang/String;
+HSPLandroid/os/IPermissionController;->isRuntimePermission(Ljava/lang/String;)Z
+HSPLandroid/os/IProcessInfoService;->getProcessStatesAndOomScoresFromPids([I[I[I)V
+HSPLandroid/os/IProcessInfoService;->getProcessStatesFromPids([I[I)V
+HSPLandroid/os/IRecoverySystem;->clearBcb()Z
+HSPLandroid/os/IRecoverySystem;->rebootRecoveryWithCommand(Ljava/lang/String;)V
+HSPLandroid/os/IRecoverySystem;->setupBcb(Ljava/lang/String;)Z
+HSPLandroid/os/IRecoverySystem;->uncrypt(Ljava/lang/String;Landroid/os/IRecoverySystemProgressListener;)Z
+HSPLandroid/os/ISchedulingPolicyService;->requestPriority(IIIZ)I
+HSPLandroid/os/IUpdateLock;->acquireUpdateLock(Landroid/os/IBinder;Ljava/lang/String;)V
+HSPLandroid/os/IUpdateLock;->releaseUpdateLock(Landroid/os/IBinder;)V
+HSPLandroid/os/MessageQueue;->hasMessages(Landroid/os/Handler;)Z
+HSPLandroid/os/Parcelable;->describeContents()I
+HSPLandroid/os/Parcelable;->writeToParcel(Landroid/os/Parcel;I)V
+HSPLandroid/os/PowerManagerInternal;->finishUidChanges()V
+HSPLandroid/os/PowerManagerInternal;->getLowPowerState(I)Landroid/os/PowerSaveState;
+HSPLandroid/os/PowerManagerInternal;->powerHint(II)V
+HSPLandroid/os/PowerManagerInternal;->registerLowPowerModeObserver(Landroid/os/PowerManagerInternal$LowPowerModeListener;)V
+HSPLandroid/os/PowerManagerInternal;->setDeviceIdleMode(Z)Z
+HSPLandroid/os/PowerManagerInternal;->setDeviceIdleTempWhitelist([I)V
+HSPLandroid/os/PowerManagerInternal;->setDeviceIdleWhitelist([I)V
+HSPLandroid/os/PowerManagerInternal;->setDozeOverrideFromDreamManager(II)V
+HSPLandroid/os/PowerManagerInternal;->setLightDeviceIdleMode(Z)Z
+HSPLandroid/os/PowerManagerInternal;->setMaximumScreenOffTimeoutFromDeviceAdmin(I)V
+HSPLandroid/os/PowerManagerInternal;->setScreenBrightnessOverrideFromWindowManager(I)V
+HSPLandroid/os/PowerManagerInternal;->setUserActivityTimeoutOverrideFromWindowManager(J)V
+HSPLandroid/os/PowerManagerInternal;->setUserInactiveOverrideFromWindowManager()V
+HSPLandroid/os/PowerManagerInternal;->startUidChanges()V
+HSPLandroid/os/PowerManagerInternal;->uidActive(I)V
+HSPLandroid/os/PowerManagerInternal;->uidGone(I)V
+HSPLandroid/os/PowerManagerInternal;->uidIdle(I)V
+HSPLandroid/os/PowerManagerInternal;->updateUidProcState(II)V
+HSPLandroid/os/PowerManagerInternal;->wakefulnessToString(I)Ljava/lang/String;
+HSPLandroid/os/RemoteCallback$OnResultListener;->onResult(Landroid/os/Bundle;)V
+HSPLandroid/os/StrictMode$5;->run()V
+HSPLandroid/os/StrictMode$8;->initialValue()Landroid/os/StrictMode$ThreadSpanState;
+HSPLandroid/os/StrictMode$8;->initialValue()Ljava/lang/Object;
+HSPLandroid/os/StrictMode$ThreadSpanState;-><init>(Landroid/os/StrictMode$1;)V
+HSPLandroid/os/StrictMode;->access$1600()Ljava/util/concurrent/atomic/AtomicInteger;
+HSPLandroid/os/StrictMode;->access$900()Z
+HSPLandroid/os/UserManagerInternal;->addUserRestrictionsListener(Landroid/os/UserManagerInternal$UserRestrictionsListener;)V
+HSPLandroid/os/UserManagerInternal;->createUserEvenWhenDisallowed(Ljava/lang/String;I)Landroid/content/pm/UserInfo;
+HSPLandroid/os/UserManagerInternal;->getBaseUserRestrictions(I)Landroid/os/Bundle;
+HSPLandroid/os/UserManagerInternal;->getUserIds()[I
+HSPLandroid/os/UserManagerInternal;->getUserRestriction(ILjava/lang/String;)Z
+HSPLandroid/os/UserManagerInternal;->isUserRunning(I)Z
+HSPLandroid/os/UserManagerInternal;->isUserUnlocked(I)Z
+HSPLandroid/os/UserManagerInternal;->isUserUnlockingOrUnlocked(I)Z
+HSPLandroid/os/UserManagerInternal;->onEphemeralUserStop(I)V
+HSPLandroid/os/UserManagerInternal;->removeAllUsers()V
+HSPLandroid/os/UserManagerInternal;->removeUserEvenWhenDisallowed(I)Z
+HSPLandroid/os/UserManagerInternal;->removeUserRestrictionsListener(Landroid/os/UserManagerInternal$UserRestrictionsListener;)V
+HSPLandroid/os/UserManagerInternal;->removeUserState(I)V
+HSPLandroid/os/UserManagerInternal;->setBaseUserRestrictionsByDpmsForMigration(ILandroid/os/Bundle;)V
+HSPLandroid/os/UserManagerInternal;->setDeviceManaged(Z)V
+HSPLandroid/os/UserManagerInternal;->setDevicePolicyUserRestrictions(ILandroid/os/Bundle;ZI)V
+HSPLandroid/os/UserManagerInternal;->setForceEphemeralUsers(Z)V
+HSPLandroid/os/UserManagerInternal;->setUserIcon(ILandroid/graphics/Bitmap;)V
+HSPLandroid/os/UserManagerInternal;->setUserManaged(IZ)V
+HSPLandroid/os/UserManagerInternal;->setUserState(II)V
+HSPLandroid/os/VibrationEffect;->validate()V
+HSPLandroid/os/storage/IStorageEventListener;->onDiskDestroyed(Landroid/os/storage/DiskInfo;)V
+HSPLandroid/os/storage/IStorageEventListener;->onDiskScanned(Landroid/os/storage/DiskInfo;I)V
+HSPLandroid/os/storage/IStorageEventListener;->onStorageStateChanged(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+HSPLandroid/os/storage/IStorageEventListener;->onUsbMassStorageConnectionChanged(Z)V
+HSPLandroid/os/storage/IStorageEventListener;->onVolumeForgotten(Ljava/lang/String;)V
+HSPLandroid/os/storage/IStorageEventListener;->onVolumeRecordChanged(Landroid/os/storage/VolumeRecord;)V
+HSPLandroid/os/storage/IStorageEventListener;->onVolumeStateChanged(Landroid/os/storage/VolumeInfo;II)V
+HSPLandroid/os/storage/StorageManagerInternal;->addExternalStoragePolicy(Landroid/os/storage/StorageManagerInternal$ExternalStorageMountPolicy;)V
+HSPLandroid/os/storage/StorageManagerInternal;->getExternalStorageMountMode(ILjava/lang/String;)I
+HSPLandroid/os/storage/StorageManagerInternal;->onExternalStoragePolicyChanged(ILjava/lang/String;)V
+HSPLandroid/print/IPrintManager;->addPrintJobStateChangeListener(Landroid/print/IPrintJobStateChangeListener;II)V
+HSPLandroid/print/IPrintManager;->addPrintServiceRecommendationsChangeListener(Landroid/printservice/recommendation/IRecommendationsChangeListener;I)V
+HSPLandroid/print/IPrintManager;->addPrintServicesChangeListener(Landroid/print/IPrintServicesChangeListener;I)V
+HSPLandroid/print/IPrintManager;->cancelPrintJob(Landroid/print/PrintJobId;II)V
+HSPLandroid/print/IPrintManager;->createPrinterDiscoverySession(Landroid/print/IPrinterDiscoveryObserver;I)V
+HSPLandroid/print/IPrintManager;->destroyPrinterDiscoverySession(Landroid/print/IPrinterDiscoveryObserver;I)V
+HSPLandroid/print/IPrintManager;->getCustomPrinterIcon(Landroid/print/PrinterId;I)Landroid/graphics/drawable/Icon;
+HSPLandroid/print/IPrintManager;->getPrintJobInfo(Landroid/print/PrintJobId;II)Landroid/print/PrintJobInfo;
+HSPLandroid/print/IPrintManager;->getPrintJobInfos(II)Ljava/util/List;
+HSPLandroid/print/IPrintManager;->getPrintServiceRecommendations(I)Ljava/util/List;
+HSPLandroid/print/IPrintManager;->getPrintServices(II)Ljava/util/List;
+HSPLandroid/print/IPrintManager;->print(Ljava/lang/String;Landroid/print/IPrintDocumentAdapter;Landroid/print/PrintAttributes;Ljava/lang/String;II)Landroid/os/Bundle;
+HSPLandroid/print/IPrintManager;->removePrintJobStateChangeListener(Landroid/print/IPrintJobStateChangeListener;I)V
+HSPLandroid/print/IPrintManager;->removePrintServiceRecommendationsChangeListener(Landroid/printservice/recommendation/IRecommendationsChangeListener;I)V
+HSPLandroid/print/IPrintManager;->removePrintServicesChangeListener(Landroid/print/IPrintServicesChangeListener;I)V
+HSPLandroid/print/IPrintManager;->restartPrintJob(Landroid/print/PrintJobId;II)V
+HSPLandroid/print/IPrintManager;->setPrintServiceEnabled(Landroid/content/ComponentName;ZI)V
+HSPLandroid/print/IPrintManager;->startPrinterDiscovery(Landroid/print/IPrinterDiscoveryObserver;Ljava/util/List;I)V
+HSPLandroid/print/IPrintManager;->startPrinterStateTracking(Landroid/print/PrinterId;I)V
+HSPLandroid/print/IPrintManager;->stopPrinterDiscovery(Landroid/print/IPrinterDiscoveryObserver;I)V
+HSPLandroid/print/IPrintManager;->stopPrinterStateTracking(Landroid/print/PrinterId;I)V
+HSPLandroid/print/IPrintManager;->validatePrinters(Ljava/util/List;I)V
+HSPLandroid/security/keymaster/IKeyAttestationApplicationIdProvider;->getKeyAttestationApplicationId(I)Landroid/security/keymaster/KeyAttestationApplicationId;
+HSPLandroid/security/keystore/AndroidKeyStoreBCWorkaroundProvider;-><init>()V
+HSPLandroid/service/dreams/DreamManagerInternal;->isDreaming()Z
+HSPLandroid/service/dreams/DreamManagerInternal;->startDream(Z)V
+HSPLandroid/service/dreams/DreamManagerInternal;->stopDream(Z)V
+HSPLandroid/service/dreams/IDreamManager;->awaken()V
+HSPLandroid/service/dreams/IDreamManager;->dream()V
+HSPLandroid/service/dreams/IDreamManager;->finishSelf(Landroid/os/IBinder;Z)V
+HSPLandroid/service/dreams/IDreamManager;->getDefaultDreamComponent()Landroid/content/ComponentName;
+HSPLandroid/service/dreams/IDreamManager;->getDreamComponents()[Landroid/content/ComponentName;
+HSPLandroid/service/dreams/IDreamManager;->isDreaming()Z
+HSPLandroid/service/dreams/IDreamManager;->setDreamComponents([Landroid/content/ComponentName;)V
+HSPLandroid/service/dreams/IDreamManager;->startDozing(Landroid/os/IBinder;II)V
+HSPLandroid/service/dreams/IDreamManager;->stopDozing(Landroid/os/IBinder;)V
+HSPLandroid/service/dreams/IDreamManager;->testDream(Landroid/content/ComponentName;)V
+HSPLandroid/service/gatekeeper/IGateKeeperService;->clearSecureUserId(I)V
+HSPLandroid/service/gatekeeper/IGateKeeperService;->enroll(I[B[B[B)Landroid/service/gatekeeper/GateKeeperResponse;
+HSPLandroid/service/gatekeeper/IGateKeeperService;->getSecureUserId(I)J
+HSPLandroid/service/gatekeeper/IGateKeeperService;->reportDeviceSetupComplete()V
+HSPLandroid/service/gatekeeper/IGateKeeperService;->verify(I[B[B)Landroid/service/gatekeeper/GateKeeperResponse;
+HSPLandroid/service/gatekeeper/IGateKeeperService;->verifyChallenge(IJ[B[B)Landroid/service/gatekeeper/GateKeeperResponse;
+HSPLandroid/service/notification/IConditionProvider;->onConnected()V
+HSPLandroid/service/notification/IConditionProvider;->onSubscribe(Landroid/net/Uri;)V
+HSPLandroid/service/notification/IConditionProvider;->onUnsubscribe(Landroid/net/Uri;)V
+HSPLandroid/service/oemlock/IOemLockService;->canUserAllowOemUnlock()Z
+HSPLandroid/service/oemlock/IOemLockService;->isDeviceOemUnlocked()Z
+HSPLandroid/service/oemlock/IOemLockService;->isOemUnlockAllowed()Z
+HSPLandroid/service/oemlock/IOemLockService;->isOemUnlockAllowedByCarrier()Z
+HSPLandroid/service/oemlock/IOemLockService;->isOemUnlockAllowedByUser()Z
+HSPLandroid/service/oemlock/IOemLockService;->setOemUnlockAllowedByCarrier(Z[B)V
+HSPLandroid/service/oemlock/IOemLockService;->setOemUnlockAllowedByUser(Z)V
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->getDataBlockSize()I
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->getFlashLockState()I
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->getMaximumDataBlockSize()J
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->getOemUnlockEnabled()Z
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->hasFrpCredentialHandle()Z
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->read()[B
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->setOemUnlockEnabled(Z)V
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->wipe()V
+HSPLandroid/service/persistentdata/IPersistentDataBlockService;->write([B)I
+HSPLandroid/service/voice/VoiceInteractionManagerInternal;->startLocalVoiceInteraction(Landroid/os/IBinder;Landroid/os/Bundle;)V
+HSPLandroid/service/voice/VoiceInteractionManagerInternal;->stopLocalVoiceInteraction(Landroid/os/IBinder;)V
+HSPLandroid/service/voice/VoiceInteractionManagerInternal;->supportsLocalVoiceInteraction()Z
+HSPLandroid/service/wallpaper/IWallpaperConnection;->attachEngine(Landroid/service/wallpaper/IWallpaperEngine;)V
+HSPLandroid/service/wallpaper/IWallpaperConnection;->engineShown(Landroid/service/wallpaper/IWallpaperEngine;)V
+HSPLandroid/service/wallpaper/IWallpaperConnection;->onWallpaperColorsChanged(Landroid/app/WallpaperColors;)V
+HSPLandroid/service/wallpaper/IWallpaperConnection;->setWallpaper(Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
+HSPLandroid/service/wallpaper/IWallpaperEngine;->destroy()V
+HSPLandroid/service/wallpaper/IWallpaperEngine;->dispatchPointer(Landroid/view/MotionEvent;)V
+HSPLandroid/service/wallpaper/IWallpaperEngine;->dispatchWallpaperCommand(Ljava/lang/String;IIILandroid/os/Bundle;)V
+HSPLandroid/service/wallpaper/IWallpaperEngine;->requestWallpaperColors()V
+HSPLandroid/service/wallpaper/IWallpaperEngine;->setDesiredSize(II)V
+HSPLandroid/service/wallpaper/IWallpaperEngine;->setDisplayPadding(Landroid/graphics/Rect;)V
+HSPLandroid/service/wallpaper/IWallpaperEngine;->setVisibility(Z)V
+HSPLandroid/service/wallpaper/IWallpaperService;->attach(Landroid/service/wallpaper/IWallpaperConnection;Landroid/os/IBinder;IZIILandroid/graphics/Rect;)V
+HSPLandroid/telecom/DefaultDialerManager;->filterByIntent(Landroid/content/Context;Ljava/util/List;Landroid/content/Intent;I)Ljava/util/List;
+HSPLandroid/telecom/Log$$Lambda$0;-><init>()V
+HSPLandroid/telecom/Log$$Lambda$0;->getSessionId()Ljava/lang/String;
+HSPLandroid/telecom/Logging/EventManager$EventListener;->eventRecordAdded(Landroid/telecom/Logging/EventManager$EventRecord;)V
+HSPLandroid/telecom/Logging/SessionManager$$Lambda$1;-><init>()V
+HSPLandroid/telecom/Logging/SessionManager$$Lambda$1;->get()I
+HSPLandroid/telecom/Logging/SessionManager$$Lambda$2;->get()J
+HSPLandroid/telecom/Logging/SessionManager$ICurrentThreadId;->get()I
+HSPLandroid/telecom/Logging/SessionManager$ISessionCleanupTimeoutMs;->get()J
+HSPLandroid/telecom/Logging/SessionManager$ISessionIdQueryHandler;->getSessionId()Ljava/lang/String;
+HSPLandroid/telecom/Logging/SessionManager$ISessionListener;->sessionComplete(Ljava/lang/String;J)V
+HSPLandroid/telecom/Logging/SessionManager;->lambda$new$1$SessionManager()J
+HSPLandroid/telephony/CellLocation;->fillInNotifierBundle(Landroid/os/Bundle;)V
+HSPLandroid/telephony/CellLocation;->isEmpty()Z
+HSPLandroid/telephony/CellLocation;->setStateInvalid()V
+HSPLandroid/util/Log;->access$000()I
+HSPLandroid/util/Log;->wtf(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
+HSPLandroid/util/Spline;->interpolate(F)F
+HSPLandroid/util/TimeUtils;->formatDuration(JJLjava/io/PrintWriter;)V
+HSPLandroid/util/TimeUtils;->formatUptime(J)Ljava/lang/String;
+HSPLandroid/util/TrustedTime;->currentTimeMillis()J
+HSPLandroid/util/TrustedTime;->forceRefresh()Z
+HSPLandroid/util/TrustedTime;->getCacheAge()J
+HSPLandroid/util/TrustedTime;->getCacheCertainty()J
+HSPLandroid/util/TrustedTime;->hasCache()Z
+HSPLandroid/view/IApplicationToken;->getName()Ljava/lang/String;
+HSPLandroid/view/IDockedStackListener;->onAdjustedForImeChanged(ZJ)V
+HSPLandroid/view/IDockedStackListener;->onDividerVisibilityChanged(Z)V
+HSPLandroid/view/IDockedStackListener;->onDockSideChanged(I)V
+HSPLandroid/view/IDockedStackListener;->onDockedStackExistsChanged(Z)V
+HSPLandroid/view/IDockedStackListener;->onDockedStackMinimizedChanged(ZJZ)V
+HSPLandroid/view/IPinnedStackController;->getDisplayRotation()I
+HSPLandroid/view/IPinnedStackController;->setIsMinimized(Z)V
+HSPLandroid/view/IPinnedStackController;->setMinEdgeSize(I)V
+HSPLandroid/view/IPinnedStackListener;->onActionsChanged(Landroid/content/pm/ParceledListSlice;)V
+HSPLandroid/view/IPinnedStackListener;->onImeVisibilityChanged(ZI)V
+HSPLandroid/view/IPinnedStackListener;->onListenerRegistered(Landroid/view/IPinnedStackController;)V
+HSPLandroid/view/IPinnedStackListener;->onMinimizedStateChanged(Z)V
+HSPLandroid/view/IPinnedStackListener;->onMovementBoundsChanged(Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;ZI)V
+HSPLandroid/view/IWallpaperVisibilityListener;->onWallpaperVisibilityChanged(ZI)V
+HSPLandroid/view/IWindowId;->isFocused()Z
+HSPLandroid/view/IWindowId;->registerFocusObserver(Landroid/view/IWindowFocusObserver;)V
+HSPLandroid/view/IWindowId;->unregisterFocusObserver(Landroid/view/IWindowFocusObserver;)V
+HSPLandroid/view/WindowManagerInternal$OnHardKeyboardStatusChangeListener;->onHardKeyboardStatusChange(Z)V
+HSPLandroid/view/WindowManagerInternal;->addWindowToken(Landroid/os/IBinder;II)V
+HSPLandroid/view/WindowManagerInternal;->clearLastInputMethodWindowForTransition()V
+HSPLandroid/view/WindowManagerInternal;->computeWindowsForAccessibility()V
+HSPLandroid/view/WindowManagerInternal;->getCompatibleMagnificationSpecForWindow(Landroid/os/IBinder;)Landroid/view/MagnificationSpec;
+HSPLandroid/view/WindowManagerInternal;->getFocusedWindowToken()Landroid/os/IBinder;
+HSPLandroid/view/WindowManagerInternal;->getInputMethodWindowVisibleHeight()I
+HSPLandroid/view/WindowManagerInternal;->getMagnificationRegion(Landroid/graphics/Region;)V
+HSPLandroid/view/WindowManagerInternal;->getWindowFrame(Landroid/os/IBinder;Landroid/graphics/Rect;)V
+HSPLandroid/view/WindowManagerInternal;->isDockedDividerResizing()Z
+HSPLandroid/view/WindowManagerInternal;->isHardKeyboardAvailable()Z
+HSPLandroid/view/WindowManagerInternal;->isKeyguardGoingAway()Z
+HSPLandroid/view/WindowManagerInternal;->isKeyguardLocked()Z
+HSPLandroid/view/WindowManagerInternal;->isKeyguardShowingAndNotOccluded()Z
+HSPLandroid/view/WindowManagerInternal;->isStackVisible(I)Z
+HSPLandroid/view/WindowManagerInternal;->registerAppTransitionListener(Landroid/view/WindowManagerInternal$AppTransitionListener;)V
+HSPLandroid/view/WindowManagerInternal;->removeWindowToken(Landroid/os/IBinder;ZI)V
+HSPLandroid/view/WindowManagerInternal;->requestTraversalFromDisplayManager()V
+HSPLandroid/view/WindowManagerInternal;->saveLastInputMethodWindowForTransition()V
+HSPLandroid/view/WindowManagerInternal;->setForceShowMagnifiableBounds(Z)V
+HSPLandroid/view/WindowManagerInternal;->setInputFilter(Landroid/view/IInputFilter;)V
+HSPLandroid/view/WindowManagerInternal;->setMagnificationCallbacks(Landroid/view/WindowManagerInternal$MagnificationCallbacks;)V
+HSPLandroid/view/WindowManagerInternal;->setMagnificationSpec(Landroid/view/MagnificationSpec;)V
+HSPLandroid/view/WindowManagerInternal;->setOnHardKeyboardStatusChangeListener(Landroid/view/WindowManagerInternal$OnHardKeyboardStatusChangeListener;)V
+HSPLandroid/view/WindowManagerInternal;->setVr2dDisplayId(I)V
+HSPLandroid/view/WindowManagerInternal;->setWindowsForAccessibilityCallback(Landroid/view/WindowManagerInternal$WindowsForAccessibilityCallback;)V
+HSPLandroid/view/WindowManagerInternal;->showGlobalActions()V
+HSPLandroid/view/WindowManagerInternal;->updateInputMethodWindowStatus(Landroid/os/IBinder;ZZLandroid/os/IBinder;)V
+HSPLandroid/view/WindowManagerInternal;->waitForAllWindowsDrawn(Ljava/lang/Runnable;J)V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->createInputConsumer(Landroid/os/Looper;Ljava/lang/String;Landroid/view/InputEventReceiver$Factory;)Landroid/view/WindowManagerPolicy$InputConsumer;
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->getCameraLensCoverState()I
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->getDockedDividerInsetsLw()I
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->getInputMethodWindowLw()Landroid/view/WindowManagerPolicy$WindowState;
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->getLidState()I
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->getStackBounds(ILandroid/graphics/Rect;)V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->getWindowManagerLock()Ljava/lang/Object;
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->lockDeviceNow()V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->notifyKeyguardTrustedChanged()V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->notifyShowingDreamChanged()V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->reboot(Z)V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->rebootSafeMode(Z)V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->reevaluateStatusBarVisibility()V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->registerPointerEventListener(Landroid/view/WindowManagerPolicy$PointerEventListener;)V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->screenTurningOff(Landroid/view/WindowManagerPolicy$ScreenOffListener;)V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->shutdown(Z)V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->switchInputMethod(Z)V
+HSPLandroid/view/WindowManagerPolicy$WindowManagerFuncs;->unregisterPointerEventListener(Landroid/view/WindowManagerPolicy$PointerEventListener;)V
+HSPLandroid/view/WindowManagerPolicy$WindowState;->canAcquireSleepToken()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->canAffectSystemUiFlags()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->computeFrameLw(Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getAppToken()Landroid/view/IApplicationToken;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getAttrs()Landroid/view/WindowManager$LayoutParams;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getBaseType()I
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getContentFrameLw()Landroid/graphics/Rect;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getDisplayFrameLw()Landroid/graphics/Rect;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getDisplayId()I
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getFrameLw()Landroid/graphics/Rect;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getGivenContentInsetsLw()Landroid/graphics/Rect;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getGivenInsetsPendingLw()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getGivenVisibleInsetsLw()Landroid/graphics/Rect;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getNeedsMenuLw(Landroid/view/WindowManagerPolicy$WindowState;)Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getOverscanFrameLw()Landroid/graphics/Rect;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getOwningPackage()Ljava/lang/String;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getOwningUid()I
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getRotationAnimationHint()I
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getShownPositionLw()Landroid/graphics/Point;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getStackId()I
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getSystemUiVisibility()I
+HSPLandroid/view/WindowManagerPolicy$WindowState;->getVisibleFrameLw()Landroid/graphics/Rect;
+HSPLandroid/view/WindowManagerPolicy$WindowState;->hasAppShownWindows()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->hasDrawnLw()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->hideLw(Z)Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isAlive()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isAnimatingLw()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isDefaultDisplay()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isDimming()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isDisplayedLw()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isDrawnLw()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isGoneForLayoutLw()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isInMultiWindowMode()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isInputMethodWindow()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isVisibleLw()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->isVoiceInteraction()Z
+HSPLandroid/view/WindowManagerPolicy$WindowState;->showLw(Z)Z
+HSPLandroid/view/WindowManagerPolicy;->addSplashScreen(Landroid/os/IBinder;Ljava/lang/String;ILandroid/content/res/CompatibilityInfo;Ljava/lang/CharSequence;IIIILandroid/content/res/Configuration;I)Landroid/view/WindowManagerPolicy$StartingSurface;
+HSPLandroid/view/WindowManagerPolicy;->adjustConfigurationLw(Landroid/content/res/Configuration;II)V
+HSPLandroid/view/WindowManagerPolicy;->adjustSystemUiVisibilityLw(I)I
+HSPLandroid/view/WindowManagerPolicy;->adjustWindowParamsLw(Landroid/view/WindowManager$LayoutParams;)V
+HSPLandroid/view/WindowManagerPolicy;->allowAppAnimationsLw()Z
+HSPLandroid/view/WindowManagerPolicy;->applyPostLayoutPolicyLw(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/WindowManager$LayoutParams;Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/WindowManagerPolicy$WindowState;)V
+HSPLandroid/view/WindowManagerPolicy;->beginLayoutLw(ZIIII)V
+HSPLandroid/view/WindowManagerPolicy;->beginPostLayoutPolicyLw(II)V
+HSPLandroid/view/WindowManagerPolicy;->canBeHiddenByKeyguardLw(Landroid/view/WindowManagerPolicy$WindowState;)Z
+HSPLandroid/view/WindowManagerPolicy;->canDismissBootAnimation()Z
+HSPLandroid/view/WindowManagerPolicy;->canMagnifyWindow(I)Z
+HSPLandroid/view/WindowManagerPolicy;->checkAddPermission(Landroid/view/WindowManager$LayoutParams;[I)I
+HSPLandroid/view/WindowManagerPolicy;->checkShowToOwnerOnly(Landroid/view/WindowManager$LayoutParams;)Z
+HSPLandroid/view/WindowManagerPolicy;->createHiddenByKeyguardExit(ZZ)Landroid/view/animation/Animation;
+HSPLandroid/view/WindowManagerPolicy;->createKeyguardWallpaperExit(Z)Landroid/view/animation/Animation;
+HSPLandroid/view/WindowManagerPolicy;->dismissKeyguardLw(Lcom/android/internal/policy/IKeyguardDismissCallback;)V
+HSPLandroid/view/WindowManagerPolicy;->dispatchUnhandledKey(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)Landroid/view/KeyEvent;
+HSPLandroid/view/WindowManagerPolicy;->dump(Ljava/lang/String;Ljava/io/PrintWriter;[Ljava/lang/String;)V
+HSPLandroid/view/WindowManagerPolicy;->enableKeyguard(Z)V
+HSPLandroid/view/WindowManagerPolicy;->enableScreenAfterBoot()V
+HSPLandroid/view/WindowManagerPolicy;->exitKeyguardSecurely(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V
+HSPLandroid/view/WindowManagerPolicy;->finishLayoutLw()V
+HSPLandroid/view/WindowManagerPolicy;->finishPostLayoutPolicyLw()I
+HSPLandroid/view/WindowManagerPolicy;->finishedGoingToSleep(I)V
+HSPLandroid/view/WindowManagerPolicy;->finishedWakingUp()V
+HSPLandroid/view/WindowManagerPolicy;->focusChangedLw(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/WindowManagerPolicy$WindowState;)I
+HSPLandroid/view/WindowManagerPolicy;->getConfigDisplayHeight(IIIII)I
+HSPLandroid/view/WindowManagerPolicy;->getConfigDisplayWidth(IIIII)I
+HSPLandroid/view/WindowManagerPolicy;->getContentRectLw(Landroid/graphics/Rect;)V
+HSPLandroid/view/WindowManagerPolicy;->getInputMethodWindowVisibleHeightLw()I
+HSPLandroid/view/WindowManagerPolicy;->getInsetHintLw(Landroid/view/WindowManager$LayoutParams;Landroid/graphics/Rect;IIILandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)Z
+HSPLandroid/view/WindowManagerPolicy;->getMaxWallpaperLayer()I
+HSPLandroid/view/WindowManagerPolicy;->getNavBarPosition()I
+HSPLandroid/view/WindowManagerPolicy;->getNonDecorDisplayHeight(IIIII)I
+HSPLandroid/view/WindowManagerPolicy;->getNonDecorDisplayWidth(IIIII)I
+HSPLandroid/view/WindowManagerPolicy;->getNonDecorInsetsLw(IIILandroid/graphics/Rect;)V
+HSPLandroid/view/WindowManagerPolicy;->getStableInsetsLw(IIILandroid/graphics/Rect;)V
+HSPLandroid/view/WindowManagerPolicy;->getSystemDecorLayerLw()I
+HSPLandroid/view/WindowManagerPolicy;->getUserRotationMode()I
+HSPLandroid/view/WindowManagerPolicy;->hasNavigationBar()Z
+HSPLandroid/view/WindowManagerPolicy;->hideBootMessages()V
+HSPLandroid/view/WindowManagerPolicy;->inKeyguardRestrictedKeyInputMode()Z
+HSPLandroid/view/WindowManagerPolicy;->init(Landroid/content/Context;Landroid/view/IWindowManager;Landroid/view/WindowManagerPolicy$WindowManagerFuncs;)V
+HSPLandroid/view/WindowManagerPolicy;->interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J
+HSPLandroid/view/WindowManagerPolicy;->interceptKeyBeforeQueueing(Landroid/view/KeyEvent;I)I
+HSPLandroid/view/WindowManagerPolicy;->interceptMotionBeforeQueueingNonInteractive(JI)I
+HSPLandroid/view/WindowManagerPolicy;->isDefaultOrientationForced()Z
+HSPLandroid/view/WindowManagerPolicy;->isDockSideAllowed(I)Z
+HSPLandroid/view/WindowManagerPolicy;->isKeyguardDrawnLw()Z
+HSPLandroid/view/WindowManagerPolicy;->isKeyguardHostWindow(Landroid/view/WindowManager$LayoutParams;)Z
+HSPLandroid/view/WindowManagerPolicy;->isKeyguardLocked()Z
+HSPLandroid/view/WindowManagerPolicy;->isKeyguardOccluded()Z
+HSPLandroid/view/WindowManagerPolicy;->isKeyguardSecure(I)Z
+HSPLandroid/view/WindowManagerPolicy;->isKeyguardShowingAndNotOccluded()Z
+HSPLandroid/view/WindowManagerPolicy;->isKeyguardTrustedLw()Z
+HSPLandroid/view/WindowManagerPolicy;->isNavBarForcedShownLw(Landroid/view/WindowManagerPolicy$WindowState;)Z
+HSPLandroid/view/WindowManagerPolicy;->isScreenOn()Z
+HSPLandroid/view/WindowManagerPolicy;->isShowingDreamLw()Z
+HSPLandroid/view/WindowManagerPolicy;->isTopLevelWindow(I)Z
+HSPLandroid/view/WindowManagerPolicy;->keepScreenOnStartedLw()V
+HSPLandroid/view/WindowManagerPolicy;->keepScreenOnStoppedLw()V
+HSPLandroid/view/WindowManagerPolicy;->layoutWindowLw(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/WindowManagerPolicy$WindowState;)V
+HSPLandroid/view/WindowManagerPolicy;->lockNow(Landroid/os/Bundle;)V
+HSPLandroid/view/WindowManagerPolicy;->notifyCameraLensCoverSwitchChanged(JZ)V
+HSPLandroid/view/WindowManagerPolicy;->notifyLidSwitchChanged(JZ)V
+HSPLandroid/view/WindowManagerPolicy;->okToAnimate()Z
+HSPLandroid/view/WindowManagerPolicy;->onConfigurationChanged()V
+HSPLandroid/view/WindowManagerPolicy;->onKeyguardOccludedChangedLw(Z)V
+HSPLandroid/view/WindowManagerPolicy;->onSystemUiStarted()V
+HSPLandroid/view/WindowManagerPolicy;->performHapticFeedbackLw(Landroid/view/WindowManagerPolicy$WindowState;IZ)Z
+HSPLandroid/view/WindowManagerPolicy;->prepareAddWindowLw(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/WindowManager$LayoutParams;)I
+HSPLandroid/view/WindowManagerPolicy;->registerShortcutKey(JLcom/android/internal/policy/IShortcutService;)V
+HSPLandroid/view/WindowManagerPolicy;->removeWindowLw(Landroid/view/WindowManagerPolicy$WindowState;)V
+HSPLandroid/view/WindowManagerPolicy;->rotationForOrientationLw(II)I
+HSPLandroid/view/WindowManagerPolicy;->rotationHasCompatibleMetricsLw(II)Z
+HSPLandroid/view/WindowManagerPolicy;->screenTurnedOff()V
+HSPLandroid/view/WindowManagerPolicy;->screenTurnedOn()V
+HSPLandroid/view/WindowManagerPolicy;->screenTurningOff(Landroid/view/WindowManagerPolicy$ScreenOffListener;)V
+HSPLandroid/view/WindowManagerPolicy;->screenTurningOn(Landroid/view/WindowManagerPolicy$ScreenOnListener;)V
+HSPLandroid/view/WindowManagerPolicy;->selectAnimationLw(Landroid/view/WindowManagerPolicy$WindowState;I)I
+HSPLandroid/view/WindowManagerPolicy;->selectRotationAnimationLw([I)V
+HSPLandroid/view/WindowManagerPolicy;->setCurrentOrientationLw(I)V
+HSPLandroid/view/WindowManagerPolicy;->setCurrentUserLw(I)V
+HSPLandroid/view/WindowManagerPolicy;->setDisplayOverscan(Landroid/view/Display;IIII)V
+HSPLandroid/view/WindowManagerPolicy;->setInitialDisplaySize(Landroid/view/Display;III)V
+HSPLandroid/view/WindowManagerPolicy;->setLastInputMethodWindowLw(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/WindowManagerPolicy$WindowState;)V
+HSPLandroid/view/WindowManagerPolicy;->setPipVisibilityLw(Z)V
+HSPLandroid/view/WindowManagerPolicy;->setRecentsVisibilityLw(Z)V
+HSPLandroid/view/WindowManagerPolicy;->setRotationLw(I)V
+HSPLandroid/view/WindowManagerPolicy;->setSafeMode(Z)V
+HSPLandroid/view/WindowManagerPolicy;->setSwitchingUser(Z)V
+HSPLandroid/view/WindowManagerPolicy;->setUserRotationMode(II)V
+HSPLandroid/view/WindowManagerPolicy;->shouldRotateSeamlessly(II)Z
+HSPLandroid/view/WindowManagerPolicy;->showBootMessage(Ljava/lang/CharSequence;Z)V
+HSPLandroid/view/WindowManagerPolicy;->showGlobalActions()V
+HSPLandroid/view/WindowManagerPolicy;->showRecentApps(Z)V
+HSPLandroid/view/WindowManagerPolicy;->startKeyguardExitAnimation(JJ)V
+HSPLandroid/view/WindowManagerPolicy;->startedGoingToSleep(I)V
+HSPLandroid/view/WindowManagerPolicy;->startedWakingUp()V
+HSPLandroid/view/WindowManagerPolicy;->systemBooted()V
+HSPLandroid/view/WindowManagerPolicy;->systemReady()V
+HSPLandroid/view/WindowManagerPolicy;->userActivity()V
+HSPLandroid/view/WindowManagerPolicy;->validateRotationAnimationLw(IIZ)Z
+HSPLandroid/view/WindowManagerPolicy;->writeToProto(Landroid/util/proto/ProtoOutputStream;J)V
+HSPLandroid/view/accessibility/AccessibilityManager$AccessibilityServicesStateChangeListener;->onAccessibilityServicesStateChanged(Landroid/view/accessibility/AccessibilityManager;)V
+HSPLandroid/view/autofill/AutofillManagerInternal;->onBackKeyPressed()V
+HSPLandroid/view/inputmethod/InputMethodManagerInternal;->hideCurrentInputMethod()V
+HSPLandroid/view/inputmethod/InputMethodManagerInternal;->setInteractive(Z)V
+HSPLandroid/view/inputmethod/InputMethodManagerInternal;->switchInputMethod(Z)V
+HSPLcom/android/internal/app/ISoundTriggerService;->deleteSoundModel(Landroid/os/ParcelUuid;)V
+HSPLcom/android/internal/app/ISoundTriggerService;->getSoundModel(Landroid/os/ParcelUuid;)Landroid/hardware/soundtrigger/SoundTrigger$GenericSoundModel;
+HSPLcom/android/internal/app/ISoundTriggerService;->isRecognitionActive(Landroid/os/ParcelUuid;)Z
+HSPLcom/android/internal/app/ISoundTriggerService;->loadGenericSoundModel(Landroid/hardware/soundtrigger/SoundTrigger$GenericSoundModel;)I
+HSPLcom/android/internal/app/ISoundTriggerService;->loadKeyphraseSoundModel(Landroid/hardware/soundtrigger/SoundTrigger$KeyphraseSoundModel;)I
+HSPLcom/android/internal/app/ISoundTriggerService;->startRecognition(Landroid/os/ParcelUuid;Landroid/hardware/soundtrigger/IRecognitionStatusCallback;Landroid/hardware/soundtrigger/SoundTrigger$RecognitionConfig;)I
+HSPLcom/android/internal/app/ISoundTriggerService;->startRecognitionForIntent(Landroid/os/ParcelUuid;Landroid/app/PendingIntent;Landroid/hardware/soundtrigger/SoundTrigger$RecognitionConfig;)I
+HSPLcom/android/internal/app/ISoundTriggerService;->stopRecognition(Landroid/os/ParcelUuid;Landroid/hardware/soundtrigger/IRecognitionStatusCallback;)I
+HSPLcom/android/internal/app/ISoundTriggerService;->stopRecognitionForIntent(Landroid/os/ParcelUuid;)I
+HSPLcom/android/internal/app/ISoundTriggerService;->unloadSoundModel(Landroid/os/ParcelUuid;)I
+HSPLcom/android/internal/app/ISoundTriggerService;->updateSoundModel(Landroid/hardware/soundtrigger/SoundTrigger$GenericSoundModel;)V
+HSPLcom/android/internal/app/IVoiceInteractionSessionListener;->onVoiceSessionHidden()V
+HSPLcom/android/internal/app/IVoiceInteractionSessionListener;->onVoiceSessionShown()V
+HSPLcom/android/internal/app/procstats/IProcessStats;->getCurrentMemoryState()I
+HSPLcom/android/internal/app/procstats/IProcessStats;->getCurrentStats(Ljava/util/List;)[B
+HSPLcom/android/internal/app/procstats/IProcessStats;->getStatsOverTime(J)Landroid/os/ParcelFileDescriptor;
+HSPLcom/android/internal/inputmethod/LocaleUtils$LocaleExtractor;->get(Ljava/lang/Object;)Ljava/util/Locale;
+HSPLcom/android/internal/location/ILocationProvider;->disable()V
+HSPLcom/android/internal/location/ILocationProvider;->enable()V
+HSPLcom/android/internal/location/ILocationProvider;->getProperties()Lcom/android/internal/location/ProviderProperties;
+HSPLcom/android/internal/location/ILocationProvider;->getStatus(Landroid/os/Bundle;)I
+HSPLcom/android/internal/location/ILocationProvider;->getStatusUpdateTime()J
+HSPLcom/android/internal/location/ILocationProvider;->sendExtraCommand(Ljava/lang/String;Landroid/os/Bundle;)Z
+HSPLcom/android/internal/location/ILocationProvider;->setRequest(Lcom/android/internal/location/ProviderRequest;Landroid/os/WorkSource;)V
+HSPLcom/android/internal/os/BatteryStatsImpl$3;->run()V
+HSPLcom/android/internal/os/BatteryStatsImpl$4;-><init>()V
+HSPLcom/android/internal/os/BatteryStatsImpl$BatteryCallback;->batteryNeedsCpuUpdate()V
+HSPLcom/android/internal/os/BatteryStatsImpl$BatteryCallback;->batteryPowerChanged(Z)V
+HSPLcom/android/internal/os/BatteryStatsImpl$BatteryCallback;->batterySendBroadcast(Landroid/content/Intent;)V
+HSPLcom/android/internal/os/BatteryStatsImpl$ExternalStatsSync;->scheduleCpuSyncDueToRemovedUid(I)Ljava/util/concurrent/Future;
+HSPLcom/android/internal/os/BatteryStatsImpl$ExternalStatsSync;->scheduleSync(Ljava/lang/String;I)Ljava/util/concurrent/Future;
+HSPLcom/android/internal/os/BatteryStatsImpl$PlatformIdleStateCallback;->getPlatformLowPowerStats()Ljava/lang/String;
+HSPLcom/android/internal/os/BatteryStatsImpl$PlatformIdleStateCallback;->getSubsystemLowPowerStats()Ljava/lang/String;
+HSPLcom/android/internal/os/BatteryStatsImpl$Uid;->access$600(Lcom/android/internal/os/BatteryStatsImpl$Uid;)Lcom/android/internal/os/BatteryStatsImpl$LongSamplingCounter;
+HSPLcom/android/internal/os/BatteryStatsImpl$Uid;->access$602(Lcom/android/internal/os/BatteryStatsImpl$Uid;Lcom/android/internal/os/BatteryStatsImpl$LongSamplingCounter;)Lcom/android/internal/os/BatteryStatsImpl$LongSamplingCounter;
+HSPLcom/android/internal/os/BatteryStatsImpl$Uid;->access$700(Lcom/android/internal/os/BatteryStatsImpl$Uid;)Lcom/android/internal/os/BatteryStatsImpl$LongSamplingCounter;
+HSPLcom/android/internal/os/BatteryStatsImpl$Uid;->access$702(Lcom/android/internal/os/BatteryStatsImpl$Uid;Lcom/android/internal/os/BatteryStatsImpl$LongSamplingCounter;)Lcom/android/internal/os/BatteryStatsImpl$LongSamplingCounter;
+HSPLcom/android/internal/os/BatteryStatsImpl$UserInfoProvider;->getUserIds()[I
+HSPLcom/android/internal/os/BatteryStatsImpl;->markPartialTimersAsEligible()V
+HSPLcom/android/internal/os/BatteryStatsImpl;->readDailyItemTagDetailsLocked(Lorg/xmlpull/v1/XmlPullParser;Landroid/os/BatteryStats$DailyItem;ZLjava/lang/String;)V
+HSPLcom/android/internal/os/BatteryStatsImpl;->readDailyItemTagLocked(Lorg/xmlpull/v1/XmlPullParser;)V
+HSPLcom/android/internal/os/BatteryStatsImpl;->readDailyItemsLocked(Lorg/xmlpull/v1/XmlPullParser;)V
+HSPLcom/android/internal/os/BatteryStatsImpl;->updateCpuTimeLocked()V
+HSPLcom/android/internal/os/IDropBoxManagerService;->add(Landroid/os/DropBoxManager$Entry;)V
+HSPLcom/android/internal/os/IDropBoxManagerService;->getNextEntry(Ljava/lang/String;J)Landroid/os/DropBoxManager$Entry;
+HSPLcom/android/internal/os/IDropBoxManagerService;->isTagEnabled(Ljava/lang/String;)Z
+HSPLcom/android/internal/os/KernelUidCpuFreqTimeReader;->extractClusterInfoFromProcFileFreqs()Landroid/util/IntArray;
+HSPLcom/android/internal/os/KernelUidCpuFreqTimeReader;->readCpuFreqs(Ljava/lang/String;Lcom/android/internal/os/PowerProfile;)[J
+HSPLcom/android/internal/os/KernelUidCpuFreqTimeReader;->readFreqs(Lcom/android/internal/os/PowerProfile;)[J
+HSPLcom/android/internal/os/KernelUidCpuFreqTimeReader;->readFreqs(Ljava/io/BufferedReader;Lcom/android/internal/os/PowerProfile;)[J
+HSPLcom/android/internal/policy/IKeyguardDrawnCallback;->onDrawn()V
+HSPLcom/android/internal/policy/IKeyguardStateCallback;->onHasLockscreenWallpaperChanged(Z)V
+HSPLcom/android/internal/policy/IKeyguardStateCallback;->onInputRestrictedStateChanged(Z)V
+HSPLcom/android/internal/policy/IKeyguardStateCallback;->onShowingStateChanged(Z)V
+HSPLcom/android/internal/policy/IKeyguardStateCallback;->onSimSecureStateChanged(Z)V
+HSPLcom/android/internal/policy/IKeyguardStateCallback;->onTrustedChanged(Z)V
+HSPLcom/android/internal/policy/IShortcutService;->notifyShortcutKeyPressed(J)V
+HSPLcom/android/internal/statusbar/IStatusBar;->addQsTile(Landroid/content/ComponentName;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->animateCollapsePanels()V
+HSPLcom/android/internal/statusbar/IStatusBar;->animateExpandNotificationsPanel()V
+HSPLcom/android/internal/statusbar/IStatusBar;->animateExpandSettingsPanel(Ljava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->appTransitionCancelled()V
+HSPLcom/android/internal/statusbar/IStatusBar;->appTransitionFinished()V
+HSPLcom/android/internal/statusbar/IStatusBar;->appTransitionPending()V
+HSPLcom/android/internal/statusbar/IStatusBar;->appTransitionStarting(JJ)V
+HSPLcom/android/internal/statusbar/IStatusBar;->cancelPreloadRecentApps()V
+HSPLcom/android/internal/statusbar/IStatusBar;->clickQsTile(Landroid/content/ComponentName;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->disable(II)V
+HSPLcom/android/internal/statusbar/IStatusBar;->dismissKeyboardShortcutsMenu()V
+HSPLcom/android/internal/statusbar/IStatusBar;->handleSystemKey(I)V
+HSPLcom/android/internal/statusbar/IStatusBar;->hideRecentApps(ZZ)V
+HSPLcom/android/internal/statusbar/IStatusBar;->onCameraLaunchGestureDetected(I)V
+HSPLcom/android/internal/statusbar/IStatusBar;->preloadRecentApps()V
+HSPLcom/android/internal/statusbar/IStatusBar;->remQsTile(Landroid/content/ComponentName;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->removeIcon(Ljava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->setIcon(Ljava/lang/String;Lcom/android/internal/statusbar/StatusBarIcon;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->setImeWindowStatus(Landroid/os/IBinder;IIZ)V
+HSPLcom/android/internal/statusbar/IStatusBar;->setSystemUiVisibility(IIIILandroid/graphics/Rect;Landroid/graphics/Rect;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->setTopAppHidesStatusBar(Z)V
+HSPLcom/android/internal/statusbar/IStatusBar;->setWindowState(II)V
+HSPLcom/android/internal/statusbar/IStatusBar;->showAssistDisclosure()V
+HSPLcom/android/internal/statusbar/IStatusBar;->showGlobalActionsMenu()V
+HSPLcom/android/internal/statusbar/IStatusBar;->showPictureInPictureMenu()V
+HSPLcom/android/internal/statusbar/IStatusBar;->showRecentApps(ZZ)V
+HSPLcom/android/internal/statusbar/IStatusBar;->showScreenPinningRequest(I)V
+HSPLcom/android/internal/statusbar/IStatusBar;->showShutdownUi(ZLjava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->startAssist(Landroid/os/Bundle;)V
+HSPLcom/android/internal/statusbar/IStatusBar;->toggleKeyboardShortcutsMenu(I)V
+HSPLcom/android/internal/statusbar/IStatusBar;->togglePanel()V
+HSPLcom/android/internal/statusbar/IStatusBar;->toggleRecentApps()V
+HSPLcom/android/internal/statusbar/IStatusBar;->toggleSplitScreen()V
+HSPLcom/android/internal/statusbar/IStatusBar;->topAppWindowChanged(Z)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->addTile(Landroid/content/ComponentName;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->clearNotificationEffects()V
+HSPLcom/android/internal/statusbar/IStatusBarService;->clickTile(Landroid/content/ComponentName;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->collapsePanels()V
+HSPLcom/android/internal/statusbar/IStatusBarService;->disable(ILandroid/os/IBinder;Ljava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->disable2(ILandroid/os/IBinder;Ljava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->disable2ForUser(ILandroid/os/IBinder;Ljava/lang/String;I)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->disableForUser(ILandroid/os/IBinder;Ljava/lang/String;I)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->expandNotificationsPanel()V
+HSPLcom/android/internal/statusbar/IStatusBarService;->expandSettingsPanel(Ljava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->handleSystemKey(I)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onClearAllNotifications(I)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onGlobalActionsHidden()V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onGlobalActionsShown()V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onNotificationActionClick(Ljava/lang/String;I)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onNotificationClear(Ljava/lang/String;Ljava/lang/String;II)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onNotificationClick(Ljava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onNotificationError(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;I)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onNotificationExpansionChanged(Ljava/lang/String;ZZ)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onNotificationVisibilityChanged([Lcom/android/internal/statusbar/NotificationVisibility;[Lcom/android/internal/statusbar/NotificationVisibility;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onPanelHidden()V
+HSPLcom/android/internal/statusbar/IStatusBarService;->onPanelRevealed(ZI)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->reboot(Z)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->registerStatusBar(Lcom/android/internal/statusbar/IStatusBar;Ljava/util/List;Ljava/util/List;[ILjava/util/List;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->remTile(Landroid/content/ComponentName;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->removeIcon(Ljava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->setIcon(Ljava/lang/String;Ljava/lang/String;IILjava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->setIconVisibility(Ljava/lang/String;Z)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->setImeWindowStatus(Landroid/os/IBinder;IIZ)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->setSystemUiVisibility(IILjava/lang/String;)V
+HSPLcom/android/internal/statusbar/IStatusBarService;->shutdown()V
+HSPLcom/android/internal/statusbar/IStatusBarService;->togglePanel()V
+HSPLcom/android/internal/telephony/IMms;->addMultimediaMessageDraft(Ljava/lang/String;Landroid/net/Uri;)Landroid/net/Uri;
+HSPLcom/android/internal/telephony/IMms;->addTextMessageDraft(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri;
+HSPLcom/android/internal/telephony/IMms;->archiveStoredConversation(Ljava/lang/String;JZ)Z
+HSPLcom/android/internal/telephony/IMms;->deleteStoredConversation(Ljava/lang/String;J)Z
+HSPLcom/android/internal/telephony/IMms;->deleteStoredMessage(Ljava/lang/String;Landroid/net/Uri;)Z
+HSPLcom/android/internal/telephony/IMms;->downloadMessage(ILjava/lang/String;Ljava/lang/String;Landroid/net/Uri;Landroid/os/Bundle;Landroid/app/PendingIntent;)V
+HSPLcom/android/internal/telephony/IMms;->getAutoPersisting()Z
+HSPLcom/android/internal/telephony/IMms;->getCarrierConfigValues(I)Landroid/os/Bundle;
+HSPLcom/android/internal/telephony/IMms;->importMultimediaMessage(Ljava/lang/String;Landroid/net/Uri;Ljava/lang/String;JZZ)Landroid/net/Uri;
+HSPLcom/android/internal/telephony/IMms;->importTextMessage(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;JZZ)Landroid/net/Uri;
+HSPLcom/android/internal/telephony/IMms;->sendMessage(ILjava/lang/String;Landroid/net/Uri;Ljava/lang/String;Landroid/os/Bundle;Landroid/app/PendingIntent;)V
+HSPLcom/android/internal/telephony/IMms;->sendStoredMessage(ILjava/lang/String;Landroid/net/Uri;Landroid/os/Bundle;Landroid/app/PendingIntent;)V
+HSPLcom/android/internal/telephony/IMms;->setAutoPersisting(Ljava/lang/String;Z)V
+HSPLcom/android/internal/telephony/IMms;->updateStoredMessageStatus(Ljava/lang/String;Landroid/net/Uri;Landroid/content/ContentValues;)Z
+HSPLcom/android/internal/textservice/ITextServicesManager;->finishSpellCheckerService(Lcom/android/internal/textservice/ISpellCheckerSessionListener;)V
+HSPLcom/android/internal/textservice/ITextServicesManager;->getCurrentSpellChecker(Ljava/lang/String;)Landroid/view/textservice/SpellCheckerInfo;
+HSPLcom/android/internal/textservice/ITextServicesManager;->getCurrentSpellCheckerSubtype(Ljava/lang/String;Z)Landroid/view/textservice/SpellCheckerSubtype;
+HSPLcom/android/internal/textservice/ITextServicesManager;->getEnabledSpellCheckers()[Landroid/view/textservice/SpellCheckerInfo;
+HSPLcom/android/internal/textservice/ITextServicesManager;->getSpellCheckerService(Ljava/lang/String;Ljava/lang/String;Lcom/android/internal/textservice/ITextServicesSessionListener;Lcom/android/internal/textservice/ISpellCheckerSessionListener;Landroid/os/Bundle;)V
+HSPLcom/android/internal/textservice/ITextServicesManager;->isSpellCheckerEnabled()Z
+HSPLcom/android/internal/util/DumpUtils$Dump;->dump(Ljava/io/PrintWriter;Ljava/lang/String;)V
+HSPLcom/android/internal/util/FastPrintWriter;->println(C)V
+HSPLcom/android/internal/util/FileRotator$Rewriter;->reset()V
+HSPLcom/android/internal/util/FileRotator$Rewriter;->shouldWrite()Z
+HSPLcom/android/internal/util/FileRotator$Writer;->write(Ljava/io/OutputStream;)V
+HSPLcom/android/internal/util/XmlUtils$ReadMapCallback;->readThisUnknownObjectXml(Lorg/xmlpull/v1/XmlPullParser;Ljava/lang/String;)Ljava/lang/Object;
+HSPLcom/android/internal/view/IInputMethod;->attachToken(Landroid/os/IBinder;)V
+HSPLcom/android/internal/view/IInputMethod;->bindInput(Landroid/view/inputmethod/InputBinding;)V
+HSPLcom/android/internal/view/IInputMethod;->changeInputMethodSubtype(Landroid/view/inputmethod/InputMethodSubtype;)V
+HSPLcom/android/internal/view/IInputMethod;->createSession(Landroid/view/InputChannel;Lcom/android/internal/view/IInputSessionCallback;)V
+HSPLcom/android/internal/view/IInputMethod;->hideSoftInput(ILandroid/os/ResultReceiver;)V
+HSPLcom/android/internal/view/IInputMethod;->revokeSession(Lcom/android/internal/view/IInputMethodSession;)V
+HSPLcom/android/internal/view/IInputMethod;->setSessionEnabled(Lcom/android/internal/view/IInputMethodSession;Z)V
+HSPLcom/android/internal/view/IInputMethod;->showSoftInput(ILandroid/os/ResultReceiver;)V
+HSPLcom/android/internal/view/IInputMethod;->startInput(Landroid/os/IBinder;Lcom/android/internal/view/IInputContext;ILandroid/view/inputmethod/EditorInfo;Z)V
+HSPLcom/android/internal/view/IInputMethod;->unbindInput()V
+HSPLcom/android/internal/view/IInputSessionCallback;->sessionCreated(Lcom/android/internal/view/IInputMethodSession;)V
+HSPLcom/android/internal/widget/ILockSettings;->addEscrowToken([BI)J
+HSPLcom/android/internal/widget/ILockSettings;->checkCredential(Ljava/lang/String;IILcom/android/internal/widget/ICheckCredentialProgressCallback;)Lcom/android/internal/widget/VerifyCredentialResponse;
+HSPLcom/android/internal/widget/ILockSettings;->checkVoldPassword(I)Z
+HSPLcom/android/internal/widget/ILockSettings;->getBoolean(Ljava/lang/String;ZI)Z
+HSPLcom/android/internal/widget/ILockSettings;->getLong(Ljava/lang/String;JI)J
+HSPLcom/android/internal/widget/ILockSettings;->getSeparateProfileChallengeEnabled(I)Z
+HSPLcom/android/internal/widget/ILockSettings;->getString(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;
+HSPLcom/android/internal/widget/ILockSettings;->getStrongAuthForUser(I)I
+HSPLcom/android/internal/widget/ILockSettings;->havePassword(I)Z
+HSPLcom/android/internal/widget/ILockSettings;->havePattern(I)Z
+HSPLcom/android/internal/widget/ILockSettings;->isEscrowTokenActive(JI)Z
+HSPLcom/android/internal/widget/ILockSettings;->registerStrongAuthTracker(Landroid/app/trust/IStrongAuthTracker;)V
+HSPLcom/android/internal/widget/ILockSettings;->removeEscrowToken(JI)Z
+HSPLcom/android/internal/widget/ILockSettings;->requireStrongAuth(II)V
+HSPLcom/android/internal/widget/ILockSettings;->resetKeyStore(I)V
+HSPLcom/android/internal/widget/ILockSettings;->setBoolean(Ljava/lang/String;ZI)V
+HSPLcom/android/internal/widget/ILockSettings;->setLockCredential(Ljava/lang/String;ILjava/lang/String;II)V
+HSPLcom/android/internal/widget/ILockSettings;->setLockCredentialWithToken(Ljava/lang/String;IJ[BII)Z
+HSPLcom/android/internal/widget/ILockSettings;->setLong(Ljava/lang/String;JI)V
+HSPLcom/android/internal/widget/ILockSettings;->setSeparateProfileChallengeEnabled(IZLjava/lang/String;)V
+HSPLcom/android/internal/widget/ILockSettings;->setString(Ljava/lang/String;Ljava/lang/String;I)V
+HSPLcom/android/internal/widget/ILockSettings;->systemReady()V
+HSPLcom/android/internal/widget/ILockSettings;->unlockUserWithToken(J[BI)V
+HSPLcom/android/internal/widget/ILockSettings;->unregisterStrongAuthTracker(Landroid/app/trust/IStrongAuthTracker;)V
+HSPLcom/android/internal/widget/ILockSettings;->userPresent(I)V
+HSPLcom/android/internal/widget/ILockSettings;->verifyCredential(Ljava/lang/String;IJI)Lcom/android/internal/widget/VerifyCredentialResponse;
+HSPLcom/android/internal/widget/ILockSettings;->verifyTiedProfileChallenge(Ljava/lang/String;IJI)Lcom/android/internal/widget/VerifyCredentialResponse;
+HSPLcom/android/org/bouncycastle/asn1/ASN1BitString;->encode(Lcom/android/org/bouncycastle/asn1/ASN1OutputStream;)V
+HSPLcom/android/org/bouncycastle/asn1/ASN1Null;->encode(Lcom/android/org/bouncycastle/asn1/ASN1OutputStream;)V
+HSPLcom/android/org/bouncycastle/asn1/ASN1Set;->encode(Lcom/android/org/bouncycastle/asn1/ASN1OutputStream;)V
+HSPLcom/android/org/bouncycastle/asn1/ASN1String;->getString()Ljava/lang/String;
+HSPLcom/android/server/WidgetBackupProvider;->getWidgetParticipants(I)Ljava/util/List;
+HSPLcom/android/server/WidgetBackupProvider;->getWidgetState(Ljava/lang/String;I)[B
+HSPLcom/android/server/WidgetBackupProvider;->restoreFinished(I)V
+HSPLcom/android/server/WidgetBackupProvider;->restoreStarting(I)V
+HSPLcom/android/server/WidgetBackupProvider;->restoreWidgetState(Ljava/lang/String;[BI)V
+HSPLcom/android/server/net/NetlinkTracker$Callback;->update()V
+HSPLjava/lang/Character;->toChars(I[CI)I
+HSPLjava/lang/IllegalStateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
+HSPLjava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
+HSPLjava/lang/StringBuffer;->append(Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder;
+HSPLjava/lang/StringBuffer;->append(Ljava/lang/CharSequence;II)Ljava/lang/StringBuffer;
+HSPLjava/math/MathContext;->getPrecision()I
+HSPLjava/math/MathContext;->getRoundingMode()Ljava/math/RoundingMode;
+HSPLjava/net/ProtocolFamily;->name()Ljava/lang/String;
+HSPLjava/security/interfaces/DSAParams;->getG()Ljava/math/BigInteger;
+HSPLjava/security/interfaces/DSAParams;->getP()Ljava/math/BigInteger;
+HSPLjava/security/interfaces/DSAParams;->getQ()Ljava/math/BigInteger;
+HSPLjava/time/Clock;->getZone()Ljava/time/ZoneId;
+HSPLjava/time/Clock;->instant()Ljava/time/Instant;
+HSPLjava/time/Clock;->withZone(Ljava/time/ZoneId;)Ljava/time/Clock;
+HSPLjava/time/chrono/AbstractChronology$$Lambda$0;-><init>()V
+HSPLjava/time/chrono/AbstractChronology$$Lambda$1;-><init>()V
+HSPLjava/time/chrono/AbstractChronology$$Lambda$2;-><init>()V
+HSPLjava/time/chrono/ChronoLocalDate;->equals(Ljava/lang/Object;)Z
+HSPLjava/time/chrono/ChronoLocalDate;->getChronology()Ljava/time/chrono/Chronology;
+HSPLjava/time/chrono/ChronoLocalDate;->hashCode()I
+HSPLjava/time/chrono/ChronoLocalDate;->lengthOfMonth()I
+HSPLjava/time/chrono/ChronoLocalDate;->toString()Ljava/lang/String;
+HSPLjava/time/chrono/ChronoLocalDate;->until(Ljava/time/chrono/ChronoLocalDate;)Ljava/time/chrono/ChronoPeriod;
+HSPLjava/time/chrono/ChronoLocalDate;->until(Ljava/time/temporal/Temporal;Ljava/time/temporal/TemporalUnit;)J
+HSPLjava/time/chrono/ChronoLocalDateTime;->atZone(Ljava/time/ZoneId;)Ljava/time/chrono/ChronoZonedDateTime;
+HSPLjava/time/chrono/ChronoLocalDateTime;->equals(Ljava/lang/Object;)Z
+HSPLjava/time/chrono/ChronoLocalDateTime;->hashCode()I
+HSPLjava/time/chrono/ChronoLocalDateTime;->isSupported(Ljava/time/temporal/TemporalField;)Z
+HSPLjava/time/chrono/ChronoLocalDateTime;->plus(JLjava/time/temporal/TemporalUnit;)Ljava/time/chrono/ChronoLocalDateTime;
+HSPLjava/time/chrono/ChronoLocalDateTime;->toLocalDate()Ljava/time/chrono/ChronoLocalDate;
+HSPLjava/time/chrono/ChronoLocalDateTime;->toLocalTime()Ljava/time/LocalTime;
+HSPLjava/time/chrono/ChronoLocalDateTime;->toString()Ljava/lang/String;
+HSPLjava/time/chrono/ChronoLocalDateTime;->with(Ljava/time/temporal/TemporalField;J)Ljava/time/chrono/ChronoLocalDateTime;
+HSPLjava/time/chrono/Chronology;->compareTo(Ljava/time/chrono/Chronology;)I
+HSPLjava/time/chrono/Chronology;->date(III)Ljava/time/chrono/ChronoLocalDate;
+HSPLjava/time/chrono/Chronology;->date(Ljava/time/temporal/TemporalAccessor;)Ljava/time/chrono/ChronoLocalDate;
+HSPLjava/time/chrono/Chronology;->dateEpochDay(J)Ljava/time/chrono/ChronoLocalDate;
+HSPLjava/time/chrono/Chronology;->dateYearDay(II)Ljava/time/chrono/ChronoLocalDate;
+HSPLjava/time/chrono/Chronology;->equals(Ljava/lang/Object;)Z
+HSPLjava/time/chrono/Chronology;->eraOf(I)Ljava/time/chrono/Era;
+HSPLjava/time/chrono/Chronology;->eras()Ljava/util/List;
+HSPLjava/time/chrono/Chronology;->getCalendarType()Ljava/lang/String;
+HSPLjava/time/chrono/Chronology;->getId()Ljava/lang/String;
+HSPLjava/time/chrono/Chronology;->hashCode()I
+HSPLjava/time/chrono/Chronology;->isLeapYear(J)Z
+HSPLjava/time/chrono/Chronology;->prolepticYear(Ljava/time/chrono/Era;I)I
+HSPLjava/time/chrono/Chronology;->range(Ljava/time/temporal/ChronoField;)Ljava/time/temporal/ValueRange;
+HSPLjava/time/chrono/Chronology;->resolveDate(Ljava/util/Map;Ljava/time/format/ResolverStyle;)Ljava/time/chrono/ChronoLocalDate;
+HSPLjava/time/chrono/Chronology;->toString()Ljava/lang/String;
+HSPLjava/time/temporal/TemporalAmount;->addTo(Ljava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;
+HSPLjava/time/temporal/TemporalAmount;->get(Ljava/time/temporal/TemporalUnit;)J
+HSPLjava/time/temporal/TemporalAmount;->getUnits()Ljava/util/List;
+HSPLjava/time/temporal/TemporalAmount;->subtractFrom(Ljava/time/temporal/Temporal;)Ljava/time/temporal/Temporal;
+HSPLjava/time/temporal/TemporalField;->adjustInto(Ljava/time/temporal/Temporal;J)Ljava/time/temporal/Temporal;
+HSPLjava/time/temporal/TemporalField;->getBaseUnit()Ljava/time/temporal/TemporalUnit;
+HSPLjava/time/temporal/TemporalField;->getFrom(Ljava/time/temporal/TemporalAccessor;)J
+HSPLjava/time/temporal/TemporalField;->getRangeUnit()Ljava/time/temporal/TemporalUnit;
+HSPLjava/time/temporal/TemporalField;->isDateBased()Z
+HSPLjava/time/temporal/TemporalField;->isSupportedBy(Ljava/time/temporal/TemporalAccessor;)Z
+HSPLjava/time/temporal/TemporalField;->isTimeBased()Z
+HSPLjava/time/temporal/TemporalField;->range()Ljava/time/temporal/ValueRange;
+HSPLjava/time/temporal/TemporalField;->rangeRefinedBy(Ljava/time/temporal/TemporalAccessor;)Ljava/time/temporal/ValueRange;
+HSPLjava/time/temporal/TemporalField;->toString()Ljava/lang/String;
+HSPLjava/time/temporal/TemporalUnit;->addTo(Ljava/time/temporal/Temporal;J)Ljava/time/temporal/Temporal;
+HSPLjava/time/temporal/TemporalUnit;->between(Ljava/time/temporal/Temporal;Ljava/time/temporal/Temporal;)J
+HSPLjava/time/temporal/TemporalUnit;->getDuration()Ljava/time/Duration;
+HSPLjava/time/temporal/TemporalUnit;->isDateBased()Z
+HSPLjava/time/temporal/TemporalUnit;->isDurationEstimated()Z
+HSPLjava/time/temporal/TemporalUnit;->isTimeBased()Z
+HSPLjava/time/temporal/TemporalUnit;->toString()Ljava/lang/String;
+HSPLjava/time/zone/ZoneRulesProvider;->provideRules(Ljava/lang/String;Z)Ljava/time/zone/ZoneRules;
+HSPLjava/time/zone/ZoneRulesProvider;->provideVersions(Ljava/lang/String;)Ljava/util/NavigableMap;
+HSPLjava/time/zone/ZoneRulesProvider;->provideZoneIds()Ljava/util/Set;
+HSPLjava/util/Collection;->stream()Ljava/util/stream/Stream;
+HSPLjava/util/Comparator$$Lambda$0;-><init>(Ljava/util/Comparator;Ljava/util/Comparator;)V
+HSPLjava/util/Comparator$$Lambda$0;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
+HSPLjava/util/Comparator;->lambda$thenComparing$36697e65$1$Comparator(Ljava/util/Comparator;Ljava/lang/Object;Ljava/lang/Object;)I
+HSPLjava/util/Comparator;->nullsLast(Ljava/util/Comparator;)Ljava/util/Comparator;
+HSPLjava/util/Comparator;->thenComparing(Ljava/util/Comparator;)Ljava/util/Comparator;
+HSPLjava/util/Comparators$NullComparator;-><init>(ZLjava/util/Comparator;)V
+HSPLjava/util/Map;->computeIfAbsent(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;
+HSPLjava/util/Map;->getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
+HSPLjava/util/concurrent/CompletionStage;->acceptEither(Ljava/util/concurrent/CompletionStage;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->acceptEitherAsync(Ljava/util/concurrent/CompletionStage;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->acceptEitherAsync(Ljava/util/concurrent/CompletionStage;Ljava/util/function/Consumer;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->applyToEither(Ljava/util/concurrent/CompletionStage;Ljava/util/function/Function;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->applyToEitherAsync(Ljava/util/concurrent/CompletionStage;Ljava/util/function/Function;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->applyToEitherAsync(Ljava/util/concurrent/CompletionStage;Ljava/util/function/Function;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->exceptionally(Ljava/util/function/Function;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->handle(Ljava/util/function/BiFunction;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->handleAsync(Ljava/util/function/BiFunction;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->handleAsync(Ljava/util/function/BiFunction;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->runAfterBoth(Ljava/util/concurrent/CompletionStage;Ljava/lang/Runnable;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->runAfterBothAsync(Ljava/util/concurrent/CompletionStage;Ljava/lang/Runnable;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->runAfterBothAsync(Ljava/util/concurrent/CompletionStage;Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->runAfterEither(Ljava/util/concurrent/CompletionStage;Ljava/lang/Runnable;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->runAfterEitherAsync(Ljava/util/concurrent/CompletionStage;Ljava/lang/Runnable;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->runAfterEitherAsync(Ljava/util/concurrent/CompletionStage;Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenAccept(Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenAcceptAsync(Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenAcceptAsync(Ljava/util/function/Consumer;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenAcceptBoth(Ljava/util/concurrent/CompletionStage;Ljava/util/function/BiConsumer;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenAcceptBothAsync(Ljava/util/concurrent/CompletionStage;Ljava/util/function/BiConsumer;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenAcceptBothAsync(Ljava/util/concurrent/CompletionStage;Ljava/util/function/BiConsumer;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenApply(Ljava/util/function/Function;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenApplyAsync(Ljava/util/function/Function;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenApplyAsync(Ljava/util/function/Function;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenCombine(Ljava/util/concurrent/CompletionStage;Ljava/util/function/BiFunction;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenCombineAsync(Ljava/util/concurrent/CompletionStage;Ljava/util/function/BiFunction;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenCombineAsync(Ljava/util/concurrent/CompletionStage;Ljava/util/function/BiFunction;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenCompose(Ljava/util/function/Function;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenComposeAsync(Ljava/util/function/Function;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenComposeAsync(Ljava/util/function/Function;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenRun(Ljava/lang/Runnable;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenRunAsync(Ljava/lang/Runnable;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->thenRunAsync(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->toCompletableFuture()Ljava/util/concurrent/CompletableFuture;
+HSPLjava/util/concurrent/CompletionStage;->whenComplete(Ljava/util/function/BiConsumer;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->whenCompleteAsync(Ljava/util/function/BiConsumer;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CompletionStage;->whenCompleteAsync(Ljava/util/function/BiConsumer;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletionStage;
+HSPLjava/util/concurrent/CopyOnWriteArrayList;->sort(Ljava/util/Comparator;)V
+HSPLjava/util/concurrent/ForkJoinPool$ForkJoinWorkerThreadFactory;->newThread(Ljava/util/concurrent/ForkJoinPool;)Ljava/util/concurrent/ForkJoinWorkerThread;
+HSPLjava/util/prefs/PreferencesFactory;->systemRoot()Ljava/util/prefs/Preferences;
+HSPLjava/util/prefs/PreferencesFactory;->userRoot()Ljava/util/prefs/Preferences;
+HSPLjava/util/stream/Collector;->accumulator()Ljava/util/function/BiConsumer;
+HSPLjava/util/stream/Collector;->characteristics()Ljava/util/Set;
+HSPLjava/util/stream/Collector;->combiner()Ljava/util/function/BinaryOperator;
+HSPLjava/util/stream/Collector;->finisher()Ljava/util/function/Function;
+HSPLjava/util/stream/Collector;->supplier()Ljava/util/function/Supplier;
+HSPLjava/util/stream/Collectors$$Lambda$1;-><init>()V
+HSPLjava/util/stream/Collectors$$Lambda$4;-><init>()V
+HSPLjava/util/stream/Collectors$$Lambda$4;->get()Ljava/lang/Object;
+HSPLjava/util/stream/Collectors$$Lambda$58;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
+HSPLjava/util/stream/Collectors$$Lambda$5;-><init>()V
+HSPLjava/util/stream/Collectors$$Lambda$5;->accept(Ljava/lang/Object;Ljava/lang/Object;)V
+HSPLjava/util/stream/Collectors$$Lambda$6;-><init>()V
+HSPLjava/util/stream/Collectors$$Lambda$88;-><init>(Ljava/util/function/Supplier;)V
+HSPLjava/util/stream/Collectors$$Lambda$88;->apply(Ljava/lang/Object;)Ljava/lang/Object;
+HSPLjava/util/stream/Collectors;->lambda$groupingBy$45$Collectors(Ljava/util/function/Function;Ljava/util/function/Supplier;Ljava/util/function/BiConsumer;Ljava/util/Map;Ljava/lang/Object;)V
+HSPLjava/util/stream/Collectors;->lambda$null$44$Collectors(Ljava/util/function/Supplier;Ljava/lang/Object;)Ljava/lang/Object;
+HSPLjava/util/stream/IntPipeline$$Lambda$14;-><init>()V
+HSPLjava/util/stream/IntPipeline$$Lambda$1;-><init>()V
+HSPLjava/util/stream/IntPipeline$$Lambda$1;->apply(I)Ljava/lang/Object;
+HSPLjava/util/stream/IntPipeline$$Lambda$2;-><init>()V
+HSPLjava/util/stream/IntPipeline$$Lambda$2;->applyAsInt(Ljava/lang/Object;)I
+HSPLjava/util/stream/IntPipeline;->lambda$distinct$0$IntPipeline(Ljava/lang/Integer;)I
+HSPLjava/util/stream/Nodes$EmptyNode$OfRef;-><init>(Ljava/util/stream/Nodes$1;)V
+HSPLjava/util/stream/ReduceOps$AccumulatingSink;->combine(Ljava/util/stream/ReduceOps$AccumulatingSink;)V
+HSPLjava/util/stream/ReduceOps$ReduceOp;->makeSink()Ljava/util/stream/ReduceOps$AccumulatingSink;
+HSPLjava/util/stream/ReferencePipeline$StatefulOp;->opEvaluateParallel(Ljava/util/stream/PipelineHelper;Ljava/util/Spliterator;Ljava/util/function/IntFunction;)Ljava/util/stream/Node;
+HSPLjava/util/stream/Sink$OfInt;->accept(I)V
+HSPLjava/util/stream/SpinedBuffer$OfPrimitive;->arrayForEach(Ljava/lang/Object;IILjava/lang/Object;)V
+HSPLjava/util/stream/SpinedBuffer$OfPrimitive;->arrayLength(Ljava/lang/Object;)I
+HSPLjava/util/stream/SpinedBuffer$OfPrimitive;->forEach(Ljava/util/function/Consumer;)V
+HSPLjava/util/stream/SpinedBuffer$OfPrimitive;->iterator()Ljava/util/Iterator;
+HSPLjava/util/stream/SpinedBuffer$OfPrimitive;->newArray(I)Ljava/lang/Object;
+HSPLjava/util/stream/SpinedBuffer$OfPrimitive;->newArrayArray(I)[Ljava/lang/Object;
+HSPLjava/util/zip/ZipFile;->access$200(Ljava/util/zip/ZipFile;)V
+HSPLsun/security/jca/ProviderList$3;->get(I)Ljava/lang/Object;
+HSPLsun/security/jca/ProviderList$3;->get(I)Ljava/security/Provider;
+HSPLsun/security/jca/ProviderList$3;->size()I
+HSPLsun/security/jca/ProviderList;->access$100(Lsun/security/jca/ProviderList;)[Lsun/security/jca/ProviderConfig;
+PLandroid/app/ActivityThread$$Lambda$0;->onConfigurationChanged(Landroid/content/res/Configuration;)V
+PLandroid/app/ActivityThread$ApplicationThread;->scheduleLowMemory()V
+PLandroid/app/ActivityThread;->access$2200(Landroid/app/ActivityThread;Landroid/app/ActivityThread$ReceiverData;)V
+PLandroid/app/ActivityThread;->access$2500(Landroid/app/ActivityThread;Landroid/app/ActivityThread$BindServiceData;)V
+PLandroid/app/ActivityThread;->access$2700(Landroid/app/ActivityThread;Landroid/os/IBinder;)V
+PLandroid/app/ActivityThread;->access$500(Landroid/app/ActivityThread;ILjava/lang/Object;)V
+PLandroid/app/ActivityThread;->handleLowMemory()V
+PLandroid/app/ActivityThread;->lambda$attach$0$ActivityThread(Landroid/content/res/Configuration;)V
+PLandroid/app/Application;->onLowMemory()V
+PLandroid/app/Notification;->getGroupAlertBehavior()I
+PLandroid/app/Notification;->suppressAlertingDueToGrouping()Z
+PLandroid/app/Service;->onLowMemory()V
+PLandroid/app/WindowConfiguration;->persistTaskBounds()Z
+PLandroid/content/ContentProvider;->onLowMemory()V
+PLandroid/content/pm/PackageParser$CachedComponentArgs;-><init>(Landroid/content/pm/PackageParser$1;)V
+PLandroid/content/pm/ResolveInfo;-><init>(Landroid/content/pm/ResolveInfo;)V
+PLandroid/graphics/Canvas;->freeCaches()V
+PLandroid/media/AudioManager;->isAudioFocusExclusive()Z
+PLandroid/media/IRingtonePlayer$Stub$Proxy;->playAsync(Landroid/net/Uri;Landroid/os/UserHandle;ZLandroid/media/AudioAttributes;)V
+PLandroid/net/LinkProperties;->ensureDirectlyConnectedRoutes()V
+PLandroid/net/Network$$Lambda$0;-><init>(Landroid/net/Network;)V
+PLandroid/net/Network$$Lambda$0;->lookup(Ljava/lang/String;)Ljava/util/List;
+PLandroid/net/Network;->lambda$maybeInitUrlConnectionFactory$0$Network(Ljava/lang/String;)Ljava/util/List;
+PLandroid/net/Network;->maybeInitUrlConnectionFactory()V
+PLandroid/net/wifi/WifiConfiguration$NetworkSelectionStatus;->incrementDisableReasonCounter(I)V
+PLandroid/os/BatteryStats$LevelStepTracker;->computeTimePerLevel()J
+PLandroid/os/ParcelFileDescriptor$2;->createFromParcel(Landroid/os/Parcel;)Landroid/os/ParcelFileDescriptor;
+PLandroid/os/ParcelFileDescriptor$2;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;
+PLandroid/os/RemoteCallback$1;->sendResult(Landroid/os/Bundle;)V
+PLandroid/os/RemoteCallback$3;-><init>()V
+PLandroid/service/notification/INotificationListener$Stub$Proxy;->onNotificationRankingUpdate(Landroid/service/notification/NotificationRankingUpdate;)V
+PLandroid/telecom/Logging/SessionManager$$Lambda$0;->run()V
+PLandroid/telecom/Logging/SessionManager;->lambda$new$0$SessionManager()V
+PLandroid/text/BoringLayout;->init(Ljava/lang/CharSequence;Landroid/text/TextPaint;Landroid/text/Layout$Alignment;Landroid/text/BoringLayout$Metrics;ZZ)V
+PLandroid/text/style/TextAppearanceSpan;->getSpanTypeIdInternal()I
+PLandroid/util/Slog;->wtf(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
+PLandroid/util/jar/StrictJarFile$EntryIterator;-><init>(JLjava/lang/String;)V
+PLandroid/util/jar/StrictJarFile;->access$000(JLjava/lang/String;)J
+PLandroid/util/jar/StrictJarFile;->getMetaEntries()Ljava/util/HashMap;
+PLandroid/util/jar/StrictJarFile;->iterator()Ljava/util/Iterator;
+PLandroid/util/jar/StrictJarManifest;->getMainAttributesEnd()I
+PLandroid/util/jar/StrictJarManifestReader;-><init>([BLjava/util/jar/Attributes;)V
+PLandroid/util/jar/StrictJarVerifier;-><init>(Ljava/lang/String;Landroid/util/jar/StrictJarManifest;Ljava/util/HashMap;Z)V
+PLandroid/util/jar/StrictJarVerifier;->isSignedJar()Z
+PLandroid/util/jar/StrictJarVerifier;->readCertificates()Z
+PLandroid/util/jar/StrictJarVerifier;->verify(Ljava/util/jar/Attributes;Ljava/lang/String;[BIIZZ)Z
+PLandroid/util/jar/StrictJarVerifier;->verifyBytes([B[B)[Ljava/security/cert/Certificate;
+PLandroid/util/jar/StrictJarVerifier;->verifyCertificate(Ljava/lang/String;)V
+PLandroid/view/ViewRootImpl;->access$200(Landroid/view/ViewRootImpl;)Landroid/util/MergedConfiguration;
+PLandroid/view/ViewRootImpl;->access$500(Landroid/view/ViewRootImpl;)V
+PLandroid/view/autofill/IAutoFillManagerClient$Stub$Proxy;->setState(ZZZ)V
+PLandroid/widget/RemoteViews$2;->createFromParcel(Landroid/os/Parcel;)Landroid/widget/RemoteViews;
+PLandroid/widget/RemoteViews$2;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;
+PLandroid/widget/TextView$TextAppearanceAttributes;-><init>()V
+PLandroid/widget/TextView$TextAppearanceAttributes;-><init>(Landroid/widget/TextView$1;)V
+PLandroid/widget/TextView;->applyTextAppearance(Landroid/widget/TextView$TextAppearanceAttributes;)V
+PLandroid/widget/TextView;->readTextAppearance(Landroid/content/Context;Landroid/content/res/TypedArray;Landroid/widget/TextView$TextAppearanceAttributes;Z)V
+PLcom/android/internal/app/ResolverActivity$ActionTitle;-><init>(Ljava/lang/String;ILjava/lang/String;III)V
+PLcom/android/internal/app/ResolverActivity$ActionTitle;->forAction(Ljava/lang/String;)Lcom/android/internal/app/ResolverActivity$ActionTitle;
+PLcom/android/internal/app/ResolverActivity$ActionTitle;->values()[Lcom/android/internal/app/ResolverActivity$ActionTitle;
+PLcom/android/internal/app/ResolverActivity;->getLabelRes(Ljava/lang/String;)I
+PLcom/android/internal/app/procstats/DumpUtils;->dumpAdjTimesCheckin(Ljava/io/PrintWriter;Ljava/lang/String;[JIJJ)V
+PLcom/android/internal/app/procstats/ProcessState$PssAggr;->add(JJ)V
+PLcom/android/internal/app/procstats/ProcessState;->getPssAverage(I)J
+PLcom/android/internal/app/procstats/ProcessStats$TotalMemoryUseCollection;-><init>([I[I)V
+PLcom/android/internal/app/procstats/ProcessStats;->read(Ljava/io/InputStream;)V
+PLcom/android/internal/app/procstats/ProcessStats;->readCheckedInt(Landroid/os/Parcel;ILjava/lang/String;)Z
+PLcom/android/internal/app/procstats/ProcessStats;->readCompactedLongArray(Landroid/os/Parcel;I[JI)V
+PLcom/android/internal/app/procstats/ProcessStats;->readFully(Ljava/io/InputStream;[I)[B
+PLcom/android/internal/app/procstats/ServiceState;->dumpTimesCheckin(Ljava/io/PrintWriter;Ljava/lang/String;IILjava/lang/String;J)V
+PLcom/android/internal/app/procstats/SparseMappingTable$Table;->getKey(B)I
+PLcom/android/internal/app/procstats/SparseMappingTable;->readFromParcel(Landroid/os/Parcel;)V
+PLcom/android/internal/app/procstats/SysMemUsageTable;->getTotalMemUsage()[J
+PLcom/android/internal/os/WifiPowerEstimator;-><init>(Lcom/android/internal/os/PowerProfile;)V
+PLcom/android/internal/os/WifiPowerEstimator;->calculateRemaining(Lcom/android/internal/os/BatterySipper;Landroid/os/BatteryStats;JJI)V
+PLcom/android/internal/os/WifiPowerEstimator;->getWifiPowerPerPacket(Lcom/android/internal/os/PowerProfile;)D
+PLcom/android/internal/os/WifiPowerEstimator;->reset()V
+PLcom/android/okhttp/ConnectionSpecs;->builder(Z)Lcom/android/okhttp/ConnectionSpec$Builder;
+PLcom/android/okhttp/OkUrlFactories;->open(Lcom/android/okhttp/OkUrlFactory;Ljava/net/URL;Ljava/net/Proxy;)Ljava/net/HttpURLConnection;
+PLcom/android/okhttp/OkUrlFactories;->setUrlFilter(Lcom/android/okhttp/OkUrlFactory;Lcom/android/okhttp/internal/URLFilter;)V
+PLcom/android/org/conscrypt/ActiveSession;->configurePeer(Ljava/lang/String;I[Ljava/security/cert/X509Certificate;)V
+PLcom/android/org/conscrypt/ActiveSession;->onPeerCertificateAvailable(Ljava/lang/String;I)V
+PLcom/android/org/conscrypt/ActiveSession;->onPeerCertificatesReceived(Ljava/lang/String;I[Ljava/security/cert/X509Certificate;)V
+PLcom/android/org/conscrypt/ConscryptFileDescriptorSocket;->verifyCertificateChain([[BLjava/lang/String;)V
+PLcom/android/org/conscrypt/ExtendedSessionAdapter$ExtendedWrapper;->getCipherSuite()Ljava/lang/String;
+PLcom/android/org/conscrypt/ExtendedSessionAdapter$ExtendedWrapper;->getLocalCertificates()[Ljava/security/cert/Certificate;
+PLcom/android/org/conscrypt/ExtendedSessionAdapter$ExtendedWrapper;->getPeerCertificates()[Ljava/security/cert/Certificate;
+PLcom/android/org/conscrypt/ExtendedSessionAdapter;->getExtendedSslSessionClass()Ljava/lang/Class;
+PLcom/android/org/conscrypt/SSLUtils;->decodeX509Certificate(Ljava/security/cert/CertificateFactory;[B)Ljava/security/cert/X509Certificate;
+PLcom/android/org/conscrypt/SSLUtils;->decodeX509CertificateChain([[B)[Ljava/security/cert/X509Certificate;
+PLcom/android/org/conscrypt/SSLUtils;->getCertificateFactory()Ljava/security/cert/CertificateFactory;
+PLcom/android/org/conscrypt/SslWrapper;->getLocalCertificates()[Ljava/security/cert/X509Certificate;
+PLjava/io/PrintWriter;->print(D)V
+PLjava/util/Base64$Encoder;->access$200()[C
+PLjava/util/Base64$Encoder;->access$300()[C
+PLjava/util/Base64$Encoder;->encode([B)[B
+PLjava/util/Base64$Encoder;->encodeToString([B)Ljava/lang/String;
+PLjava/util/Base64$Encoder;->outLength(I)I
+PLjava/util/Base64;->getEncoder()Ljava/util/Base64$Encoder;
+PLjava/util/stream/Nodes$IntArrayNode;->asPrimitiveArray()Ljava/lang/Object;
+PLjava/util/stream/Nodes$IntArrayNode;->asPrimitiveArray()[I
+PLjava/util/stream/Nodes$IntFixedNodeBuilder;->accept(I)V
+PLjava/util/stream/Nodes$IntFixedNodeBuilder;->begin(J)V
+PLjava/util/stream/Nodes$IntFixedNodeBuilder;->build()Ljava/util/stream/Node$OfInt;
+PLjava/util/stream/Nodes$IntFixedNodeBuilder;->build()Ljava/util/stream/Node;
+PLjava/util/stream/Nodes$IntFixedNodeBuilder;->end()V
+PLlibcore/io/Streams;->readFully(Ljava/io/InputStream;)[B
+PLlibcore/net/http/HttpHandler$CleartextURLFilter;-><init>()V
+PLlibcore/net/http/HttpHandler$CleartextURLFilter;-><init>(Llibcore/net/http/HttpHandler$1;)V
+PLlibcore/net/http/HttpHandler$CleartextURLFilter;->checkURLPermitted(Ljava/net/URL;)V
+PLlibcore/net/http/HttpHandler;-><init>()V
+PLlibcore/net/http/HttpHandler;->createHttpOkUrlFactory(Ljava/net/Proxy;)Lcom/android/okhttp/OkUrlFactory;
+PLlibcore/net/http/HttpURLConnectionFactory$DnsAdapter;-><init>(Llibcore/net/http/Dns;)V
+PLlibcore/net/http/HttpURLConnectionFactory$DnsAdapter;->hashCode()I
+PLlibcore/net/http/HttpURLConnectionFactory$DnsAdapter;->lookup(Ljava/lang/String;)Ljava/util/List;
+PLlibcore/net/http/HttpURLConnectionFactory;-><init>()V
+PLlibcore/net/http/HttpURLConnectionFactory;->internalOpenConnection(Ljava/net/URL;Ljavax/net/SocketFactory;Ljava/net/Proxy;)Ljava/net/URLConnection;
+PLlibcore/net/http/HttpURLConnectionFactory;->openConnection(Ljava/net/URL;Ljavax/net/SocketFactory;Ljava/net/Proxy;)Ljava/net/URLConnection;
+PLlibcore/net/http/HttpURLConnectionFactory;->setDns(Llibcore/net/http/Dns;)V
+PLlibcore/net/http/HttpURLConnectionFactory;->setNewConnectionPool(IJLjava/util/concurrent/TimeUnit;)V
+PLlibcore/net/http/HttpsHandler;-><init>()V
+PLlibcore/net/http/HttpsHandler;->createHttpsOkUrlFactory(Ljava/net/Proxy;)Lcom/android/okhttp/OkUrlFactory;
+PLsun/security/util/DerInputBuffer;->getGeneralizedTime(I)Ljava/util/Date;
+PLsun/security/util/DerInputStream;->getGeneralizedTime()Ljava/util/Date;
diff --git a/config/preloaded-classes b/config/preloaded-classes
index 5da7809..cd29653 100644
--- a/config/preloaded-classes
+++ b/config/preloaded-classes
@@ -1159,6 +1159,7 @@
 android.icu.impl.ICUService$CacheEntry
 android.icu.impl.ICUService$Factory
 android.icu.impl.ICUService$Key
+android.icu.impl.IDNA2003
 android.icu.impl.LocaleIDParser
 android.icu.impl.LocaleIDs
 android.icu.impl.Norm2AllModes
@@ -1254,6 +1255,7 @@
 android.icu.impl.locale.LocaleObjectCache
 android.icu.impl.locale.LocaleObjectCache$CacheEntry
 android.icu.impl.locale.LocaleSyntaxException
+android.icu.impl.number.Parse
 android.icu.lang.UCharacter
 android.icu.lang.UCharacterEnums$ECharacterCategory
 android.icu.lang.UCharacterEnums$ECharacterDirection
@@ -1468,6 +1470,7 @@
 android.media.IRingtonePlayer$Stub
 android.media.IRingtonePlayer$Stub$Proxy
 android.media.Image
+android.media.ImageReader
 android.media.JetPlayer
 android.media.MediaCodec$BufferInfo
 android.media.MediaCodec$BufferMap
@@ -1478,9 +1481,11 @@
 android.media.MediaCodecInfo$CodecProfileLevel
 android.media.MediaCodecInfo$Feature
 android.media.MediaCodecInfo$VideoCapabilities
+android.media.MediaCodecList
 android.media.MediaFormat
 android.media.MediaMetadata$1
 android.media.MediaMetadata$Builder
+android.media.MediaPlayer
 android.media.MediaPlayer$1
 android.media.MediaPlayer$2
 android.media.MediaPlayer$EventHandler
@@ -1511,6 +1516,7 @@
 android.media.PlayerBase$PlayerIdCard$1
 android.media.RemoteDisplay
 android.media.Ringtone$MyOnCompletionListener
+android.media.SoundPool
 android.media.SubtitleController$Listener
 android.media.ToneGenerator
 android.media.Utils
@@ -2050,6 +2056,7 @@
 android.text.GetChars
 android.text.GraphicsOperations
 android.text.Html
+android.text.Html$HtmlParser
 android.text.HtmlToSpannedConverter$Href
 android.text.Hyphenator
 android.text.Hyphenator$HyphenationData
@@ -2099,6 +2106,7 @@
 android.text.TextUtils$StringSplitter
 android.text.TextUtils$TruncateAt
 android.text.TextWatcher
+android.text.format.Formatter
 android.text.format.Time$TimeCalculator
 android.text.method.AllCapsTransformationMethod
 android.text.method.ArrowKeyMovementMethod
@@ -4426,81 +4434,21 @@
 org.apache.harmony.xml.ExpatReader
 org.apache.harmony.xml.parsers.SAXParserFactoryImpl
 org.apache.harmony.xml.parsers.SAXParserImpl
-org.apache.http.ConnectionReuseStrategy
-org.apache.http.HeaderElement
-org.apache.http.HttpEntity
-org.apache.http.HttpException
-org.apache.http.HttpHost
-org.apache.http.HttpMessage
-org.apache.http.HttpRequest
-org.apache.http.HttpRequestInterceptor
-org.apache.http.HttpResponse
-org.apache.http.HttpResponseFactory
-org.apache.http.NameValuePair
-org.apache.http.ProtocolException
-org.apache.http.ProtocolVersion
-org.apache.http.ReasonPhraseCatalog
-org.apache.http.StatusLine
-org.apache.http.client.HttpClient
-org.apache.http.client.ResponseHandler
-org.apache.http.client.methods.AbortableHttpRequest
-org.apache.http.client.methods.HttpRequestBase
-org.apache.http.client.methods.HttpUriRequest
-org.apache.http.client.params.HttpClientParams
-org.apache.http.conn.ClientConnectionManager
-org.apache.http.conn.ClientConnectionOperator
 org.apache.http.conn.ConnectTimeoutException
-org.apache.http.conn.params.ConnManagerPNames
-org.apache.http.conn.params.ConnManagerParams$1
-org.apache.http.conn.params.ConnPerRoute
 org.apache.http.conn.scheme.LayeredSocketFactory
-org.apache.http.conn.scheme.Scheme
-org.apache.http.conn.scheme.SchemeRegistry
 org.apache.http.conn.scheme.SocketFactory
 org.apache.http.conn.ssl.AllowAllHostnameVerifier
 org.apache.http.conn.ssl.BrowserCompatHostnameVerifier
 org.apache.http.conn.ssl.StrictHostnameVerifier
 org.apache.http.conn.ssl.X509HostnameVerifier
-org.apache.http.entity.AbstractHttpEntity
-org.apache.http.entity.BasicHttpEntity
-org.apache.http.impl.DefaultConnectionReuseStrategy
-org.apache.http.impl.DefaultHttpResponseFactory
-org.apache.http.impl.client.AbstractHttpClient
-org.apache.http.impl.client.DefaultHttpClient
-org.apache.http.impl.conn.IdleConnectionHandler
-org.apache.http.impl.conn.tsccm.AbstractConnPool
-org.apache.http.impl.conn.tsccm.ConnPoolByRoute
-org.apache.http.impl.conn.tsccm.RefQueueHandler
-org.apache.http.impl.conn.tsccm.RefQueueWorker
-org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager
-org.apache.http.impl.cookie.DateParseException
-org.apache.http.impl.cookie.DateUtils$DateFormatHolder$1
-org.apache.http.message.AbstractHttpMessage
-org.apache.http.message.BasicHeader
-org.apache.http.message.BasicHeaderElement
-org.apache.http.message.BasicHttpResponse
-org.apache.http.message.BasicNameValuePair
-org.apache.http.message.BasicStatusLine
-org.apache.http.message.HeaderGroup
-org.apache.http.message.HeaderValueParser
-org.apache.http.message.ParserCursor
-org.apache.http.params.AbstractHttpParams
-org.apache.http.params.BasicHttpParams
 org.apache.http.params.CoreConnectionPNames
-org.apache.http.params.CoreProtocolPNames
 org.apache.http.params.HttpConnectionParams
 org.apache.http.params.HttpParams
-org.apache.http.params.HttpProtocolParams
-org.apache.http.protocol.BasicHttpProcessor
-org.apache.http.protocol.HTTP
-org.apache.http.protocol.HttpContext
-org.apache.http.protocol.HttpRequestInterceptorList
-org.apache.http.protocol.HttpResponseInterceptorList
-org.apache.http.util.CharArrayBuffer
 org.ccil.cowan.tagsoup.AttributesImpl
 org.ccil.cowan.tagsoup.AutoDetector
 org.ccil.cowan.tagsoup.Element
 org.ccil.cowan.tagsoup.ElementType
+org.ccil.cowan.tagsoup.HTMLScanner
 org.ccil.cowan.tagsoup.HTMLSchema
 org.ccil.cowan.tagsoup.Parser$1
 org.ccil.cowan.tagsoup.ScanHandler
diff --git a/config/preloaded-classes-extra b/config/preloaded-classes-extra
index 1934cbc..959fff5 100644
--- a/config/preloaded-classes-extra
+++ b/config/preloaded-classes-extra
@@ -1 +1,13 @@
 android.icu.impl.coll.CollationRoot
+android.icu.impl.IDNA2003
+android.icu.impl.number.Parse
+android.icu.util.TimeZone
+android.media.ImageReader
+android.media.MediaCodecList
+android.media.MediaPlayer
+android.media.SoundPool
+android.text.format.Formatter
+android.text.Html$HtmlParser
+com.android.org.conscrypt.TrustedCertificateStore
+org.ccil.cowan.tagsoup.HTMLScanner
+sun.security.jca.Providers
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index cec5db9..a558d68 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -26,7 +26,6 @@
 import android.content.Intent;
 import android.content.pm.ParceledListSlice;
 import android.graphics.Region;
-import android.hardware.fingerprint.FingerprintManager;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Looper;
@@ -52,8 +51,6 @@
 import java.lang.annotation.RetentionPolicy;
 import java.util.List;
 
-import static android.content.pm.PackageManager.FEATURE_FINGERPRINT;
-
 /**
  * Accessibility services should only be used to assist users with disabilities in using
  * Android devices and apps. They run in the background and receive callbacks by the system
@@ -394,7 +391,7 @@
     public static final int SHOW_MODE_AUTO = 0;
     public static final int SHOW_MODE_HIDDEN = 1;
 
-    private int mConnectionId;
+    private int mConnectionId = AccessibilityInteractionClient.NO_ID;
 
     private AccessibilityServiceInfo mInfo;
 
@@ -1612,7 +1609,7 @@
 
         private final Callbacks mCallback;
 
-        private int mConnectionId;
+        private int mConnectionId = AccessibilityInteractionClient.NO_ID;
 
         public IAccessibilityServiceClientWrapper(Context context, Looper looper,
                 Callbacks callback) {
@@ -1707,7 +1704,8 @@
                     if (event != null) {
                         // Send the event to AccessibilityCache via AccessibilityInteractionClient
                         AccessibilityInteractionClient.getInstance().onAccessibilityEvent(event);
-                        if (serviceWantsEvent) {
+                        if (serviceWantsEvent
+                                && (mConnectionId != AccessibilityInteractionClient.NO_ID)) {
                             // Send the event to AccessibilityService
                             mCallback.onAccessibilityEvent(event);
                         }
@@ -1721,7 +1719,9 @@
                 } return;
 
                 case DO_ON_INTERRUPT: {
-                    mCallback.onInterrupt();
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        mCallback.onInterrupt();
+                    }
                 } return;
 
                 case DO_INIT: {
@@ -1746,8 +1746,10 @@
                 } return;
 
                 case DO_ON_GESTURE: {
-                    final int gestureId = message.arg1;
-                    mCallback.onGesture(gestureId);
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        final int gestureId = message.arg1;
+                        mCallback.onGesture(gestureId);
+                    }
                 } return;
 
                 case DO_CLEAR_ACCESSIBILITY_CACHE: {
@@ -1779,37 +1781,51 @@
                 } return;
 
                 case DO_ON_MAGNIFICATION_CHANGED: {
-                    final SomeArgs args = (SomeArgs) message.obj;
-                    final Region region = (Region) args.arg1;
-                    final float scale = (float) args.arg2;
-                    final float centerX = (float) args.arg3;
-                    final float centerY = (float) args.arg4;
-                    mCallback.onMagnificationChanged(region, scale, centerX, centerY);
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        final SomeArgs args = (SomeArgs) message.obj;
+                        final Region region = (Region) args.arg1;
+                        final float scale = (float) args.arg2;
+                        final float centerX = (float) args.arg3;
+                        final float centerY = (float) args.arg4;
+                        mCallback.onMagnificationChanged(region, scale, centerX, centerY);
+                    }
                 } return;
 
                 case DO_ON_SOFT_KEYBOARD_SHOW_MODE_CHANGED: {
-                    final int showMode = (int) message.arg1;
-                    mCallback.onSoftKeyboardShowModeChanged(showMode);
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        final int showMode = (int) message.arg1;
+                        mCallback.onSoftKeyboardShowModeChanged(showMode);
+                    }
                 } return;
 
                 case DO_GESTURE_COMPLETE: {
-                    final boolean successfully = message.arg2 == 1;
-                    mCallback.onPerformGestureResult(message.arg1, successfully);
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        final boolean successfully = message.arg2 == 1;
+                        mCallback.onPerformGestureResult(message.arg1, successfully);
+                    }
                 } return;
                 case DO_ON_FINGERPRINT_ACTIVE_CHANGED: {
-                    mCallback.onFingerprintCapturingGesturesChanged(message.arg1 == 1);
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        mCallback.onFingerprintCapturingGesturesChanged(message.arg1 == 1);
+                    }
                 } return;
                 case DO_ON_FINGERPRINT_GESTURE: {
-                    mCallback.onFingerprintGesture(message.arg1);
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        mCallback.onFingerprintGesture(message.arg1);
+                    }
                 } return;
 
                 case (DO_ACCESSIBILITY_BUTTON_CLICKED): {
-                    mCallback.onAccessibilityButtonClicked();
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        mCallback.onAccessibilityButtonClicked();
+                    }
                 } return;
 
                 case (DO_ACCESSIBILITY_BUTTON_AVAILABILITY_CHANGED): {
-                    final boolean available = (message.arg1 != 0);
-                    mCallback.onAccessibilityButtonAvailabilityChanged(available);
+                    if (mConnectionId != AccessibilityInteractionClient.NO_ID) {
+                        final boolean available = (message.arg1 != 0);
+                        mCallback.onAccessibilityButtonAvailabilityChanged(available);
+                    }
                 } return;
 
                 default :
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 2d6e993..a866503 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -20,10 +20,11 @@
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
-import static android.app.WindowConfiguration.WINDOWING_MODE_DOCKED;
+import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
+import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
 import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
 
 import android.Manifest;
@@ -739,28 +740,6 @@
         }
 
         /**
-         * Returns true if Stack size is affected by the docked stack changing size.
-         * @hide
-         */
-        // TODO: Figure-out a way to remove.
-        public static boolean isResizeableByDockedStack(int stackId) {
-            return isStaticStack(stackId) && stackId != DOCKED_STACK_ID
-                    && stackId != PINNED_STACK_ID && stackId != ASSISTANT_STACK_ID;
-        }
-
-        /**
-         * Returns true if the size of tasks in the input stack are affected by the docked stack
-         * changing size.
-         * @hide
-         */
-        // TODO: What is the difference between this method and the one above??
-        public static boolean isTaskResizeableByDockedStack(int stackId) {
-            return isStaticStack(stackId) && stackId != FREEFORM_WORKSPACE_STACK_ID
-                    && stackId != DOCKED_STACK_ID && stackId != PINNED_STACK_ID
-                    && stackId != ASSISTANT_STACK_ID;
-        }
-
-        /**
          * Returns true if the input stack is affected by drag resizing.
          * @hide
          */
@@ -879,12 +858,15 @@
         /** Returns the windowing mode that should be used for this input stack id.
          * @hide */
         // TODO: To be removed once we are not using stack id for stuff...
-        public static int getWindowingModeForStackId(int stackId) {
+        public static int getWindowingModeForStackId(int stackId, boolean inSplitScreenMode) {
             final int windowingMode;
             switch (stackId) {
                 case FULLSCREEN_WORKSPACE_STACK_ID:
                 case HOME_STACK_ID:
                 case RECENTS_STACK_ID:
+                    windowingMode = inSplitScreenMode
+                            ? WINDOWING_MODE_SPLIT_SCREEN_SECONDARY : WINDOWING_MODE_FULLSCREEN;
+                    break;
                 case ASSISTANT_STACK_ID:
                     windowingMode = WINDOWING_MODE_FULLSCREEN;
                     break;
@@ -892,7 +874,7 @@
                     windowingMode = WINDOWING_MODE_PINNED;
                     break;
                 case DOCKED_STACK_ID:
-                    windowingMode = WINDOWING_MODE_DOCKED;
+                    windowingMode = WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
                     break;
                 case FREEFORM_WORKSPACE_STACK_ID:
                     windowingMode = WINDOWING_MODE_FREEFORM;
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index 7d4d70d..9b2bfc5 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -1006,9 +1006,12 @@
         final int numElements = mTransitioningViews == null ? 0 : mTransitioningViews.size();
         for (int i = 0; i < numElements; i++) {
             final View view = mTransitioningViews.get(i);
-            view.setTransitionVisibility(visiblity);
             if (invalidate) {
-                view.invalidate();
+                // Allow the view to be invalidated by the visibility change
+                view.setVisibility(visiblity);
+            } else {
+                // Don't invalidate the view with the visibility change
+                view.setTransitionVisibility(visiblity);
             }
         }
     }
diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java
index dc9db27..5d87e1c 100644
--- a/core/java/android/app/WindowConfiguration.java
+++ b/core/java/android/app/WindowConfiguration.java
@@ -16,6 +16,8 @@
 
 package android.app;
 
+import static android.app.ActivityThread.isSystem;
+
 import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.TestApi;
@@ -55,19 +57,26 @@
     /** Always on-top (always visible). of other siblings in its parent container.
      * @hide */
     public static final int WINDOWING_MODE_PINNED = 2;
-    /** Occupies a dedicated region of the screen or its parent container.
+    /** The primary container driving the screen to be in split-screen mode.
      * @hide */
-    public static final int WINDOWING_MODE_DOCKED = 3;
+    public static final int WINDOWING_MODE_SPLIT_SCREEN_PRIMARY = 3;
+    /**
+     * The containers adjacent to the {@link #WINDOWING_MODE_SPLIT_SCREEN_PRIMARY} container in
+     * split-screen mode.
+     * @hide
+     */
+    public static final int WINDOWING_MODE_SPLIT_SCREEN_SECONDARY = 4;
     /** Can be freely resized within its parent container.
      * @hide */
-    public static final int WINDOWING_MODE_FREEFORM = 4;
+    public static final int WINDOWING_MODE_FREEFORM = 5;
 
     /** @hide */
     @IntDef({
             WINDOWING_MODE_UNDEFINED,
             WINDOWING_MODE_FULLSCREEN,
             WINDOWING_MODE_PINNED,
-            WINDOWING_MODE_DOCKED,
+            WINDOWING_MODE_SPLIT_SCREEN_PRIMARY,
+            WINDOWING_MODE_SPLIT_SCREEN_SECONDARY,
             WINDOWING_MODE_FREEFORM,
     })
     public @interface WindowingMode {}
@@ -215,7 +224,12 @@
         if (mActivityType == activityType) {
             return;
         }
-        if (mActivityType != ACTIVITY_TYPE_UNDEFINED
+
+        // Error check within system server that we are not changing activity type which can be
+        // dangerous. It is okay for things to change in the application process as it doesn't
+        // affect how other things is the system is managed.
+        if (isSystem()
+                && mActivityType != ACTIVITY_TYPE_UNDEFINED
                 && activityType != ACTIVITY_TYPE_UNDEFINED) {
             throw new IllegalStateException("Can't change activity type once set: " + this
                     + " activityType=" + activityTypeToString(activityType));
@@ -459,7 +473,20 @@
      * @hide
      */
     public boolean hasMovementAnimations() {
-        return mWindowingMode == WINDOWING_MODE_PINNED;
+        return mWindowingMode != WINDOWING_MODE_PINNED;
+    }
+
+    /**
+     * Returns true if this container can be put in either
+     * {@link #WINDOWING_MODE_SPLIT_SCREEN_PRIMARY} or
+     * {@link #WINDOWING_MODE_SPLIT_SCREEN_SECONDARY} windowing modes based on its current state.
+     * @hide
+     */
+    public boolean supportSplitScreenWindowingMode() {
+        if (mActivityType == ACTIVITY_TYPE_ASSISTANT) {
+            return false;
+        }
+        return mWindowingMode != WINDOWING_MODE_FREEFORM && mWindowingMode != WINDOWING_MODE_PINNED;
     }
 
     private static String windowingModeToString(@WindowingMode int windowingMode) {
@@ -467,7 +494,8 @@
             case WINDOWING_MODE_UNDEFINED: return "undefined";
             case WINDOWING_MODE_FULLSCREEN: return "fullscreen";
             case WINDOWING_MODE_PINNED: return "pinned";
-            case WINDOWING_MODE_DOCKED: return "docked";
+            case WINDOWING_MODE_SPLIT_SCREEN_PRIMARY: return "split-screen-primary";
+            case WINDOWING_MODE_SPLIT_SCREEN_SECONDARY: return "split-screen-secondary";
             case WINDOWING_MODE_FREEFORM: return "freeform";
         }
         return String.valueOf(windowingMode);
diff --git a/core/java/android/app/usage/UsageStatsManager.java b/core/java/android/app/usage/UsageStatsManager.java
index 1f939f9..051dccb 100644
--- a/core/java/android/app/usage/UsageStatsManager.java
+++ b/core/java/android/app/usage/UsageStatsManager.java
@@ -172,9 +172,6 @@
     /**
      * Query for events in the given time range. Events are only kept by the system for a few
      * days.
-     * <p />
-     * <b>NOTE:</b> The last few minutes of the event log will be truncated to prevent abuse
-     * by applications.
      *
      * @param beginTime The inclusive beginning of the range of events to include in the results.
      * @param endTime The exclusive end of the range of events to include in the results.
diff --git a/core/java/android/bluetooth/le/BluetoothLeScanner.java b/core/java/android/bluetooth/le/BluetoothLeScanner.java
index 7fc79d7..a189e27 100644
--- a/core/java/android/bluetooth/le/BluetoothLeScanner.java
+++ b/core/java/android/bluetooth/le/BluetoothLeScanner.java
@@ -143,6 +143,11 @@
      * the PendingIntent. Use this method of scanning if your process is not always running and it
      * should be started when scan results are available.
      * <p>
+     * An app must hold
+     * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or
+     * {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION} permission
+     * in order to get results.
+     * <p>
      * When the PendingIntent is delivered, the Intent passed to the receiver or activity
      * will contain one or more of the extras {@link #EXTRA_CALLBACK_TYPE},
      * {@link #EXTRA_ERROR_CODE} and {@link #EXTRA_LIST_SCAN_RESULT} to indicate the result of
diff --git a/core/java/android/bluetooth/le/ScanSettings.java b/core/java/android/bluetooth/le/ScanSettings.java
index 35ed424..8fdcba8 100644
--- a/core/java/android/bluetooth/le/ScanSettings.java
+++ b/core/java/android/bluetooth/le/ScanSettings.java
@@ -35,7 +35,7 @@
 
     /**
      * Perform Bluetooth LE scan in low power mode. This is the default scan mode as it consumes the
-     * least power.
+     * least power. This mode is enforced if the scanning application is not in foreground.
      */
     public static final int SCAN_MODE_LOW_POWER = 0;
 
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index ad7a5ab..664bcbca 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -718,6 +718,10 @@
      * Cycles do not exist because they are illegal and screened for during installation.
      *
      * May be null if no splits are installed, or if no dependencies exist between them.
+     *
+     * NOTE: Any change to the way split dependencies are stored must update the logic that
+     *       creates the class loader context for dexopt (DexoptUtils#getClassLoaderContexts).
+     *
      * @hide
      */
     public SparseArray<int[]> splitDependencies;
diff --git a/core/java/android/content/pm/PackageBackwardCompatibility.java b/core/java/android/content/pm/PackageBackwardCompatibility.java
index 4de160b..cee2599 100644
--- a/core/java/android/content/pm/PackageBackwardCompatibility.java
+++ b/core/java/android/content/pm/PackageBackwardCompatibility.java
@@ -16,8 +16,8 @@
 
 package android.content.pm;
 
-import android.annotation.Nullable;
 import android.content.pm.PackageParser.Package;
+import android.os.Build;
 
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.util.ArrayUtils;
@@ -36,6 +36,8 @@
 
     private static final String ANDROID_TEST_RUNNER = "android.test.runner";
 
+    private static final String APACHE_HTTP_LEGACY = "org.apache.http.legacy";
+
     /**
      * Modify the shared libraries in the supplied {@link Package} to maintain backwards
      * compatibility.
@@ -47,13 +49,21 @@
         ArrayList<String> usesLibraries = pkg.usesLibraries;
         ArrayList<String> usesOptionalLibraries = pkg.usesOptionalLibraries;
 
-        usesLibraries = orgApacheHttpLegacy(usesLibraries);
-        usesOptionalLibraries = orgApacheHttpLegacy(usesOptionalLibraries);
+        // Packages targeted at <= O_MR1 expect the classes in the org.apache.http.legacy library
+        // to be accessible so this maintains backward compatibility by adding the
+        // org.apache.http.legacy library to those packages.
+        if (apkTargetsApiLevelLessThanOrEqualToOMR1(pkg)) {
+            boolean apacheHttpLegacyPresent = isLibraryPresent(
+                    usesLibraries, usesOptionalLibraries, APACHE_HTTP_LEGACY);
+            if (!apacheHttpLegacyPresent) {
+                usesLibraries = ArrayUtils.add(usesLibraries, APACHE_HTTP_LEGACY);
+            }
+        }
 
         // android.test.runner has a dependency on android.test.mock so if android.test.runner
         // is present but android.test.mock is not then add android.test.mock.
-        boolean androidTestMockPresent = ArrayUtils.contains(usesLibraries, ANDROID_TEST_MOCK)
-                || ArrayUtils.contains(usesOptionalLibraries, ANDROID_TEST_MOCK);
+        boolean androidTestMockPresent = isLibraryPresent(
+                usesLibraries, usesOptionalLibraries, ANDROID_TEST_MOCK);
         if (ArrayUtils.contains(usesLibraries, ANDROID_TEST_RUNNER) && !androidTestMockPresent) {
             usesLibraries.add(ANDROID_TEST_MOCK);
         }
@@ -66,13 +76,14 @@
         pkg.usesOptionalLibraries = usesOptionalLibraries;
     }
 
-    private static ArrayList<String> orgApacheHttpLegacy(@Nullable ArrayList<String> libraries) {
-        // "org.apache.http.legacy" is now a part of the boot classpath so it doesn't need
-        // to be an explicit dependency.
-        //
-        // A future change will remove this library from the boot classpath, at which point
-        // all apps that target SDK 21 and earlier will have it automatically added to their
-        // dependency lists.
-        return ArrayUtils.remove(libraries, "org.apache.http.legacy");
+    private static boolean apkTargetsApiLevelLessThanOrEqualToOMR1(Package pkg) {
+        int targetSdkVersion = pkg.applicationInfo.targetSdkVersion;
+        return targetSdkVersion <= Build.VERSION_CODES.O_MR1;
+    }
+
+    private static boolean isLibraryPresent(ArrayList<String> usesLibraries,
+            ArrayList<String> usesOptionalLibraries, String apacheHttpLegacy) {
+        return ArrayUtils.contains(usesLibraries, apacheHttpLegacy)
+                || ArrayUtils.contains(usesOptionalLibraries, apacheHttpLegacy);
     }
 }
diff --git a/core/java/android/database/sqlite/SQLiteGlobal.java b/core/java/android/database/sqlite/SQLiteGlobal.java
index 571656a..94d5555 100644
--- a/core/java/android/database/sqlite/SQLiteGlobal.java
+++ b/core/java/android/database/sqlite/SQLiteGlobal.java
@@ -16,6 +16,7 @@
 
 package android.database.sqlite;
 
+import android.annotation.TestApi;
 import android.content.res.Resources;
 import android.os.StatFs;
 import android.os.SystemProperties;
@@ -34,6 +35,7 @@
  *
  * @hide
  */
+@TestApi
 public final class SQLiteGlobal {
     private static final String TAG = "SQLiteGlobal";
 
diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
index 0d5c5e3..bfeb14d 100644
--- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
@@ -1769,7 +1769,7 @@
         }
 
         @Override
-        public void onRepeatingRequestError(long lastFrameNumber) {
+        public void onRepeatingRequestError(long lastFrameNumber, int repeatingRequestId) {
             if (DEBUG) {
                 Log.d(TAG, "Repeating request error received. Last frame number is " +
                         lastFrameNumber);
@@ -1782,7 +1782,10 @@
                 }
 
                 checkEarlyTriggerSequenceComplete(mRepeatingRequestId, lastFrameNumber);
-                mRepeatingRequestId = REQUEST_ID_NONE;
+                // Check if there is already a new repeating request
+                if (mRepeatingRequestId == repeatingRequestId) {
+                    mRepeatingRequestId = REQUEST_ID_NONE;
+                }
             }
         }
 
diff --git a/core/java/android/hardware/camera2/legacy/CameraDeviceState.java b/core/java/android/hardware/camera2/legacy/CameraDeviceState.java
index 135d92b..89ecd5f 100644
--- a/core/java/android/hardware/camera2/legacy/CameraDeviceState.java
+++ b/core/java/android/hardware/camera2/legacy/CameraDeviceState.java
@@ -77,7 +77,7 @@
         void onCaptureStarted(RequestHolder holder, long timestamp);
         void onCaptureResult(CameraMetadataNative result, RequestHolder holder);
         void onRequestQueueEmpty();
-        void onRepeatingRequestError(long lastFrameNumber);
+        void onRepeatingRequestError(long lastFrameNumber, int repeatingRequestId);
     }
 
     /**
@@ -208,12 +208,14 @@
      * <p>Repeating request has been stopped due to an error such as abandoned output surfaces.</p>
      *
      * @param lastFrameNumber Frame number of the last repeating request before it is stopped.
+     * @param repeatingRequestId The ID of the repeating request being stopped
      */
-    public synchronized void setRepeatingRequestError(final long lastFrameNumber) {
+    public synchronized void setRepeatingRequestError(final long lastFrameNumber,
+            final int repeatingRequestId) {
         mCurrentHandler.post(new Runnable() {
             @Override
             public void run() {
-                mCurrentListener.onRepeatingRequestError(lastFrameNumber);
+                mCurrentListener.onRepeatingRequestError(lastFrameNumber, repeatingRequestId);
             }
         });
     }
diff --git a/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java b/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
index d8df9a0..49d4096 100644
--- a/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
+++ b/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
@@ -264,10 +264,10 @@
         }
 
         @Override
-        public void onRepeatingRequestError(long lastFrameNumber) {
+        public void onRepeatingRequestError(long lastFrameNumber, int repeatingRequestId) {
+            Object[] objArray = new Object[] { lastFrameNumber, repeatingRequestId };
             Message msg = getHandler().obtainMessage(REPEATING_REQUEST_ERROR,
-                    /*arg1*/ (int) (lastFrameNumber & 0xFFFFFFFFL),
-                    /*arg2*/ (int) ( (lastFrameNumber >> 32) & 0xFFFFFFFFL));
+                    /*obj*/ objArray);
             getHandler().sendMessage(msg);
         }
 
@@ -329,9 +329,10 @@
                             break;
                         }
                         case REPEATING_REQUEST_ERROR: {
-                            long lastFrameNumber = msg.arg2 & 0xFFFFFFFFL;
-                            lastFrameNumber = (lastFrameNumber << 32) | (msg.arg1 & 0xFFFFFFFFL);
-                            mCallbacks.onRepeatingRequestError(lastFrameNumber);
+                            Object[] objArray = (Object[]) msg.obj;
+                            long lastFrameNumber = (Long) objArray[0];
+                            int repeatingRequestId = (Integer) objArray[1];
+                            mCallbacks.onRepeatingRequestError(lastFrameNumber, repeatingRequestId);
                             break;
                         }
                         case REQUEST_QUEUE_EMPTY: {
diff --git a/core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java b/core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java
index 621ea84..cb59fd1 100644
--- a/core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java
+++ b/core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java
@@ -263,7 +263,8 @@
         }
 
         @Override
-        public void onRepeatingRequestError(final long lastFrameNumber) {
+        public void onRepeatingRequestError(final long lastFrameNumber,
+                final int repeatingRequestId) {
             mResultHandler.post(new Runnable() {
                 @Override
                 public void run() {
@@ -271,7 +272,8 @@
                         Log.d(TAG, "doing onRepeatingRequestError callback.");
                     }
                     try {
-                        mDeviceCallbacks.onRepeatingRequestError(lastFrameNumber);
+                        mDeviceCallbacks.onRepeatingRequestError(lastFrameNumber,
+                                repeatingRequestId);
                     } catch (RemoteException e) {
                         throw new IllegalStateException(
                                 "Received remote exception during onRepeatingRequestError " +
diff --git a/core/java/android/hardware/camera2/legacy/RequestThreadManager.java b/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
index 565a43e..aaf07e6 100644
--- a/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
+++ b/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
@@ -939,7 +939,8 @@
                             Log.d(TAG, "Stopped repeating request. Last frame number is " +
                                     lastFrameNumber);
                         }
-                        mDeviceState.setRepeatingRequestError(lastFrameNumber);
+                        mDeviceState.setRepeatingRequestError(lastFrameNumber,
+                                burstHolder.getRequestId());
                     }
 
                     if (DEBUG) {
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java
index 1bb0fbb..f527f77 100644
--- a/core/java/android/net/LinkProperties.java
+++ b/core/java/android/net/LinkProperties.java
@@ -18,14 +18,13 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
-import android.net.ProxyInfo;
-import android.os.Parcelable;
 import android.os.Parcel;
+import android.os.Parcelable;
 import android.text.TextUtils;
 
-import java.net.InetAddress;
 import java.net.Inet4Address;
 import java.net.Inet6Address;
+import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -504,11 +503,22 @@
     }
 
     /**
+     * Make sure this LinkProperties instance contains routes that cover the local subnet
+     * of its link addresses. Add any route that is missing.
+     * @hide
+     */
+    public void ensureDirectlyConnectedRoutes() {
+        for (LinkAddress addr: mLinkAddresses) {
+            addRoute(new RouteInfo(addr, null, mIfaceName));
+        }
+    }
+
+    /**
      * Returns all the routes on this link and all the links stacked above it.
      * @hide
      */
     public List<RouteInfo> getAllRoutes() {
-        List<RouteInfo> routes = new ArrayList();
+        List<RouteInfo> routes = new ArrayList<>();
         routes.addAll(mRoutes);
         for (LinkProperties stacked: mStackedLinks.values()) {
             routes.addAll(stacked.getAllRoutes());
diff --git a/core/java/android/os/IncidentReportArgs.java b/core/java/android/os/IncidentReportArgs.java
index abb3161..fd0ebcf 100644
--- a/core/java/android/os/IncidentReportArgs.java
+++ b/core/java/android/os/IncidentReportArgs.java
@@ -35,6 +35,7 @@
     private final IntArray mSections = new IntArray();
     private final ArrayList<byte[]> mHeaders = new ArrayList<byte[]>();
     private boolean mAll;
+    private int mDest;
 
     /**
      * Construct an incident report args with no fields.
@@ -69,6 +70,8 @@
         for (int i=0; i<N; i++) {
             out.writeByteArray(mHeaders.get(i));
         }
+
+        out.writeInt(mDest);
     }
 
     public void readFromParcel(Parcel in) {
@@ -85,6 +88,8 @@
         for (int i=0; i<N; i++) {
             mHeaders.add(in.createByteArray());
         }
+
+        mDest = in.readInt();
     }
 
     public static final Parcelable.Creator<IncidentReportArgs> CREATOR
@@ -118,7 +123,8 @@
         }
         sb.append(", ");
         sb.append(mHeaders.size());
-        sb.append(" headers)");
+        sb.append(" headers), ");
+        sb.append("Dest enum value: ").append(mDest);
         return sb.toString();
     }
 
@@ -133,6 +139,14 @@
     }
 
     /**
+     * Set this incident report privacy policy spec.
+     * @hide
+     */
+    public void setPrivacyPolicy(int dest) {
+        mDest = dest;
+    }
+
+    /**
      * Add this section to the incident report. Skip if the input is smaller than 2 since section
      * id are only valid for positive integer as Protobuf field id. Here 1 is reserved for Header.
      */
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index fae9d53..031ca91 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -2555,9 +2555,6 @@
      * Read into the given List items String objects that were written with
      * {@link #writeStringList} at the current dataPosition().
      *
-     * @return A newly created ArrayList containing strings with the same data
-     *         as those that were previously written.
-     *
      * @see #writeStringList
      */
     public final void readStringList(List<String> list) {
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java
index cceb949..615d3c4 100644
--- a/core/java/android/os/StrictMode.java
+++ b/core/java/android/os/StrictMode.java
@@ -2568,9 +2568,8 @@
     // now we suppress the stack trace because it's useless and/or
     // misleading.
     private static class InstanceCountViolation extends Throwable {
-        final Class mClass;
-        final long mInstances;
-        final int mLimit;
+        private final long mInstances;
+        private final int mLimit;
 
         private static final StackTraceElement[] FAKE_STACK = {
             new StackTraceElement(
@@ -2580,7 +2579,6 @@
         public InstanceCountViolation(Class klass, long instances, int limit) {
             super(klass.toString() + "; instances=" + instances + "; limit=" + limit);
             setStackTrace(FAKE_STACK);
-            mClass = klass;
             mInstances = instances;
             mLimit = limit;
         }
diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java
index 8533c7e..98ecd7a 100644
--- a/core/java/android/os/storage/StorageManager.java
+++ b/core/java/android/os/storage/StorageManager.java
@@ -41,6 +41,7 @@
 import android.os.Environment;
 import android.os.FileUtils;
 import android.os.Handler;
+import android.os.IVold;
 import android.os.Looper;
 import android.os.Message;
 import android.os.ParcelFileDescriptor;
@@ -219,9 +220,9 @@
     public static final int FLAG_INCLUDE_INVISIBLE = 1 << 10;
 
     /** {@hide} */
-    public static final int FSTRIM_FLAG_DEEP = 1 << 0;
+    public static final int FSTRIM_FLAG_DEEP = IVold.FSTRIM_FLAG_DEEP_TRIM;
     /** {@hide} */
-    public static final int FSTRIM_FLAG_BENCHMARK = 1 << 1;
+    public static final int FSTRIM_FLAG_BENCHMARK = IVold.FSTRIM_FLAG_BENCHMARK_AFTER;
 
     /** @hide The volume is not encrypted. */
     public static final int ENCRYPTION_STATE_NONE = 1;
diff --git a/core/java/android/os/storage/VolumeInfo.java b/core/java/android/os/storage/VolumeInfo.java
index a21e05e..b8353d7 100644
--- a/core/java/android/os/storage/VolumeInfo.java
+++ b/core/java/android/os/storage/VolumeInfo.java
@@ -23,6 +23,7 @@
 import android.content.res.Resources;
 import android.net.Uri;
 import android.os.Environment;
+import android.os.IVold;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.os.UserHandle;
@@ -75,24 +76,24 @@
     /** Real volume representing internal emulated storage */
     public static final String ID_EMULATED_INTERNAL = "emulated";
 
-    public static final int TYPE_PUBLIC = 0;
-    public static final int TYPE_PRIVATE = 1;
-    public static final int TYPE_EMULATED = 2;
-    public static final int TYPE_ASEC = 3;
-    public static final int TYPE_OBB = 4;
+    public static final int TYPE_PUBLIC = IVold.TYPE_PUBLIC;
+    public static final int TYPE_PRIVATE = IVold.TYPE_PRIVATE;
+    public static final int TYPE_EMULATED = IVold.TYPE_EMULATED;
+    public static final int TYPE_ASEC = IVold.TYPE_ASEC;
+    public static final int TYPE_OBB = IVold.TYPE_OBB;
 
-    public static final int STATE_UNMOUNTED = 0;
-    public static final int STATE_CHECKING = 1;
-    public static final int STATE_MOUNTED = 2;
-    public static final int STATE_MOUNTED_READ_ONLY = 3;
-    public static final int STATE_FORMATTING = 4;
-    public static final int STATE_EJECTING = 5;
-    public static final int STATE_UNMOUNTABLE = 6;
-    public static final int STATE_REMOVED = 7;
-    public static final int STATE_BAD_REMOVAL = 8;
+    public static final int STATE_UNMOUNTED = IVold.STATE_UNMOUNTED;
+    public static final int STATE_CHECKING = IVold.STATE_CHECKING;
+    public static final int STATE_MOUNTED = IVold.STATE_MOUNTED;
+    public static final int STATE_MOUNTED_READ_ONLY = IVold.STATE_MOUNTED_READ_ONLY;
+    public static final int STATE_FORMATTING = IVold.STATE_FORMATTING;
+    public static final int STATE_EJECTING = IVold.STATE_EJECTING;
+    public static final int STATE_UNMOUNTABLE = IVold.STATE_UNMOUNTABLE;
+    public static final int STATE_REMOVED = IVold.STATE_REMOVED;
+    public static final int STATE_BAD_REMOVAL = IVold.STATE_BAD_REMOVAL;
 
-    public static final int MOUNT_FLAG_PRIMARY = 1 << 0;
-    public static final int MOUNT_FLAG_VISIBLE = 1 << 1;
+    public static final int MOUNT_FLAG_PRIMARY = IVold.MOUNT_FLAG_PRIMARY;
+    public static final int MOUNT_FLAG_VISIBLE = IVold.MOUNT_FLAG_VISIBLE;
 
     private static SparseArray<String> sStateToEnvironment = new SparseArray<>();
     private static ArrayMap<String, String> sEnvironmentToBroadcast = new ArrayMap<>();
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index d09d027..2cb3864 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -7120,6 +7120,11 @@
         public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
 
         /**
+         * Whether the Lockdown button should be shown in the power menu.
+         * @hide
+         */
+        public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu";
+        /**
          * This are the settings to be backed up.
          *
          * NOTE: Settings are backed up and restored in the order they appear
@@ -7221,6 +7226,7 @@
             SCREENSAVER_COMPONENTS,
             SCREENSAVER_ACTIVATE_ON_DOCK,
             SCREENSAVER_ACTIVATE_ON_SLEEP,
+            LOCKDOWN_IN_POWER_MENU,
         };
 
         /** @hide */
@@ -10234,6 +10240,15 @@
                 "euicc_factory_reset_timeout_millis";
 
         /**
+         * Flag to set the timeout for when to refresh the storage settings cached data.
+         * Type: long
+         *
+         * @hide
+         */
+        public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
+                "storage_settings_clobber_threshold";
+
+        /**
          * Settings to backup. This is here so that it's in the same place as the settings
          * keys and easy to update.
          *
diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java
index 1dcaef4..3e08dcf 100644
--- a/core/java/android/service/autofill/AutofillService.java
+++ b/core/java/android/service/autofill/AutofillService.java
@@ -51,6 +51,7 @@
  *       Settings screen).
  * </ol>
  *
+ * <a name="BasicUsage"></a>
  * <h3>Basic usage</h3>
  *
  * <p>The basic autofill process is defined by the workflow below:
@@ -122,12 +123,14 @@
  * each {@link #onFillRequest(FillRequest, CancellationSignal, FillCallback)} received - if it
  * doesn't, the request will eventually time out and be discarded by the Android System.
  *
+ * <a name="SavingUserData"></a>
  * <h3>Saving user data</h3>
  *
  * <p>If the service is also interested on saving the data filled by the user, it must set a
  * {@link SaveInfo} object in the {@link FillResponse}. See {@link SaveInfo} for more details and
  * examples.
  *
+ * <a name="UserAuthentication"></a>
  * <h3>User authentication</h3>
  *
  * <p>The service can provide an extra degree of security by requiring the user to authenticate
@@ -164,6 +167,7 @@
  * credentials in "vaults": the first response would contain fake datasets with the vault names,
  * and the subsequent response would contain the app credentials stored in that vault.
  *
+ * <a name="DataPartioning"></a>
  * <h3>Data partitioning</h3>
  *
  * <p>The autofillable views in a screen should be grouped in logical groups called "partitions".
@@ -243,6 +247,7 @@
  * <p>When the service returns multiple {@link FillResponse}, the last one overrides the previous;
  * that's why the {@link SaveInfo} in the 2nd request above has the info for both partitions.
  *
+ * <a name="PackageVerification"></a>
  * <h3>Package verification</h3>
  *
  * <p>When autofilling app-specific data (like username and password), the service must verify
@@ -270,9 +275,16 @@
  *   }
  *   return hash.toString();
  * }
- *
  * </pre>
  *
+ * <p>If the service did not store the signing certificates data the first time the data was saved
+ * &mdash; for example, because the data was created by a previous version of the app that did not
+ * use the Autofill Framework &mdash; the service should warn the user that the authenticity of the
+ * app cannot be confirmed (see an example on how to show such warning in the
+ * <a href="#WebSecurityDisclaimer">Web security</a> section below), and if the user agrees,
+ * then the service could save the data from the signing ceriticates for future use.
+ *
+ * <a name="IgnoringViews"></a>
  * <h3>Ignoring views</h3>
  *
  * <p>If the service find views that cannot be autofilled (for example, a text field representing
@@ -281,6 +293,7 @@
  * a new {@link #onFillRequest(FillRequest, CancellationSignal, FillCallback)} when these views are
  * focused.
  *
+ * <a name="WebSecurity"></a>
  * <h3>Web security</h3>
  *
  * <p>When handling autofill requests that represent web pages (typically
@@ -313,6 +326,7 @@
  * }
  * </pre>
  *
+ * <a name="WebSecurityDisclaimer"></a>
  * <p>If the association between the web domain and app package cannot be verified through the steps
  * above, but the service thinks that it is appropriate to fill persisted credentials that are
  * stored for the web domain, the service should warn the user about the potential data
diff --git a/core/java/android/service/autofill/CharSequenceTransformation.java b/core/java/android/service/autofill/CharSequenceTransformation.java
index 8ab856e..2413e97 100644
--- a/core/java/android/service/autofill/CharSequenceTransformation.java
+++ b/core/java/android/service/autofill/CharSequenceTransformation.java
@@ -86,7 +86,7 @@
             }
             try {
                 final Matcher matcher = field.first.matcher(value);
-                if (!matcher.matches()) {
+                if (!matcher.find()) {
                     if (sDebug) Log.d(TAG, "match for " + field.first + " failed on id " + id);
                     return;
                 }
diff --git a/core/java/android/service/autofill/Dataset.java b/core/java/android/service/autofill/Dataset.java
index 65b0efc..cb341b1 100644
--- a/core/java/android/service/autofill/Dataset.java
+++ b/core/java/android/service/autofill/Dataset.java
@@ -198,15 +198,22 @@
         }
 
         /**
-         * Sets the id for the dataset so its usage history can be retrieved later.
+         * Sets the id for the dataset so its usage can be tracked.
          *
-         * <p>The id of the last selected dataset can be read from
-         * {@link AutofillService#getFillEventHistory()}. If the id is not set it will not be clear
-         * if a dataset was selected as {@link AutofillService#getFillEventHistory()} uses
-         * {@code null} to indicate that no dataset was selected.
+         * <p>Dataset usage can be tracked for 2 purposes:
+         *
+         * <ul>
+         *   <li>For statistical purposes, the service can call
+         * {@link AutofillService#getFillEventHistory()} when handling {@link
+         * AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)}
+         * calls.
+         *   <li>For normal autofill workflow, the service can call
+         *   {@link SaveRequest#getDatasetIds()} when handling
+         *   {@link AutofillService#onSaveRequest(SaveRequest, SaveCallback)} calls.
+         * </ul>
          *
          * @param id id for this dataset or {@code null} to unset.
-
+         *
          * @return This builder.
          */
         public @NonNull Builder setId(@Nullable String id) {
diff --git a/core/java/android/service/autofill/FillEventHistory.java b/core/java/android/service/autofill/FillEventHistory.java
index 60c1c9a..3b719ac 100644
--- a/core/java/android/service/autofill/FillEventHistory.java
+++ b/core/java/android/service/autofill/FillEventHistory.java
@@ -22,8 +22,7 @@
 import android.os.Bundle;
 import android.os.Parcel;
 import android.os.Parcelable;
-import android.view.autofill.AutofillId;
-import android.widget.RemoteViews;
+import android.view.autofill.AutofillManager;
 
 import com.android.internal.util.Preconditions;
 
@@ -151,6 +150,14 @@
     public static final class Event {
         /**
          * A dataset was selected. The dataset selected can be read from {@link #getDatasetId()}.
+         *
+         * <p><b>Note: </b>on Android {@link android.os.Build.VERSION_CODES#O}, this event was also
+         * incorrectly reported after a
+         * {@link Dataset.Builder#setAuthentication(IntentSender) dataset authentication} was
+         * selected and the service returned a dataset in the
+         * {@link AutofillManager#EXTRA_AUTHENTICATION_RESULT} of the activity launched from that
+         * {@link IntentSender}. This behavior was fixed on Android
+         * {@link android.os.Build.VERSION_CODES#O_MR1}.
          */
         public static final int TYPE_DATASET_SELECTED = 0;
 
@@ -161,8 +168,8 @@
         public static final int TYPE_DATASET_AUTHENTICATION_SELECTED = 1;
 
         /**
-         * A {@link FillResponse.Builder#setAuthentication(AutofillId[], IntentSender, RemoteViews)
-         * fill response authentication} was selected.
+         * A {@link FillResponse.Builder#setAuthentication(android.view.autofill.AutofillId[],
+         * IntentSender, android.widget.RemoteViews) fill response authentication} was selected.
          */
         public static final int TYPE_AUTHENTICATION_SELECTED = 2;
 
@@ -228,6 +235,11 @@
             mDatasetId = datasetId;
             mClientState = clientState;
         }
+
+        @Override
+        public String toString() {
+            return "FillEvent [datasetId=" + mDatasetId + ", type=" + mEventType + "]";
+        }
     }
 
     public static final Parcelable.Creator<FillEventHistory> CREATOR =
diff --git a/core/java/android/service/autofill/FillRequest.java b/core/java/android/service/autofill/FillRequest.java
index 1c32fe0..3a84224 100644
--- a/core/java/android/service/autofill/FillRequest.java
+++ b/core/java/android/service/autofill/FillRequest.java
@@ -20,7 +20,6 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.os.Bundle;
-import android.os.CancellationSignal;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.view.View;
@@ -38,7 +37,7 @@
  * interesting for saving and what are the possible ways to fill the inputs on
  * the screen if applicable.
  *
- * @see AutofillService#onFillRequest(FillRequest, CancellationSignal, FillCallback)
+ * @see AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)
  */
 public final class FillRequest implements Parcelable {
 
@@ -122,9 +121,14 @@
         return mContexts;
     }
 
+    @Override
+    public String toString() {
+        return "FillRequest: [id=" + mId + ", flags=" + mFlags + ", ctxts= " + mContexts + "]";
+    }
+
     /**
      * Gets the extra client state returned from the last {@link
-     * AutofillService#onFillRequest(FillRequest, CancellationSignal, FillCallback)
+     * AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)
      * fill request}, so the service can use it for state management.
      *
      * <p>Once a {@link AutofillService#onSaveRequest(SaveRequest, SaveCallback)
diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java
index 3b09c67..6d8a959 100644
--- a/core/java/android/service/autofill/FillResponse.java
+++ b/core/java/android/service/autofill/FillResponse.java
@@ -148,10 +148,12 @@
          * {@link android.view.autofill.AutofillManager#EXTRA_ASSIST_STRUCTURE screen
          * content} and your {@link android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE
          * client state}. Once you complete your authentication flow you should set the
-         * {@link Activity} result to {@link android.app.Activity#RESULT_OK} and provide the fully
-         * populated {@link FillResponse response} by setting it to the
-         * {@link android.view.autofill.AutofillManager#EXTRA_AUTHENTICATION_RESULT} extra.
-         * For example, if you provided an empty {@link FillResponse resppnse} because the
+         * {@link Activity} result to {@link android.app.Activity#RESULT_OK} and set the
+         * {@link android.view.autofill.AutofillManager#EXTRA_AUTHENTICATION_RESULT} extra
+         * with the fully populated {@link FillResponse response} (or {@code null} if the screen
+         * cannot be autofilled).
+         *
+         * <p>For example, if you provided an empty {@link FillResponse response} because the
          * user's data was locked and marked that the response needs an authentication then
          * in the response returned if authentication succeeds you need to provide all
          * available data sets some of which may need to be further authenticated, for
diff --git a/core/java/android/service/autofill/SaveRequest.java b/core/java/android/service/autofill/SaveRequest.java
index 9de9315..1a6c5b0 100644
--- a/core/java/android/service/autofill/SaveRequest.java
+++ b/core/java/android/service/autofill/SaveRequest.java
@@ -22,6 +22,7 @@
 import android.os.CancellationSignal;
 import android.os.Parcel;
 import android.os.Parcelable;
+
 import com.android.internal.util.Preconditions;
 
 import java.util.ArrayList;
@@ -36,16 +37,18 @@
 public final class SaveRequest implements Parcelable {
     private final @NonNull ArrayList<FillContext> mFillContexts;
     private final @Nullable Bundle mClientState;
+    private final @Nullable ArrayList<String> mDatasetIds;
 
     /** @hide */
     public SaveRequest(@NonNull ArrayList<FillContext> fillContexts,
-            @Nullable Bundle clientState) {
+            @Nullable Bundle clientState, @Nullable ArrayList<String> datasetIds) {
         mFillContexts = Preconditions.checkNotNull(fillContexts, "fillContexts");
         mClientState = clientState;
+        mDatasetIds = datasetIds;
     }
 
     private SaveRequest(@NonNull Parcel parcel) {
-        this(parcel.readTypedArrayList(null), parcel.readBundle());
+        this(parcel.readTypedArrayList(null), parcel.readBundle(), parcel.createStringArrayList());
     }
 
     /**
@@ -66,6 +69,14 @@
         return mClientState;
     }
 
+    /**
+     * Gets the ids of the datasets selected by the user, in the order in which they were selected.
+     */
+    @Nullable
+    public List<String> getDatasetIds() {
+        return mDatasetIds;
+    }
+
     @Override
     public int describeContents() {
         return 0;
@@ -75,6 +86,7 @@
     public void writeToParcel(Parcel parcel, int flags) {
         parcel.writeTypedArrayList(mFillContexts, flags);
         parcel.writeBundle(mClientState);
+        parcel.writeStringList(mDatasetIds);
     }
 
     public static final Creator<SaveRequest> CREATOR =
diff --git a/core/java/android/service/oemlock/IOemLockService.aidl b/core/java/android/service/oemlock/IOemLockService.aidl
index 682e7ee..d5e10d6 100644
--- a/core/java/android/service/oemlock/IOemLockService.aidl
+++ b/core/java/android/service/oemlock/IOemLockService.aidl
@@ -28,7 +28,6 @@
     void setOemUnlockAllowedByUser(boolean allowed);
     boolean isOemUnlockAllowedByUser();
 
-    boolean canUserAllowOemUnlock();
     boolean isOemUnlockAllowed();
     boolean isDeviceOemUnlocked();
 }
diff --git a/core/java/android/service/oemlock/OemLockManager.java b/core/java/android/service/oemlock/OemLockManager.java
index 3a56d9f..f0d6603 100644
--- a/core/java/android/service/oemlock/OemLockManager.java
+++ b/core/java/android/service/oemlock/OemLockManager.java
@@ -118,24 +118,6 @@
     }
 
     /**
-     * Returns whether all parties other than the user allow OEM unlock meaning the user can
-     * directly control whether or not the device can be OEM unlocked.
-     *
-     * If this is true, {@link #isOemUnlockAllowedByUser} is the same as {@link #isOemUnlockAllowed}
-     *
-     * @return Whether the user can directly control whether the device can be OEM unlocked.
-     *
-     * @hide
-     */
-    public boolean canUserAllowOemUnlock() {
-        try {
-            return mService.canUserAllowOemUnlock();
-        } catch (RemoteException e) {
-            throw e.rethrowFromSystemServer();
-        }
-    }
-
-    /**
      * @return Whether the bootloader is able to OEM unlock the device.
      *
      * @hide
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index 62bd6e0..25f791b 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -1704,7 +1704,7 @@
     }
 
     private void addSelection(int line, int start, int end,
-            int top, int bottom, RectangleConsumer consumer) {
+            int top, int bottom, SelectionRectangleConsumer consumer) {
         int linestart = getLineStart(line);
         int lineend = getLineEnd(line);
         Directions dirs = getLineDirections(line);
@@ -1732,7 +1732,12 @@
                     float left = Math.min(h1, h2);
                     float right = Math.max(h1, h2);
 
-                    consumer.accept(left, top, right, bottom);
+                    final @TextSelectionLayout int layout =
+                            ((dirs.mDirections[i + 1] & RUN_RTL_FLAG) != 0)
+                                    ? TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT
+                                    : TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT;
+
+                    consumer.accept(left, top, right, bottom, layout);
                 }
             }
         }
@@ -1746,22 +1751,22 @@
      */
     public void getSelectionPath(int start, int end, Path dest) {
         dest.reset();
-        getSelection(start, end, (left, top, right, bottom) ->
+        getSelection(start, end, (left, top, right, bottom, textSelectionLayout) ->
                 dest.addRect(left, top, right, bottom, Path.Direction.CW));
     }
 
     /**
      * Calculates the rectangles which should be highlighted to indicate a selection between start
-     * and end and feeds them into the given {@link RectangleConsumer}.
+     * and end and feeds them into the given {@link SelectionRectangleConsumer}.
      *
      * @param start    the starting index of the selection
      * @param end      the ending index of the selection
-     * @param consumer the {@link RectangleConsumer} which will receive the generated rectangles. It
-     *                 will be called every time a rectangle is generated.
+     * @param consumer the {@link SelectionRectangleConsumer} which will receive the generated
+     *                 rectangles. It will be called every time a rectangle is generated.
      * @hide
      * @see #getSelectionPath(int, int, Path)
      */
-    public final void getSelection(int start, int end, final RectangleConsumer consumer) {
+    public final void getSelection(int start, int end, final SelectionRectangleConsumer consumer) {
         if (start == end) {
             return;
         }
@@ -1787,15 +1792,21 @@
                     top, getLineBottom(startline), consumer);
 
             if (getParagraphDirection(startline) == DIR_RIGHT_TO_LEFT) {
-                consumer.accept(getLineLeft(startline), top, 0, getLineBottom(startline));
+                consumer.accept(getLineLeft(startline), top, 0, getLineBottom(startline),
+                        TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT);
             } else {
-                consumer.accept(getLineRight(startline), top, width, getLineBottom(startline));
+                consumer.accept(getLineRight(startline), top, width, getLineBottom(startline),
+                        TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT);
             }
 
             for (int i = startline + 1; i < endline; i++) {
                 top = getLineTop(i);
                 bottom = getLineBottom(i);
-                consumer.accept(0, top, width, bottom);
+                if (getParagraphDirection(i) == DIR_RIGHT_TO_LEFT) {
+                    consumer.accept(0, top, width, bottom, TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT);
+                } else {
+                    consumer.accept(0, top, width, bottom, TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT);
+                }
             }
 
             top = getLineTop(endline);
@@ -1804,9 +1815,11 @@
             addSelection(endline, getLineStart(endline), end, top, bottom, consumer);
 
             if (getParagraphDirection(endline) == DIR_RIGHT_TO_LEFT) {
-                consumer.accept(width, top, getLineRight(endline), bottom);
+                consumer.accept(width, top, getLineRight(endline), bottom,
+                        TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT);
             } else {
-                consumer.accept(0, top, getLineLeft(endline), bottom);
+                consumer.accept(0, top, getLineLeft(endline), bottom,
+                        TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT);
             }
         }
     }
@@ -2310,8 +2323,18 @@
         new Directions(new int[] { 0, RUN_LENGTH_MASK | RUN_RTL_FLAG });
 
     /** @hide */
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT, TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT})
+    public @interface TextSelectionLayout {}
+
+    /** @hide */
+    public static final int TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT = 0;
+    /** @hide */
+    public static final int TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT = 1;
+
+    /** @hide */
     @FunctionalInterface
-    public interface RectangleConsumer {
+    public interface SelectionRectangleConsumer {
         /**
          * Performs this operation on the given rectangle.
          *
@@ -2319,8 +2342,11 @@
          * @param top    the top edge of the rectangle
          * @param right  the right edge of the rectangle
          * @param bottom the bottom edge of the rectangle
+         * @param textSelectionLayout the layout (RTL or LTR) of the text covered by this
+         *                            selection rectangle
          */
-        void accept(float left, float top, float right, float bottom);
+        void accept(float left, float top, float right, float bottom,
+                @TextSelectionLayout int textSelectionLayout);
     }
 
 }
diff --git a/core/java/android/util/TimingsTraceLog.java b/core/java/android/util/TimingsTraceLog.java
index 36e9f77..3e6f09b 100644
--- a/core/java/android/util/TimingsTraceLog.java
+++ b/core/java/android/util/TimingsTraceLog.java
@@ -25,6 +25,7 @@
 
 /**
  * Helper class for reporting boot and shutdown timing metrics.
+ * <p>Note: This class is not thread-safe. Use a separate copy for other threads</p>
  * @hide
  */
 public class TimingsTraceLog {
@@ -34,10 +35,12 @@
             DEBUG_BOOT_TIME ? new ArrayDeque<>() : null;
     private final String mTag;
     private long mTraceTag;
+    private long mThreadId;
 
     public TimingsTraceLog(String tag, long traceTag) {
         mTag = tag;
         mTraceTag = traceTag;
+        mThreadId = Thread.currentThread().getId();
     }
 
     /**
@@ -45,6 +48,7 @@
      * @param name name to appear in trace
      */
     public void traceBegin(String name) {
+        assertSameThread();
         Trace.traceBegin(mTraceTag, name);
         if (DEBUG_BOOT_TIME) {
             mStartTimes.push(Pair.create(name, SystemClock.elapsedRealtime()));
@@ -56,6 +60,7 @@
      * Also {@link #logDuration logs} the duration.
      */
     public void traceEnd() {
+        assertSameThread();
         Trace.traceEnd(mTraceTag);
         if (!DEBUG_BOOT_TIME) {
             return;
@@ -68,6 +73,15 @@
         logDuration(event.first, (SystemClock.elapsedRealtime() - event.second));
     }
 
+    private void assertSameThread() {
+        final Thread currentThread = Thread.currentThread();
+        if (currentThread.getId() != mThreadId) {
+            throw new IllegalStateException("Instance of TimingsTraceLog can only be called from "
+                    + "the thread it was created on (tid: " + mThreadId + "), but was from "
+                    + currentThread.getName() + " (tid: " + currentThread.getId() + ")");
+        }
+    }
+
     /**
      * Log the duration so it can be parsed by external tools for performance reporting
      */
diff --git a/core/java/android/view/FocusFinder.java b/core/java/android/view/FocusFinder.java
index af26a88..74555de 100644
--- a/core/java/android/view/FocusFinder.java
+++ b/core/java/android/view/FocusFinder.java
@@ -574,10 +574,10 @@
         switch (direction) {
             case View.FOCUS_LEFT:
             case View.FOCUS_RIGHT:
-                return (rect2.bottom >= rect1.top) && (rect2.top <= rect1.bottom);
+                return (rect2.bottom > rect1.top) && (rect2.top < rect1.bottom);
             case View.FOCUS_UP:
             case View.FOCUS_DOWN:
-                return (rect2.right >= rect1.left) && (rect2.left <= rect1.right);
+                return (rect2.right > rect1.left) && (rect2.left < rect1.right);
         }
         throw new IllegalArgumentException("direction must be one of "
                 + "{FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT}.");
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
index 829b2b7..a2147b7 100644
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -804,8 +804,11 @@
     public static final int KEYCODE_SYSTEM_NAVIGATION_LEFT = 282;
     /** Key code constant: Consumed by the system for navigation right */
     public static final int KEYCODE_SYSTEM_NAVIGATION_RIGHT = 283;
+    /** Key code constant: Show all apps
+     * @hide */
+    public static final int KEYCODE_ALL_APPS = 284;
 
-    private static final int LAST_KEYCODE = KEYCODE_SYSTEM_NAVIGATION_RIGHT;
+    private static final int LAST_KEYCODE = KEYCODE_ALL_APPS;
 
     // NOTE: If you add a new keycode here you must also add it to:
     //  isSystem()
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 1d206ab..cac27af 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -16,6 +16,7 @@
 
 package android.view;
 
+import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
 import static android.view.WindowManagerPolicy.APPLICATION_MEDIA_OVERLAY_SUBLAYER;
 import static android.view.WindowManagerPolicy.APPLICATION_MEDIA_SUBLAYER;
 import static android.view.WindowManagerPolicy.APPLICATION_PANEL_SUBLAYER;
@@ -871,6 +872,31 @@
         return callbacks;
     }
 
+    /**
+     * This method still exists only for compatibility reasons because some applications have relied
+     * on this method via reflection. See Issue 36345857 for details.
+     *
+     * @deprecated No platform code is using this method anymore.
+     * @hide
+     */
+    @Deprecated
+    public void setWindowType(int type) {
+        if (getContext().getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.O) {
+            throw new UnsupportedOperationException(
+                    "SurfaceView#setWindowType() has never been a public API.");
+        }
+
+        if (type == TYPE_APPLICATION_PANEL) {
+            Log.e(TAG, "If you are calling SurfaceView#setWindowType(TYPE_APPLICATION_PANEL) "
+                    + "just to make the SurfaceView to be placed on top of its window, you must "
+                    + "call setZOrderOnTop(true) instead.", new Throwable());
+            setZOrderOnTop(true);
+            return;
+        }
+        Log.e(TAG, "SurfaceView#setWindowType(int) is deprecated and now does nothing. "
+                + "type=" + type, new Throwable());
+    }
+
     private void runOnUiThread(Runnable runnable) {
         Handler handler = getHandler();
         if (handler != null && handler.getLooper() != Looper.myLooper()) {
diff --git a/core/java/android/view/textclassifier/TextClassification.java b/core/java/android/view/textclassifier/TextClassification.java
index fa7b9a5..1849368 100644
--- a/core/java/android/view/textclassifier/TextClassification.java
+++ b/core/java/android/view/textclassifier/TextClassification.java
@@ -261,7 +261,7 @@
          * @hide
          */
         Builder setVersionInfo(@NonNull String versionInfo) {
-            mVersionInfo = Preconditions.checkNotNull(mVersionInfo);
+            mVersionInfo = Preconditions.checkNotNull(versionInfo);
             return this;
         }
 
diff --git a/core/java/android/view/textclassifier/TextSelection.java b/core/java/android/view/textclassifier/TextSelection.java
index 085dd32..11ebe83 100644
--- a/core/java/android/view/textclassifier/TextSelection.java
+++ b/core/java/android/view/textclassifier/TextSelection.java
@@ -169,7 +169,7 @@
          * @hide
          */
         Builder setVersionInfo(@NonNull String versionInfo) {
-            mVersionInfo = Preconditions.checkNotNull(mVersionInfo);
+            mVersionInfo = Preconditions.checkNotNull(versionInfo);
             return this;
         }
 
diff --git a/core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java b/core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java
index 45baf91..77aea23 100644
--- a/core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java
+++ b/core/java/android/view/textclassifier/logging/SmartSelectionEventTracker.java
@@ -253,6 +253,7 @@
     private static void debugLog(LogMaker log) {
         if (!DEBUG_LOG_ENABLED) return;
 
+        final String tag = Objects.toString(log.getTaggedData(TAG), "tag");
         final int index = Integer.parseInt(Objects.toString(log.getTaggedData(INDEX), ZERO));
 
         final String event;
@@ -291,7 +292,6 @@
                 event = "RESET";
                 break;
             case SelectionEvent.EventType.SELECTION_STARTED:
-                final String tag = Objects.toString(log.getTaggedData(TAG), "tag");
                 String sessionId = Objects.toString(log.getTaggedData(SESSION_ID), "");
                 sessionId = sessionId.substring(sessionId.lastIndexOf("-") + 1);
                 Log.d(LOG_TAG, String.format("New selection session: %s(%s)", tag, sessionId));
@@ -326,8 +326,8 @@
         final String entity = Objects.toString(
                 log.getTaggedData(ENTITY_TYPE), TextClassifier.TYPE_UNKNOWN);
 
-        Log.d(LOG_TAG, String.format("%2d: %s, context=%d,%d - old=%d,%d [%s]",
-                index, event, eventStart, eventEnd, smartStart, smartEnd, entity));
+        Log.d(LOG_TAG, String.format("%2d: %s, context=%d,%d - old=%d,%d [%s] (%s)",
+                index, event, eventStart, eventEnd, smartStart, smartEnd, entity, tag));
     }
 
     /**
diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java
index 45e6eb3..b839420 100644
--- a/core/java/android/webkit/CacheManager.java
+++ b/core/java/android/webkit/CacheManager.java
@@ -230,7 +230,7 @@
      * {@link CacheManager.CacheResult#getLocalPath CacheManager.CacheResult.getLocalPath()}.
      *
      * @return the base directory of the cache
-     * @deprecated This method no longer has any effect and always returns null.
+     * @deprecated This method no longer has any effect and always returns {@code null}.
      */
     @Deprecated
     public static File getCacheFileBaseDir() {
@@ -240,8 +240,8 @@
     /**
      * Gets whether the HTTP cache is disabled.
      *
-     * @return true if the HTTP cache is disabled
-     * @deprecated This method no longer has any effect and always returns false.
+     * @return {@code true} if the HTTP cache is disabled
+     * @deprecated This method no longer has any effect and always returns {@code false}.
      */
     @Deprecated
     public static boolean cacheDisabled() {
@@ -249,12 +249,12 @@
     }
 
     /**
-     * Starts a cache transaction. Returns true if this is the only running
+     * Starts a cache transaction. Returns {@code true} if this is the only running
      * transaction. Otherwise, this transaction is nested inside currently
-     * running transactions and false is returned.
+     * running transactions and {@code false} is returned.
      *
-     * @return true if this is the only running transaction
-     * @deprecated This method no longer has any effect and always returns false.
+     * @return {@code true} if this is the only running transaction
+     * @deprecated This method no longer has any effect and always returns {@code false}.
      */
     @Deprecated
     public static boolean startCacheTransaction() {
@@ -265,8 +265,8 @@
      * Ends the innermost cache transaction and returns whether this was the
      * only running transaction.
      *
-     * @return true if this was the only running transaction
-     * @deprecated This method no longer has any effect and always returns false.
+     * @return {@code true} if this was the only running transaction
+     * @deprecated This method no longer has any effect and always returns {@code false}.
      */
     @Deprecated
     public static boolean endCacheTransaction() {
@@ -274,7 +274,7 @@
     }
 
     /**
-     * Gets the cache entry for the specified URL, or null if none is found.
+     * Gets the cache entry for the specified URL, or {@code null} if none is found.
      * If a non-null value is provided for the HTTP headers map, and the cache
      * entry needs validation, appropriate headers will be added to the map.
      * The input stream of the CacheEntry object should be closed by the caller
@@ -284,7 +284,7 @@
      * @param headers a map from HTTP header name to value, to be populated
      *                for the returned cache entry
      * @return the cache entry for the specified URL
-     * @deprecated This method no longer has any effect and always returns null.
+     * @deprecated This method no longer has any effect and always returns {@code null}.
      */
     @Deprecated
     public static CacheResult getCacheFile(String url,
diff --git a/core/java/android/webkit/ClientCertRequest.java b/core/java/android/webkit/ClientCertRequest.java
index 4a7f5fd..de17534 100644
--- a/core/java/android/webkit/ClientCertRequest.java
+++ b/core/java/android/webkit/ClientCertRequest.java
@@ -42,13 +42,13 @@
     public ClientCertRequest() { }
 
     /**
-     * Returns the acceptable types of asymmetric keys (can be null).
+     * Returns the acceptable types of asymmetric keys (can be {@code null}).
      */
     public abstract String[] getKeyTypes();
 
     /**
      * Returns the acceptable certificate issuers for the certificate
-     *            matching the private key (can be null).
+     *            matching the private key (can be {@code null}).
      */
     public abstract Principal[] getPrincipals();
 
diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java
index 67289c2..8989293 100644
--- a/core/java/android/webkit/CookieManager.java
+++ b/core/java/android/webkit/CookieManager.java
@@ -42,9 +42,9 @@
     /**
      * Sets whether the application's {@link WebView} instances should send and
      * accept cookies.
-     * By default this is set to true and the WebView accepts cookies.
+     * By default this is set to {@code true} and the WebView accepts cookies.
      * <p>
-     * When this is true
+     * When this is {@code true}
      * {@link CookieManager#setAcceptThirdPartyCookies setAcceptThirdPartyCookies} and
      * {@link CookieManager#setAcceptFileSchemeCookies setAcceptFileSchemeCookies}
      * can be used to control the policy for those specific types of cookie.
@@ -58,7 +58,7 @@
      * Gets whether the application's {@link WebView} instances send and accept
      * cookies.
      *
-     * @return true if {@link WebView} instances send and accept cookies
+     * @return {@code true} if {@link WebView} instances send and accept cookies
      */
     public abstract boolean acceptCookie();
 
@@ -82,7 +82,7 @@
      * Gets whether the {@link WebView} should allow third party cookies to be set.
      *
      * @param webview the {@link WebView} instance to get the cookie policy for
-     * @return true if the {@link WebView} accepts third party cookies
+     * @return {@code true} if the {@link WebView} accepts third party cookies
      */
     public abstract boolean acceptThirdPartyCookies(WebView webview);
 
@@ -202,7 +202,7 @@
     /**
      * Gets whether there are stored cookies.
      *
-     * @return true if there are stored cookies
+     * @return {@code true} if there are stored cookies
      */
     public abstract boolean hasCookies();
 
@@ -233,7 +233,7 @@
      * Gets whether the application's {@link WebView} instances send and accept
      * cookies for file scheme URLs.
      *
-     * @return true if {@link WebView} instances send and accept cookies for
+     * @return {@code true} if {@link WebView} instances send and accept cookies for
      *         file scheme URLs
      */
     // Static for backward compatibility.
diff --git a/core/java/android/webkit/FindActionModeCallback.java b/core/java/android/webkit/FindActionModeCallback.java
index f313893..71f85d7 100644
--- a/core/java/android/webkit/FindActionModeCallback.java
+++ b/core/java/android/webkit/FindActionModeCallback.java
@@ -109,8 +109,8 @@
 
     /*
      * Move the highlight to the next match.
-     * @param next If true, find the next match further down in the document.
-     *             If false, find the previous match, up in the document.
+     * @param next If {@code true}, find the next match further down in the document.
+     *             If {@code false}, find the previous match, up in the document.
      */
     private void findNext(boolean next) {
         if (mWebView == null) {
diff --git a/core/java/android/webkit/MimeTypeMap.java b/core/java/android/webkit/MimeTypeMap.java
index da8901a..e172c02 100644
--- a/core/java/android/webkit/MimeTypeMap.java
+++ b/core/java/android/webkit/MimeTypeMap.java
@@ -17,9 +17,11 @@
 package android.webkit;
 
 import android.text.TextUtils;
-import java.util.regex.Pattern;
+
 import libcore.net.MimeUtils;
 
+import java.util.regex.Pattern;
+
 /**
  * Two-way map that maps MIME-types to file extensions and vice versa.
  *
@@ -71,9 +73,9 @@
     }
 
     /**
-     * Return true if the given MIME type has an entry in the map.
+     * Return {@code true} if the given MIME type has an entry in the map.
      * @param mimeType A MIME type (i.e. text/plain)
-     * @return True iff there is a mimeType entry in the map.
+     * @return {@code true} iff there is a mimeType entry in the map.
      */
     public boolean hasMimeType(String mimeType) {
         return MimeUtils.hasMimeType(mimeType);
@@ -82,7 +84,7 @@
     /**
      * Return the MIME type for the given extension.
      * @param extension A file extension without the leading '.'
-     * @return The MIME type for the given extension or null iff there is none.
+     * @return The MIME type for the given extension or {@code null} iff there is none.
      */
     public String getMimeTypeFromExtension(String extension) {
         return MimeUtils.guessMimeTypeFromExtension(extension);
@@ -94,9 +96,9 @@
     }
 
     /**
-     * Return true if the given extension has a registered MIME type.
+     * Return {@code true} if the given extension has a registered MIME type.
      * @param extension A file extension without the leading '.'
-     * @return True iff there is an extension entry in the map.
+     * @return {@code true} iff there is an extension entry in the map.
      */
     public boolean hasExtension(String extension) {
         return MimeUtils.hasExtension(extension);
@@ -107,14 +109,14 @@
      * MIME types map to multiple extensions. This call will return the most
      * common extension for the given MIME type.
      * @param mimeType A MIME type (i.e. text/plain)
-     * @return The extension for the given MIME type or null iff there is none.
+     * @return The extension for the given MIME type or {@code null} iff there is none.
      */
     public String getExtensionFromMimeType(String mimeType) {
         return MimeUtils.guessExtensionFromMimeType(mimeType);
     }
 
     /**
-     * If the given MIME type is null, or one of the "generic" types (text/plain
+     * If the given MIME type is {@code null}, or one of the "generic" types (text/plain
      * or application/octet-stream) map it to a type that Android can deal with.
      * If the given type is not generic, return it unchanged.
      *
diff --git a/core/java/android/webkit/RenderProcessGoneDetail.java b/core/java/android/webkit/RenderProcessGoneDetail.java
index 1c79399..0843e26 100644
--- a/core/java/android/webkit/RenderProcessGoneDetail.java
+++ b/core/java/android/webkit/RenderProcessGoneDetail.java
@@ -28,7 +28,7 @@
      * If the render process was killed, this is most likely caused by the
      * system being low on memory.
      *
-     * @return True if render process crashed, otherwise it was killed by
+     * @return {@code true} if render process crashed, otherwise it was killed by
      *         system.
      **/
     public abstract boolean didCrash();
diff --git a/core/java/android/webkit/SafeBrowsingResponse.java b/core/java/android/webkit/SafeBrowsingResponse.java
index 0d0f1cc..4750dfb 100644
--- a/core/java/android/webkit/SafeBrowsingResponse.java
+++ b/core/java/android/webkit/SafeBrowsingResponse.java
@@ -32,21 +32,21 @@
     /**
      * Display the default interstitial.
      *
-     * @param allowReporting True if the interstitial should show a reporting checkbox.
+     * @param allowReporting {@code true} if the interstitial should show a reporting checkbox.
      */
     public abstract void showInterstitial(boolean allowReporting);
 
     /**
      * Act as if the user clicked "visit this unsafe site."
      *
-     * @param report True to enable Safe Browsing reporting.
+     * @param report {@code true} to enable Safe Browsing reporting.
      */
     public abstract void proceed(boolean report);
 
     /**
      * Act as if the user clicked "back to safety."
      *
-     * @param report True to enable Safe Browsing reporting.
+     * @param report {@code true} to enable Safe Browsing reporting.
      */
     public abstract void backToSafety(boolean report);
 }
diff --git a/core/java/android/webkit/ServiceWorkerClient.java b/core/java/android/webkit/ServiceWorkerClient.java
index 2334055..b4964fd 100644
--- a/core/java/android/webkit/ServiceWorkerClient.java
+++ b/core/java/android/webkit/ServiceWorkerClient.java
@@ -24,7 +24,7 @@
 
     /**
      * Notify the host application of a resource request and allow the
-     * application to return the data. If the return value is null, the
+     * application to return the data. If the return value is {@code null}, the
      * Service Worker will continue to load the resource as usual.
      * Otherwise, the return response and data will be used.
      * NOTE: This method is called on a thread other than the UI thread
@@ -33,7 +33,7 @@
      *
      * @param request Object containing the details of the request.
      * @return A {@link android.webkit.WebResourceResponse} containing the
-     *         response information or null if the WebView should load the
+     *         response information or {@code null} if the WebView should load the
      *         resource itself.
      * @see WebViewClient#shouldInterceptRequest(WebView, WebResourceRequest)
      */
diff --git a/core/java/android/webkit/ServiceWorkerWebSettings.java b/core/java/android/webkit/ServiceWorkerWebSettings.java
index 92e9fbe..25058da 100644
--- a/core/java/android/webkit/ServiceWorkerWebSettings.java
+++ b/core/java/android/webkit/ServiceWorkerWebSettings.java
@@ -76,14 +76,15 @@
      * Sets whether Service Workers should not load resources from the network,
      * see {@link WebSettings#setBlockNetworkLoads}.
      *
-     * @param flag true means block network loads by the Service Workers
+     * @param flag {@code true} means block network loads by the Service Workers
      */
     public abstract void setBlockNetworkLoads(boolean flag);
 
     /**
      * Gets whether Service Workers are prohibited from loading any resources from the network.
      *
-     * @return true if the Service Workers are not allowed to load any resources from the network
+     * @return {@code true} if the Service Workers are not allowed to load any resources from the
+     *         network
      * @see #setBlockNetworkLoads
      */
     public abstract boolean getBlockNetworkLoads();
diff --git a/core/java/android/webkit/TokenBindingService.java b/core/java/android/webkit/TokenBindingService.java
index f7caac7..43565c2 100644
--- a/core/java/android/webkit/TokenBindingService.java
+++ b/core/java/android/webkit/TokenBindingService.java
@@ -20,7 +20,6 @@
 import android.net.Uri;
 
 import java.security.KeyPair;
-import java.security.spec.AlgorithmParameterSpec;
 
 /**
  * Enables the token binding procotol, and provides access to the keys. See
@@ -82,13 +81,13 @@
      * If no key pair exists, WebView chooses an algorithm from the list, in
      * the order given, to generate a key.
      *
-     * The user can pass a null if any algorithm is acceptable.
+     * The user can pass {@code null} if any algorithm is acceptable.
      *
      * @param origin The origin for the server.
-     * @param algorithm The list of algorithms. Can be null. An
+     * @param algorithm The list of algorithms. Can be {@code null}. An
      *        IllegalArgumentException is thrown if array is empty.
      * @param callback The callback that will be called when key is available.
-     *        Cannot be null.
+     *        Cannot be {@code null}.
      */
     public abstract void getKey(Uri origin,
                                 String[] algorithm,
@@ -99,7 +98,7 @@
      * @param origin The origin of the server.
      * @param callback The callback that will be called when key is deleted. The
      *        callback parameter (Boolean) will indicate if operation is
-     *        successful or if failed. The callback can be null.
+     *        successful or if failed. The callback can be {@code null}.
      */
     public abstract void deleteKey(Uri origin,
                                    ValueCallback<Boolean> callback);
@@ -109,7 +108,7 @@
       *
       * @param callback The callback that will be called when keys are deleted.
       *        The callback parameter (Boolean) will indicate if operation is
-      *        successful or if failed. The callback can be null.
+      *        successful or if failed. The callback can be {@code null}.
       */
     public abstract void deleteAllKeys(ValueCallback<Boolean> callback);
 }
diff --git a/core/java/android/webkit/URLUtil.java b/core/java/android/webkit/URLUtil.java
index f5233b6..c8bfb77 100644
--- a/core/java/android/webkit/URLUtil.java
+++ b/core/java/android/webkit/URLUtil.java
@@ -16,16 +16,16 @@
 
 package android.webkit;
 
+import android.net.ParseException;
+import android.net.Uri;
+import android.net.WebAddress;
+import android.util.Log;
+
 import java.io.UnsupportedEncodingException;
 import java.util.Locale;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import android.net.Uri;
-import android.net.ParseException;
-import android.net.WebAddress;
-import android.util.Log;
-
 public final class URLUtil {
 
     private static final String LOGTAG = "webkit";
@@ -136,7 +136,7 @@
     }
 
     /**
-     * @return True iff the url is correctly URL encoded
+     * @return {@code true} iff the url is correctly URL encoded
      */
     static boolean verifyURLEncoding(String url) {
         int count = url.length();
@@ -170,14 +170,14 @@
     }
 
     /**
-     * @return True iff the url is an asset file.
+     * @return {@code true} iff the url is an asset file.
      */
     public static boolean isAssetUrl(String url) {
         return (null != url) && url.startsWith(ASSET_BASE);
     }
 
     /**
-     * @return True iff the url is a resource file.
+     * @return {@code true} iff the url is a resource file.
      * @hide
      */
     public static boolean isResourceUrl(String url) {
@@ -185,7 +185,7 @@
     }
 
     /**
-     * @return True iff the url is a proxy url to allow cookieless network
+     * @return {@code true} iff the url is a proxy url to allow cookieless network
      * requests from a file url.
      * @deprecated Cookieless proxy is no longer supported.
      */
@@ -195,7 +195,7 @@
     }
 
     /**
-     * @return True iff the url is a local file.
+     * @return {@code true} iff the url is a local file.
      */
     public static boolean isFileUrl(String url) {
         return (null != url) && (url.startsWith(FILE_BASE) &&
@@ -204,28 +204,28 @@
     }
 
     /**
-     * @return True iff the url is an about: url.
+     * @return {@code true} iff the url is an about: url.
      */
     public static boolean isAboutUrl(String url) {
         return (null != url) && url.startsWith("about:");
     }
 
     /**
-     * @return True iff the url is a data: url.
+     * @return {@code true} iff the url is a data: url.
      */
     public static boolean isDataUrl(String url) {
         return (null != url) && url.startsWith("data:");
     }
 
     /**
-     * @return True iff the url is a javascript: url.
+     * @return {@code true} iff the url is a javascript: url.
      */
     public static boolean isJavaScriptUrl(String url) {
         return (null != url) && url.startsWith("javascript:");
     }
 
     /**
-     * @return True iff the url is an http: url.
+     * @return {@code true} iff the url is an http: url.
      */
     public static boolean isHttpUrl(String url) {
         return (null != url) &&
@@ -234,7 +234,7 @@
     }
 
     /**
-     * @return True iff the url is an https: url.
+     * @return {@code true} iff the url is an https: url.
      */
     public static boolean isHttpsUrl(String url) {
         return (null != url) &&
@@ -243,7 +243,7 @@
     }
 
     /**
-     * @return True iff the url is a network url.
+     * @return {@code true} iff the url is a network url.
      */
     public static boolean isNetworkUrl(String url) {
         if (url == null || url.length() == 0) {
@@ -253,14 +253,14 @@
     }
 
     /**
-     * @return True iff the url is a content: url.
+     * @return {@code true} iff the url is a content: url.
      */
     public static boolean isContentUrl(String url) {
         return (null != url) && url.startsWith(CONTENT_BASE);
     }
 
     /**
-     * @return True iff the url is valid.
+     * @return {@code true} iff the url is valid.
      */
     public static boolean isValidUrl(String url) {
         if (url == null || url.length() == 0) {
@@ -293,8 +293,8 @@
      * the URL and contentDisposition. File extension, if not defined,
      * is added based on the mimetype
      * @param url Url to the content
-     * @param contentDisposition Content-Disposition HTTP header or null
-     * @param mimeType Mime-type of the content or null
+     * @param contentDisposition Content-Disposition HTTP header or {@code null}
+     * @param mimeType Mime-type of the content or {@code null}
      *
      * @return suggested filename
      */
diff --git a/core/java/android/webkit/UrlInterceptHandler.java b/core/java/android/webkit/UrlInterceptHandler.java
index 59fc0cb..aa5c6dc 100644
--- a/core/java/android/webkit/UrlInterceptHandler.java
+++ b/core/java/android/webkit/UrlInterceptHandler.java
@@ -18,6 +18,7 @@
 
 import android.webkit.CacheManager.CacheResult;
 import android.webkit.PluginData;
+
 import java.util.Map;
 
 /**
@@ -30,11 +31,11 @@
 
     /**
      * Given an URL, returns the CacheResult which contains the
-     * surrogate response for the request, or null if the handler is
+     * surrogate response for the request, or {@code null} if the handler is
      * not interested.
      *
      * @param url URL string.
-     * @param headers The headers associated with the request. May be null.
+     * @param headers The headers associated with the request. May be {@code null}.
      * @return The CacheResult containing the surrogate response.
      *
      * @hide
@@ -45,11 +46,11 @@
 
     /**
      * Given an URL, returns the PluginData which contains the
-     * surrogate response for the request, or null if the handler is
+     * surrogate response for the request, or {@code null} if the handler is
      * not interested.
      *
      * @param url URL string.
-     * @param headers The headers associated with the request. May be null.
+     * @param headers The headers associated with the request. May be {@code null}.
      * @return The PluginData containing the surrogate response.
      *
      * @hide
diff --git a/core/java/android/webkit/UrlInterceptRegistry.java b/core/java/android/webkit/UrlInterceptRegistry.java
index bdf6747..67af2ad 100644
--- a/core/java/android/webkit/UrlInterceptRegistry.java
+++ b/core/java/android/webkit/UrlInterceptRegistry.java
@@ -47,7 +47,7 @@
     /**
      * set the flag to control whether url intercept is enabled or disabled
      * 
-     * @param disabled true to disable the cache
+     * @param disabled {@code true} to disable the cache
      *
      * @hide
      * @deprecated This class was intended to be used by Gears. Since Gears was
@@ -77,7 +77,7 @@
      * before any that were previously registered.
      *
      * @param handler The new UrlInterceptHandler object
-     * @return true if the handler was not previously registered.
+     * @return {@code true} if the handler was not previously registered.
      *
      * @hide
      * @deprecated This class was intended to be used by Gears. Since Gears was
@@ -98,7 +98,7 @@
      * Unregister a previously registered UrlInterceptHandler.
      *
      * @param handler A previously registered UrlInterceptHandler.
-     * @return true if the handler was found and removed from the list.
+     * @return {@code true} if the handler was found and removed from the list.
      *
      * @hide
      * @deprecated This class was intended to be used by Gears. Since Gears was
@@ -112,7 +112,7 @@
 
     /**
      * Given an url, returns the CacheResult of the first
-     * UrlInterceptHandler interested, or null if none are.
+     * UrlInterceptHandler interested, or {@code null} if none are.
      *
      * @return A CacheResult containing surrogate content.
      *
@@ -139,7 +139,7 @@
 
     /**
      * Given an url, returns the PluginData of the first
-     * UrlInterceptHandler interested, or null if none are or if
+     * UrlInterceptHandler interested, or {@code null} if none are or if
      * intercepts are disabled.
      *
      * @return A PluginData instance containing surrogate content.
diff --git a/core/java/android/webkit/UserPackage.java b/core/java/android/webkit/UserPackage.java
index 9da6455..4cf3461 100644
--- a/core/java/android/webkit/UserPackage.java
+++ b/core/java/android/webkit/UserPackage.java
@@ -69,7 +69,7 @@
     }
 
     /**
-     * Return true if the package is installed and not hidden
+     * Return {@code true} if the package is installed and not hidden
      */
     public boolean isInstalledPackage() {
         if (mPackageInfo == null) return false;
diff --git a/core/java/android/webkit/WebBackForwardList.java b/core/java/android/webkit/WebBackForwardList.java
index 6f763dc..3349b06 100644
--- a/core/java/android/webkit/WebBackForwardList.java
+++ b/core/java/android/webkit/WebBackForwardList.java
@@ -25,7 +25,7 @@
  */
 public abstract class WebBackForwardList implements Cloneable, Serializable {
     /**
-     * Return the current history item. This method returns null if the list is
+     * Return the current history item. This method returns {@code null} if the list is
      * empty.
      * @return The current history item.
      */
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java
index 81aa2f3..3444d49 100644
--- a/core/java/android/webkit/WebChromeClient.java
+++ b/core/java/android/webkit/WebChromeClient.java
@@ -52,7 +52,7 @@
      * Notify the host application of the url for an apple-touch-icon.
      * @param view The WebView that initiated the callback.
      * @param url The icon url.
-     * @param precomposed True if the url is for a precomposed touch icon.
+     * @param precomposed {@code true} if the url is for a precomposed touch icon.
      */
     public void onReceivedTouchIconUrl(WebView view, String url,
             boolean precomposed) {}
@@ -106,17 +106,17 @@
 
     /**
      * Request the host application to create a new window. If the host
-     * application chooses to honor this request, it should return true from
+     * application chooses to honor this request, it should return {@code true} from
      * this method, create a new WebView to host the window, insert it into the
      * View system and send the supplied resultMsg message to its target with
      * the new WebView as an argument. If the host application chooses not to
-     * honor the request, it should return false from this method. The default
-     * implementation of this method does nothing and hence returns false.
+     * honor the request, it should return {@code false} from this method. The default
+     * implementation of this method does nothing and hence returns {@code false}.
      * @param view The WebView from which the request for a new window
      *             originated.
-     * @param isDialog True if the new window should be a dialog, rather than
+     * @param isDialog {@code true} if the new window should be a dialog, rather than
      *                 a full-size window.
-     * @param isUserGesture True if the request was initiated by a user gesture,
+     * @param isUserGesture {@code true} if the request was initiated by a user gesture,
      *                      such as the user clicking a link.
      * @param resultMsg The message to send when once a new WebView has been
      *                  created. resultMsg.obj is a
@@ -124,10 +124,10 @@
      *                  used to transport the new WebView, by calling
      *                  {@link WebView.WebViewTransport#setWebView(WebView)
      *                  WebView.WebViewTransport.setWebView(WebView)}.
-     * @return This method should return true if the host application will
+     * @return This method should return {@code true} if the host application will
      *         create a new window, in which case resultMsg should be sent to
-     *         its target. Otherwise, this method should return false. Returning
-     *         false from this method but also sending resultMsg will result in
+     *         its target. Otherwise, this method should return {@code false}. Returning
+     *         {@code false} from this method but also sending resultMsg will result in
      *         undefined behavior.
      */
     public boolean onCreateWindow(WebView view, boolean isDialog,
@@ -154,8 +154,8 @@
 
     /**
      * Tell the client to display a javascript alert dialog.  If the client
-     * returns true, WebView will assume that the client will handle the
-     * dialog.  If the client returns false, it will continue execution.
+     * returns {@code true}, WebView will assume that the client will handle the
+     * dialog.  If the client returns {@code false}, it will continue execution.
      * @param view The WebView that initiated the callback.
      * @param url The url of the page requesting the dialog.
      * @param message Message to be displayed in the window.
@@ -169,10 +169,10 @@
 
     /**
      * Tell the client to display a confirm dialog to the user. If the client
-     * returns true, WebView will assume that the client will handle the
+     * returns {@code true}, WebView will assume that the client will handle the
      * confirm dialog and call the appropriate JsResult method. If the
-     * client returns false, a default value of false will be returned to
-     * javascript. The default behavior is to return false.
+     * client returns false, a default value of {@code false} will be returned to
+     * javascript. The default behavior is to return {@code false}.
      * @param view The WebView that initiated the callback.
      * @param url The url of the page requesting the dialog.
      * @param message Message to be displayed in the window.
@@ -187,10 +187,10 @@
 
     /**
      * Tell the client to display a prompt dialog to the user. If the client
-     * returns true, WebView will assume that the client will handle the
+     * returns {@code true}, WebView will assume that the client will handle the
      * prompt dialog and call the appropriate JsPromptResult method. If the
-     * client returns false, a default value of false will be returned to to
-     * javascript. The default behavior is to return false.
+     * client returns false, a default value of {@code false} will be returned to to
+     * javascript. The default behavior is to return {@code false}.
      * @param view The WebView that initiated the callback.
      * @param url The url of the page requesting the dialog.
      * @param message Message to be displayed in the window.
@@ -207,12 +207,12 @@
     /**
      * Tell the client to display a dialog to confirm navigation away from the
      * current page. This is the result of the onbeforeunload javascript event.
-     * If the client returns true, WebView will assume that the client will
+     * If the client returns {@code true}, WebView will assume that the client will
      * handle the confirm dialog and call the appropriate JsResult method. If
-     * the client returns false, a default value of true will be returned to
+     * the client returns {@code false}, a default value of {@code true} will be returned to
      * javascript to accept navigation away from the current page. The default
-     * behavior is to return false. Setting the JsResult to true will navigate
-     * away from the current page, false will cancel the navigation.
+     * behavior is to return {@code false}. Setting the JsResult to {@code true} will navigate
+     * away from the current page, {@code false} will cancel the navigation.
      * @param view The WebView that initiated the callback.
      * @param url The url of the page requesting the dialog.
      * @param message Message to be displayed in the window.
@@ -332,8 +332,8 @@
     /**
      * Tell the client that a JavaScript execution timeout has occured. And the
      * client may decide whether or not to interrupt the execution. If the
-     * client returns true, the JavaScript will be interrupted. If the client
-     * returns false, the execution will continue. Note that in the case of
+     * client returns {@code true}, the JavaScript will be interrupted. If the client
+     * returns {@code false}, the execution will continue. Note that in the case of
      * continuing execution, the timeout counter will be reset, and the callback
      * will continue to occur if the script does not finish at the next check
      * point.
@@ -365,7 +365,7 @@
      * Report a JavaScript console message to the host application. The ChromeClient
      * should override this to process the log message as they see fit.
      * @param consoleMessage Object containing details of the console message.
-     * @return true if the message is handled by the client.
+     * @return {@code true} if the message is handled by the client.
      */
     public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
         // Call the old version of this function for backwards compatability.
@@ -380,7 +380,7 @@
      * HTML. If the attribute is absent, then a default poster will be used. This
      * method allows the ChromeClient to provide that default image.
      *
-     * @return Bitmap The image to use as a default poster, or null if no such image is
+     * @return Bitmap The image to use as a default poster, or {@code null} if no such image is
      * available.
      */
     public Bitmap getDefaultVideoPoster() {
@@ -409,15 +409,16 @@
      * This is called to handle HTML forms with 'file' input type, in response to the
      * user pressing the "Select File" button.
      * To cancel the request, call <code>filePathCallback.onReceiveValue(null)</code> and
-     * return true.
+     * return {@code true}.
      *
      * @param webView The WebView instance that is initiating the request.
      * @param filePathCallback Invoke this callback to supply the list of paths to files to upload,
-     *                         or NULL to cancel. Must only be called if the
-     *                         {@link #onShowFileChooser} implementation returns true.
+     *                         or {@code null} to cancel. Must only be called if the
+     *                         {@link #onShowFileChooser} implementation returns {@code true}.
      * @param fileChooserParams Describes the mode of file chooser to be opened, and options to be
      *                          used with it.
-     * @return true if filePathCallback will be invoked, false to use default handling.
+     * @return {@code true} if filePathCallback will be invoked, {@code false} to use default
+     *         handling.
      *
      * @see FileChooserParams
      */
@@ -448,7 +449,7 @@
          *
          * @param resultCode the integer result code returned by the file picker activity.
          * @param data the intent returned by the file picker activity.
-         * @return the Uris of selected file(s) or null if the resultCode indicates
+         * @return the Uris of selected file(s) or {@code null} if the resultCode indicates
          *         activity canceled or any other error.
          */
         public static Uri[] parseResult(int resultCode, Intent data) {
@@ -469,20 +470,20 @@
 
         /**
          * Returns preference for a live media captured value (e.g. Camera, Microphone).
-         * True indicates capture is enabled, false disabled.
+         * True indicates capture is enabled, {@code false} disabled.
          *
          * Use <code>getAcceptTypes</code> to determine suitable capture devices.
          */
         public abstract boolean isCaptureEnabled();
 
         /**
-         * Returns the title to use for this file selector, or null. If null a default
+         * Returns the title to use for this file selector, or null. If {@code null} a default
          * title should be used.
          */
         public abstract CharSequence getTitle();
 
         /**
-         * The file name of a default selection if specified, or null.
+         * The file name of a default selection if specified, or {@code null}.
          */
         public abstract String getFilenameHint();
 
diff --git a/core/java/android/webkit/WebHistoryItem.java b/core/java/android/webkit/WebHistoryItem.java
index 569fccd..1591833 100644
--- a/core/java/android/webkit/WebHistoryItem.java
+++ b/core/java/android/webkit/WebHistoryItem.java
@@ -65,8 +65,8 @@
     public abstract String getTitle();
 
     /**
-     * Return the favicon of this history item or null if no favicon was found.
-     * @return A Bitmap containing the favicon for this history item or null.
+     * Return the favicon of this history item or {@code null} if no favicon was found.
+     * @return A Bitmap containing the favicon for this history item or {@code null}.
      * Note: The VM ensures 32-bit atomic read/write operations so we don't have
      * to synchronize this method.
      */
diff --git a/core/java/android/webkit/WebMessage.java b/core/java/android/webkit/WebMessage.java
index 7683a40..7fe66dc 100644
--- a/core/java/android/webkit/WebMessage.java
+++ b/core/java/android/webkit/WebMessage.java
@@ -53,7 +53,7 @@
     }
 
     /**
-     * Returns the ports that are sent with the message, or null if no port
+     * Returns the ports that are sent with the message, or {@code null} if no port
      * is sent.
      */
     public WebMessagePort[] getPorts() {
diff --git a/core/java/android/webkit/WebResourceRequest.java b/core/java/android/webkit/WebResourceRequest.java
index ab93505..964b6f8 100644
--- a/core/java/android/webkit/WebResourceRequest.java
+++ b/core/java/android/webkit/WebResourceRequest.java
@@ -34,7 +34,7 @@
     /**
      * Gets whether the request was made for the main frame.
      *
-     * @return whether the request was made for the main frame. Will be false for iframes,
+     * @return whether the request was made for the main frame. Will be {@code false} for iframes,
      *         for example.
      */
     boolean isForMainFrame();
@@ -48,8 +48,9 @@
 
     /**
      * Gets whether a gesture (such as a click) was associated with the request.
-     * For security reasons in certain situations this method may return false even though the
-     * sequence of events which caused the request to be created was initiated by a user gesture.
+     * For security reasons in certain situations this method may return {@code false} even though
+     * the sequence of events which caused the request to be created was initiated by a user
+     * gesture.
      *
      * @return whether a gesture was associated with the request.
      */
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 82cff7c..36a00ab 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -217,7 +217,7 @@
 
     /**
      * Enables dumping the pages navigation cache to a text file. The default
-     * is false.
+     * is {@code false}.
      *
      * @deprecated This method is now obsolete.
      * @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
@@ -243,7 +243,7 @@
      * controls and gestures. The particular zoom mechanisms that should be used
      * can be set with {@link #setBuiltInZoomControls}. This setting does not
      * affect zooming performed using the {@link WebView#zoomIn()} and
-     * {@link WebView#zoomOut()} methods. The default is true.
+     * {@link WebView#zoomOut()} methods. The default is {@code true}.
      *
      * @param support whether the WebView should support zoom
      */
@@ -252,14 +252,14 @@
     /**
      * Gets whether the WebView supports zoom.
      *
-     * @return true if the WebView supports zoom
+     * @return {@code true} if the WebView supports zoom
      * @see #setSupportZoom
      */
     public abstract boolean supportZoom();
 
     /**
      * Sets whether the WebView requires a user gesture to play media.
-     * The default is true.
+     * The default is {@code true}.
      *
      * @param require whether the WebView requires a user gesture to play media
      */
@@ -268,7 +268,7 @@
     /**
      * Gets whether the WebView requires a user gesture to play media.
      *
-     * @return true if the WebView requires a user gesture to play media
+     * @return {@code true} if the WebView requires a user gesture to play media
      * @see #setMediaPlaybackRequiresUserGesture
      */
     public abstract boolean getMediaPlaybackRequiresUserGesture();
@@ -278,7 +278,7 @@
      * built-in zoom mechanisms comprise on-screen zoom controls, which are
      * displayed over the WebView's content, and the use of a pinch gesture to
      * control zooming. Whether or not these on-screen controls are displayed
-     * can be set with {@link #setDisplayZoomControls}. The default is false.
+     * can be set with {@link #setDisplayZoomControls}. The default is {@code false}.
      * <p>
      * The built-in mechanisms are the only currently supported zoom
      * mechanisms, so it is recommended that this setting is always enabled.
@@ -293,7 +293,7 @@
     /**
      * Gets whether the zoom mechanisms built into WebView are being used.
      *
-     * @return true if the zoom mechanisms built into WebView are being used
+     * @return {@code true} if the zoom mechanisms built into WebView are being used
      * @see #setBuiltInZoomControls
      */
     public abstract boolean getBuiltInZoomControls();
@@ -301,7 +301,7 @@
     /**
      * Sets whether the WebView should display on-screen zoom controls when
      * using the built-in zoom mechanisms. See {@link #setBuiltInZoomControls}.
-     * The default is true.
+     * The default is {@code true}.
      *
      * @param enabled whether the WebView should display on-screen zoom controls
      */
@@ -311,7 +311,7 @@
      * Gets whether the WebView displays on-screen zoom controls when using
      * the built-in zoom mechanisms.
      *
-     * @return true if the WebView displays on-screen zoom controls when using
+     * @return {@code true} if the WebView displays on-screen zoom controls when using
      *         the built-in zoom mechanisms
      * @see #setDisplayZoomControls
      */
@@ -351,7 +351,7 @@
      * zooms out the content to fit on screen by width. This setting is
      * taken into account when the content width is greater than the width
      * of the WebView control, for example, when {@link #getUseWideViewPort}
-     * is enabled. The default is false.
+     * is enabled. The default is {@code false}.
      */
     public abstract void setLoadWithOverviewMode(boolean overview);
 
@@ -366,9 +366,9 @@
     /**
      * Sets whether the WebView will enable smooth transition while panning or
      * zooming or while the window hosting the WebView does not have focus.
-     * If it is true, WebView will choose a solution to maximize the performance.
+     * If it is {@code true}, WebView will choose a solution to maximize the performance.
      * e.g. the WebView's content may not be updated during the transition.
-     * If it is false, WebView will keep its fidelity. The default value is false.
+     * If it is false, WebView will keep its fidelity. The default value is {@code false}.
      *
      * @deprecated This method is now obsolete, and will become a no-op in future.
      */
@@ -388,8 +388,8 @@
 
     /**
      * Sets whether the WebView uses its background for over scroll background.
-     * If true, it will use the WebView's background. If false, it will use an
-     * internal pattern. Default is true.
+     * If {@code true}, it will use the WebView's background. If {@code false}, it will use an
+     * internal pattern. Default is {@code true}.
      *
      * @deprecated This method is now obsolete.
      * @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
@@ -433,7 +433,7 @@
     public abstract boolean getSaveFormData();
 
     /**
-     * Sets whether the WebView should save passwords. The default is true.
+     * Sets whether the WebView should save passwords. The default is {@code true}.
      * @deprecated Saving passwords in WebView will not be supported in future versions.
      */
     @Deprecated
@@ -627,9 +627,9 @@
     /**
      * Sets whether the WebView should enable support for the &quot;viewport&quot;
      * HTML meta tag or should use a wide viewport.
-     * When the value of the setting is false, the layout width is always set to the
+     * When the value of the setting is {@code false}, the layout width is always set to the
      * width of the WebView control in device-independent (CSS) pixels.
-     * When the value is true and the page contains the viewport meta tag, the value
+     * When the value is {@code true} and the page contains the viewport meta tag, the value
      * of the width specified in the tag is used. If the page does not contain the tag or
      * does not provide a width, then a wide viewport will be used.
      *
@@ -641,7 +641,7 @@
      * Gets whether the WebView supports the &quot;viewport&quot;
      * HTML meta tag or will use a wide viewport.
      *
-     * @return true if the WebView supports the viewport meta tag
+     * @return {@code true} if the WebView supports the viewport meta tag
      * @see #setUseWideViewPort
      */
     public abstract boolean getUseWideViewPort();
@@ -649,7 +649,7 @@
     /**
      * Sets whether the WebView whether supports multiple windows. If set to
      * true, {@link WebChromeClient#onCreateWindow} must be implemented by the
-     * host application. The default is false.
+     * host application. The default is {@code false}.
      *
      * @param support whether to suport multiple windows
      */
@@ -658,7 +658,7 @@
     /**
      * Gets whether the WebView supports multiple windows.
      *
-     * @return true if the WebView supports multiple windows
+     * @return {@code true} if the WebView supports multiple windows
      * @see #setSupportMultipleWindows
      */
     public abstract boolean supportMultipleWindows();
@@ -838,9 +838,9 @@
      * controls loading of all images, including those embedded using the data
      * URI scheme. Use {@link #setBlockNetworkImage} to control loading only
      * of images specified using network URI schemes. Note that if the value of this
-     * setting is changed from false to true, all images resources referenced
+     * setting is changed from {@code false} to {@code true}, all images resources referenced
      * by content currently displayed by the WebView are loaded automatically.
-     * The default is true.
+     * The default is {@code true}.
      *
      * @param flag whether the WebView should load image resources
      */
@@ -850,7 +850,7 @@
      * Gets whether the WebView loads image resources. This includes
      * images embedded using the data URI scheme.
      *
-     * @return true if the WebView loads image resources
+     * @return {@code true} if the WebView loads image resources
      * @see #setLoadsImagesAutomatically
      */
     public abstract boolean getLoadsImagesAutomatically();
@@ -859,12 +859,12 @@
      * Sets whether the WebView should not load image resources from the
      * network (resources accessed via http and https URI schemes).  Note
      * that this method has no effect unless
-     * {@link #getLoadsImagesAutomatically} returns true. Also note that
+     * {@link #getLoadsImagesAutomatically} returns {@code true}. Also note that
      * disabling all network loads using {@link #setBlockNetworkLoads}
      * will also prevent network images from loading, even if this flag is set
-     * to false. When the value of this setting is changed from true to false,
+     * to false. When the value of this setting is changed from {@code true} to {@code false},
      * network images resources referenced by content currently displayed by
-     * the WebView are fetched automatically. The default is false.
+     * the WebView are fetched automatically. The default is {@code false}.
      *
      * @param flag whether the WebView should not load image resources from the
      *             network
@@ -875,7 +875,7 @@
     /**
      * Gets whether the WebView does not load image resources from the network.
      *
-     * @return true if the WebView does not load image resources from the network
+     * @return {@code true} if the WebView does not load image resources from the network
      * @see #setBlockNetworkImage
      */
     public abstract boolean getBlockNetworkImage();
@@ -884,17 +884,17 @@
      * Sets whether the WebView should not load resources from the network.
      * Use {@link #setBlockNetworkImage} to only avoid loading
      * image resources. Note that if the value of this setting is
-     * changed from true to false, network resources referenced by content
+     * changed from {@code true} to {@code false}, network resources referenced by content
      * currently displayed by the WebView are not fetched until
      * {@link android.webkit.WebView#reload} is called.
      * If the application does not have the
      * {@link android.Manifest.permission#INTERNET} permission, attempts to set
-     * a value of false will cause a {@link java.lang.SecurityException}
-     * to be thrown. The default value is false if the application has the
+     * a value of {@code false} will cause a {@link java.lang.SecurityException}
+     * to be thrown. The default value is {@code false} if the application has the
      * {@link android.Manifest.permission#INTERNET} permission, otherwise it is
-     * true.
+     * {@code true}.
      *
-     * @param flag true means block network loads by the WebView
+     * @param flag {@code true} means block network loads by the WebView
      * @see android.webkit.WebView#reload
      */
     public abstract void setBlockNetworkLoads(boolean flag);
@@ -902,16 +902,16 @@
     /**
      * Gets whether the WebView does not load any resources from the network.
      *
-     * @return true if the WebView does not load any resources from the network
+     * @return {@code true} if the WebView does not load any resources from the network
      * @see #setBlockNetworkLoads
      */
     public abstract boolean getBlockNetworkLoads();
 
     /**
      * Tells the WebView to enable JavaScript execution.
-     * <b>The default is false.</b>
+     * <b>The default is {@code false}.</b>
      *
-     * @param flag true if the WebView should execute JavaScript
+     * @param flag {@code true} if the WebView should execute JavaScript
      */
     public abstract void setJavaScriptEnabled(boolean flag);
 
@@ -927,9 +927,9 @@
      * on {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH} and earlier
      * devices, you should explicitly set this value to {@code false}.
      * <p>
-     * The default value is true for API level
+     * The default value is {@code true} for API level
      * {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1} and below,
-     * and false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
+     * and {@code false} for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
      * and above.
      *
      * @param flag whether JavaScript running in the context of a file scheme
@@ -942,16 +942,16 @@
      * should be allowed to access content from other file scheme URLs. To
      * enable the most restrictive, and therefore secure policy, this setting
      * should be disabled. Note that the value of this setting is ignored if
-     * the value of {@link #getAllowUniversalAccessFromFileURLs} is true.
+     * the value of {@link #getAllowUniversalAccessFromFileURLs} is {@code true}.
      * Note too, that this setting affects only JavaScript access to file scheme
      * resources. Other access to such resources, for example, from image HTML
      * elements, is unaffected. To prevent possible violation of same domain policy
      * on {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH} and earlier
      * devices, you should explicitly set this value to {@code false}.
      * <p>
-     * The default value is true for API level
+     * The default value is {@code true} for API level
      * {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1} and below,
-     * and false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
+     * and {@code false} for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
      * and above.
      *
      * @param flag whether JavaScript running in the context of a file scheme
@@ -961,9 +961,9 @@
     public abstract void setAllowFileAccessFromFileURLs(boolean flag);
 
     /**
-     * Sets whether the WebView should enable plugins. The default is false.
+     * Sets whether the WebView should enable plugins. The default is {@code false}.
      *
-     * @param flag true if plugins should be enabled
+     * @param flag {@code true} if plugins should be enabled
      * @deprecated This method has been deprecated in favor of
      *             {@link #setPluginState}
      * @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}
@@ -1028,11 +1028,11 @@
 
     /**
      * Sets whether the Application Caches API should be enabled. The default
-     * is false. Note that in order for the Application Caches API to be
+     * is {@code false}. Note that in order for the Application Caches API to be
      * enabled, a valid database path must also be supplied to
      * {@link #setAppCachePath}.
      *
-     * @param flag true if the WebView should enable Application Caches
+     * @param flag {@code true} if the WebView should enable Application Caches
      */
     public abstract void setAppCacheEnabled(boolean flag);
 
@@ -1072,21 +1072,21 @@
      * page load within a given process, as the WebView implementation may ignore
      * changes to this setting after that point.
      *
-     * @param flag true if the WebView should use the database storage API
+     * @param flag {@code true} if the WebView should use the database storage API
      */
     public abstract void setDatabaseEnabled(boolean flag);
 
     /**
-     * Sets whether the DOM storage API is enabled. The default value is false.
+     * Sets whether the DOM storage API is enabled. The default value is {@code false}.
      *
-     * @param flag true if the WebView should use the DOM storage API
+     * @param flag {@code true} if the WebView should use the DOM storage API
      */
     public abstract void setDomStorageEnabled(boolean flag);
 
     /**
      * Gets whether the DOM Storage APIs are enabled.
      *
-     * @return true if the DOM Storage APIs are enabled
+     * @return {@code true} if the DOM Storage APIs are enabled
      * @see #setDomStorageEnabled
      */
     public abstract boolean getDomStorageEnabled();
@@ -1104,13 +1104,13 @@
     /**
      * Gets whether the database storage API is enabled.
      *
-     * @return true if the database storage API is enabled
+     * @return {@code true} if the database storage API is enabled
      * @see #setDatabaseEnabled
      */
     public abstract boolean getDatabaseEnabled();
 
     /**
-     * Sets whether Geolocation is enabled. The default is true.
+     * Sets whether Geolocation is enabled. The default is {@code true}.
      * <p>
      * Please note that in order for the Geolocation API to be usable
      * by a page in the WebView, the following requirements must be met:
@@ -1132,7 +1132,7 @@
     /**
      * Gets whether JavaScript is enabled.
      *
-     * @return true if JavaScript is enabled
+     * @return {@code true} if JavaScript is enabled
      * @see #setJavaScriptEnabled
      */
     public abstract boolean getJavaScriptEnabled();
@@ -1161,7 +1161,7 @@
     /**
      * Gets whether plugins are enabled.
      *
-     * @return true if plugins are enabled
+     * @return {@code true} if plugins are enabled
      * @see #setPluginsEnabled
      * @deprecated This method has been replaced by {@link #getPluginState}
      * @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}
@@ -1197,16 +1197,16 @@
 
     /**
      * Tells JavaScript to open windows automatically. This applies to the
-     * JavaScript function window.open(). The default is false.
+     * JavaScript function window.open(). The default is {@code false}.
      *
-     * @param flag true if JavaScript can open windows automatically
+     * @param flag {@code true} if JavaScript can open windows automatically
      */
     public abstract void setJavaScriptCanOpenWindowsAutomatically(boolean flag);
 
     /**
      * Gets whether JavaScript can open windows automatically.
      *
-     * @return true if JavaScript can open windows automatically during
+     * @return {@code true} if JavaScript can open windows automatically during
      *         window.open()
      * @see #setJavaScriptCanOpenWindowsAutomatically
      */
@@ -1229,7 +1229,7 @@
     public abstract String getDefaultTextEncodingName();
 
     /**
-     * Sets the WebView's user-agent string. If the string is null or empty,
+     * Sets the WebView's user-agent string. If the string is {@code null} or empty,
      * the system default value will be used.
      *
      * Note that starting from {@link android.os.Build.VERSION_CODES#KITKAT} Android
@@ -1262,7 +1262,7 @@
     /**
      * Tells the WebView whether it needs to set a node to have focus when
      * {@link WebView#requestFocus(int, android.graphics.Rect)} is called. The
-     * default value is true.
+     * default value is {@code true}.
      *
      * @param flag whether the WebView needs to set a node
      */
@@ -1355,7 +1355,7 @@
     /**
      * Gets whether a video overlay will be used for embedded encrypted video.
      *
-     * @return true if WebView uses a video overlay for embedded encrypted video.
+     * @return {@code true} if WebView uses a video overlay for embedded encrypted video.
      * @see #setVideoOverlayForEmbeddedEncryptedVideoEnabled
      * @hide
      */
@@ -1380,7 +1380,7 @@
     /**
      * Gets whether this WebView should raster tiles when it is
      * offscreen but attached to a window.
-     * @return true if this WebView will raster tiles when it is
+     * @return {@code true} if this WebView will raster tiles when it is
      * offscreen but attached to a window.
      */
     public abstract boolean getOffscreenPreRaster();
@@ -1408,7 +1408,7 @@
      * Gets whether Safe browsing is enabled.
      * See {@link #setSafeBrowsingEnabled}.
      *
-     * @return true if Safe browsing is enabled and false otherwise.
+     * @return {@code true} if Safe browsing is enabled and {@code false} otherwise.
      */
     public abstract boolean getSafeBrowsingEnabled();
 
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index f918cad..a930fa8 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -196,7 +196,7 @@
  * </p>
  *
  * <p>By default, requests by the HTML to open new windows are
- * ignored. This is true whether they be opened by JavaScript or by
+ * ignored. This is {@code true} whether they be opened by JavaScript or by
  * the target attribute on a link. You can customize your
  * {@link WebChromeClient} to provide your own behavior for opening multiple windows,
  * and render them in whatever manner you want.</p>
@@ -405,7 +405,7 @@
          *                       may be notified multiple times while the
          *                       operation is underway, and the numberOfMatches
          *                       value should not be considered final unless
-         *                       isDoneCounting is true.
+         *                       isDoneCounting is {@code true}.
          */
         public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches,
             boolean isDoneCounting);
@@ -439,7 +439,7 @@
          * @param view the WebView that owns the picture
          * @param picture the new picture. Applications targeting
          *     {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2} or above
-         *     will always receive a null Picture.
+         *     will always receive a {@code null} Picture.
          * @deprecated Deprecated due to internal changes.
          */
         @Deprecated
@@ -529,7 +529,7 @@
 
         /**
          * Gets additional type-dependant information about the result. See
-         * {@link WebView#getHitTestResult()} for details. May either be null
+         * {@link WebView#getHitTestResult()} for details. May either be {@code null}
          * or contain extra information about this result.
          *
          * @return additional type-dependant information about the result
@@ -664,7 +664,7 @@
      * Specifies whether the horizontal scrollbar has overlay style.
      *
      * @deprecated This method has no effect.
-     * @param overlay true if horizontal scrollbar should have overlay style
+     * @param overlay {@code true} if horizontal scrollbar should have overlay style
      */
     @Deprecated
     public void setHorizontalScrollbarOverlay(boolean overlay) {
@@ -674,7 +674,7 @@
      * Specifies whether the vertical scrollbar has overlay style.
      *
      * @deprecated This method has no effect.
-     * @param overlay true if vertical scrollbar should have overlay style
+     * @param overlay {@code true} if vertical scrollbar should have overlay style
      */
     @Deprecated
     public void setVerticalScrollbarOverlay(boolean overlay) {
@@ -684,7 +684,7 @@
      * Gets whether horizontal scrollbar has overlay style.
      *
      * @deprecated This method is now obsolete.
-     * @return true
+     * @return {@code true}
      */
     @Deprecated
     public boolean overlayHorizontalScrollbar() {
@@ -696,7 +696,7 @@
      * Gets whether vertical scrollbar has overlay style.
      *
      * @deprecated This method is now obsolete.
-     * @return false
+     * @return {@code false}
      */
     @Deprecated
     public boolean overlayVerticalScrollbar() {
@@ -717,7 +717,7 @@
     }
 
     /**
-     * Gets the SSL certificate for the main top-level page or null if there is
+     * Gets the SSL certificate for the main top-level page or {@code null} if there is
      * no certificate (the site is not secure).
      *
      * @return the SSL certificate for the main top-level page
@@ -785,7 +785,7 @@
      * @param host the host to which the credentials apply
      * @param realm the realm to which the credentials apply
      * @return the credentials as a String array, if found. The first element
-     *         is the username and the second element is the password. Null if
+     *         is the username and the second element is the password. {@code null} if
      *         no credentials are found.
      * @deprecated Use {@link WebViewDatabase#getHttpAuthUsernamePassword} instead
      */
@@ -859,7 +859,7 @@
      *
      * @param outState the Bundle to store this WebView's state
      * @return the same copy of the back/forward list used to save the state. If
-     *         saveState fails, the returned list will be null.
+     *         saveState fails, the returned list will be {@code null}.
      */
     public WebBackForwardList saveState(Bundle outState) {
         checkThread();
@@ -872,7 +872,7 @@
      * @param b a Bundle to store the display data
      * @param dest the file to store the serialized picture data. Will be
      *             overwritten with this WebView's picture data.
-     * @return true if the picture was successfully saved
+     * @return {@code true} if the picture was successfully saved
      * @deprecated This method is now obsolete.
      * @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
      */
@@ -889,7 +889,7 @@
      *
      * @param b a Bundle containing the saved display data
      * @param src the file where the picture data was stored
-     * @return true if the picture was successfully restored
+     * @return {@code true} if the picture was successfully restored
      * @deprecated This method is now obsolete.
      * @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
      */
@@ -909,7 +909,7 @@
      * display data for this WebView.
      *
      * @param inState the incoming Bundle of state
-     * @return the restored back/forward list or null if restoreState failed
+     * @return the restored back/forward list or {@code null} if restoreState failed
      */
     public WebBackForwardList restoreState(Bundle inState) {
         checkThread();
@@ -977,7 +977,7 @@
      * The encoding parameter specifies whether the data is base64 or URL
      * encoded. If the data is base64 encoded, the value of the encoding
      * parameter must be 'base64'. For all other values of the parameter,
-     * including null, it is assumed that the data uses ASCII encoding for
+     * including {@code null}, it is assumed that the data uses ASCII encoding for
      * octets inside the range of safe URL characters and use the standard %xx
      * hex encoding of URLs for octets outside that range. For example, '#',
      * '%', '\', '?' should be replaced by %23, %25, %27, %3f respectively.
@@ -1018,13 +1018,13 @@
      * Note that the baseUrl is sent in the 'Referer' HTTP header when
      * requesting subresources (images, etc.) of the page loaded using this method.
      *
-     * @param baseUrl the URL to use as the page's base URL. If null defaults to
+     * @param baseUrl the URL to use as the page's base URL. If {@code null} defaults to
      *                'about:blank'.
      * @param data a String of data in the given encoding
-     * @param mimeType the MIMEType of the data, e.g. 'text/html'. If null,
+     * @param mimeType the MIMEType of the data, e.g. 'text/html'. If {@code null},
      *                 defaults to 'text/html'.
      * @param encoding the encoding of the data
-     * @param historyUrl the URL to use as the history entry. If null defaults
+     * @param historyUrl the URL to use as the history entry. If {@code null} defaults
      *                   to 'about:blank'. If non-null, this must be a valid URL.
      */
     public void loadDataWithBaseURL(String baseUrl, String data,
@@ -1048,7 +1048,7 @@
      * @param script the JavaScript to execute.
      * @param resultCallback A callback to be invoked when the script execution
      *                       completes with the result of the execution (if any).
-     *                       May be null if no notification of the result is required.
+     *                       May be {@code null} if no notification of the result is required.
      */
     public void evaluateJavascript(String script, ValueCallback<String> resultCallback) {
         checkThread();
@@ -1069,12 +1069,12 @@
      * Saves the current view as a web archive.
      *
      * @param basename the filename where the archive should be placed
-     * @param autoname if false, takes basename to be a file. If true, basename
+     * @param autoname if {@code false}, takes basename to be a file. If {@code true}, basename
      *                 is assumed to be a directory in which a filename will be
      *                 chosen according to the URL of the current page.
      * @param callback called after the web archive has been saved. The
      *                 parameter for onReceiveValue will either be the filename
-     *                 under which the file was saved, or null if saving the
+     *                 under which the file was saved, or {@code null} if saving the
      *                 file failed.
      */
     public void saveWebArchive(String basename, boolean autoname, ValueCallback<String> callback) {
@@ -1101,7 +1101,7 @@
     /**
      * Gets whether this WebView has a back history item.
      *
-     * @return true iff this WebView has a back history item
+     * @return {@code true} iff this WebView has a back history item
      */
     public boolean canGoBack() {
         checkThread();
@@ -1119,7 +1119,7 @@
     /**
      * Gets whether this WebView has a forward history item.
      *
-     * @return true iff this WebView has a forward history item
+     * @return {@code true} iff this WebView has a forward history item
      */
     public boolean canGoForward() {
         checkThread();
@@ -1170,8 +1170,8 @@
     /**
      * Scrolls the contents of this WebView up by half the view size.
      *
-     * @param top true to jump to the top of the page
-     * @return true if the page was scrolled
+     * @param top {@code true} to jump to the top of the page
+     * @return {@code true} if the page was scrolled
      */
     public boolean pageUp(boolean top) {
         checkThread();
@@ -1181,8 +1181,8 @@
     /**
      * Scrolls the contents of this WebView down by half the page size.
      *
-     * @param bottom true to jump to bottom of page
-     * @return true if the page was scrolled
+     * @param bottom {@code true} to jump to bottom of page
+     * @return {@code true} if the page was scrolled
      */
     public boolean pageDown(boolean bottom) {
         checkThread();
@@ -1339,7 +1339,7 @@
      * If the content fits into the WebView control by width, then
      * the zoom is set to 100%. For wide content, the behavior
      * depends on the state of {@link WebSettings#getLoadWithOverviewMode()}.
-     * If its value is true, the content will be zoomed out to be fit
+     * If its value is {@code true}, the content will be zoomed out to be fit
      * by width into the WebView control, otherwise not.
      *
      * If initial scale is greater than 0, WebView starts with this value
@@ -1389,7 +1389,7 @@
 
     /**
      * Requests the anchor or image element URL at the last tapped point.
-     * If hrefMsg is null, this method returns immediately and does not
+     * If hrefMsg is {@code null}, this method returns immediately and does not
      * dispatch hrefMsg to its target. If the tapped point hits an image,
      * an anchor, or an image in an anchor, the message associates
      * strings in named keys in its data. The value paired with the key
@@ -1410,7 +1410,7 @@
      * to its target with a String representing the URL as its object.
      *
      * @param msg the message to be dispatched with the result of the request
-     *            as the data member with "url" as key. The result can be null.
+     *            as the data member with "url" as key. The result can be {@code null}.
      */
     public void requestImageRef(Message msg) {
         checkThread();
@@ -1553,7 +1553,7 @@
 
     /**
      * Gets whether this WebView is paused, meaning onPause() was called.
-     * Calling onResume() sets the paused state back to false.
+     * Calling onResume() sets the paused state back to {@code false}.
      *
      * @hide
      */
@@ -1577,7 +1577,7 @@
      * Clears the resource cache. Note that the cache is per-application, so
      * this will clear the cache for all WebViews used.
      *
-     * @param includeDiskFiles if false, only the RAM cache is cleared
+     * @param includeDiskFiles if {@code false}, only the RAM cache is cleared
      */
     public void clearCache(boolean includeDiskFiles) {
         checkThread();
@@ -1620,7 +1620,7 @@
      * shared by all the WebViews that are created by the embedder application.
      *
      * @param onCleared  A runnable to be invoked when client certs are cleared.
-     *                   The embedder can pass null if not interested in the
+     *                   The embedder can pass {@code null} if not interested in the
      *                   callback. The runnable will be called in UI thread.
      */
     public static void clearClientCertPreferences(Runnable onCleared) {
@@ -1665,9 +1665,9 @@
      * All other rules, including wildcards, are invalid.
      *
      * @param urls the list of URLs
-     * @param callback will be called with true if URLs are successfully added to the whitelist.
-     * It will be called with false if any URLs are malformed. The callback will be run on
-     * the UI thread
+     * @param callback will be called with {@code true} if URLs are successfully added to the
+     * whitelist. It will be called with {@code false} if any URLs are malformed. The callback will
+     * be run on the UI thread
      */
     public static void setSafeBrowsingWhitelist(@NonNull List<String> urls,
             @Nullable ValueCallback<Boolean> callback) {
@@ -1761,9 +1761,9 @@
      * @param text if non-null, will be the initial text to search for.
      *             Otherwise, the last String searched for in this WebView will
      *             be used to start.
-     * @param showIme if true, show the IME, assuming the user will begin typing.
-     *                If false and text is non-null, perform a find all.
-     * @return true if the find dialog is shown, false otherwise
+     * @param showIme if {@code true}, show the IME, assuming the user will begin typing.
+     *                If {@code false} and text is non-null, perform a find all.
+     * @return {@code true} if the find dialog is shown, {@code false} otherwise
      * @deprecated This method does not work reliably on all Android versions;
      *             implementing a custom find dialog using WebView.findAllAsync()
      *             provides a more robust solution.
@@ -1794,7 +1794,7 @@
      * five digits.
      *
      * @param addr the string to search for addresses
-     * @return the address, or if no address is found, null
+     * @return the address, or if no address is found, {@code null}
      */
     public static String findAddress(String addr) {
         // TODO: Rewrite this in Java so it is not needed to start up chromium
@@ -1893,7 +1893,7 @@
     /**
      * Gets the chrome handler.
      *
-     * @return the WebChromeClient, or null if not yet set
+     * @return the WebChromeClient, or {@code null} if not yet set
      * @see #setWebChromeClient
      */
     public WebChromeClient getWebChromeClient() {
@@ -1963,7 +1963,7 @@
      * </ul>
      *
      * @param object the Java object to inject into this WebView's JavaScript
-     *               context. Null values are ignored.
+     *               context. {@code null} values are ignored.
      * @param name the name used to expose the object in JavaScript
      */
     public void addJavascriptInterface(Object object, String name) {
@@ -2035,7 +2035,7 @@
      * code running inside WebViews. Please refer to WebView documentation
      * for the debugging guide.
      *
-     * The default is false.
+     * The default is {@code false}.
      *
      * @param enabled whether to enable web contents debugging
      */
@@ -2105,7 +2105,7 @@
     }
 
     /**
-     * @deprecated Only the default case, true, will be supported in a future version.
+     * @deprecated Only the default case, {@code true}, will be supported in a future version.
      */
     @Deprecated
     public void setMapTrackballToArrowKeys(boolean setMap) {
@@ -2140,7 +2140,7 @@
     /**
      * Gets whether this WebView can be zoomed in.
      *
-     * @return true if this WebView can be zoomed in
+     * @return {@code true} if this WebView can be zoomed in
      *
      * @deprecated This method is prone to inaccuracy due to race conditions
      * between the web rendering and UI threads; prefer
@@ -2155,7 +2155,7 @@
     /**
      * Gets whether this WebView can be zoomed out.
      *
-     * @return true if this WebView can be zoomed out
+     * @return {@code true} if this WebView can be zoomed out
      *
      * @deprecated This method is prone to inaccuracy due to race conditions
      * between the web rendering and UI threads; prefer
@@ -2185,7 +2185,7 @@
     /**
      * Performs zoom in in this WebView.
      *
-     * @return true if zoom in succeeds, false if no zoom changes
+     * @return {@code true} if zoom in succeeds, {@code false} if no zoom changes
      */
     public boolean zoomIn() {
         checkThread();
@@ -2195,7 +2195,7 @@
     /**
      * Performs zoom out in this WebView.
      *
-     * @return true if zoom out succeeds, false if no zoom changes
+     * @return {@code true} if zoom out succeeds, {@code false} if no zoom changes
      */
     public boolean zoomOut() {
         checkThread();
@@ -2286,7 +2286,7 @@
      *
      * @param rendererRequestedPriority the minimum priority at which
      *        this WebView desires the renderer process to be bound.
-     * @param waivedWhenNotVisible if true, this flag specifies that
+     * @param waivedWhenNotVisible if {@code true}, this flag specifies that
      *        when this WebView is not visible, it will be treated as
      *        if it had requested a priority of
      *        {@link #RENDERER_PRIORITY_WAIVED}.
@@ -2988,7 +2988,7 @@
      * uninstalled. It can also be changed through a Developer Setting.
      * If the WebView package changes, any app process that has loaded WebView will be killed. The
      * next time the app starts and loads WebView it will use the new WebView package instead.
-     * @return the current WebView package, or null if there is none.
+     * @return the current WebView package, or {@code null} if there is none.
      */
     public static PackageInfo getCurrentWebViewPackage() {
         PackageInfo webviewPackage = WebViewFactory.getLoadedPackageInfo();
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index e7e539c..b750ada 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -33,15 +33,15 @@
      * Give the host application a chance to take over the control when a new
      * url is about to be loaded in the current WebView. If WebViewClient is not
      * provided, by default WebView will ask Activity Manager to choose the
-     * proper handler for the url. If WebViewClient is provided, return true
-     * means the host application handles the url, while return false means the
+     * proper handler for the url. If WebViewClient is provided, return {@code true}
+     * means the host application handles the url, while return {@code false} means the
      * current WebView handles the url.
      * This method is not called for requests using the POST "method".
      *
      * @param view The WebView that is initiating the callback.
      * @param url The url to be loaded.
-     * @return True if the host application wants to leave the current WebView
-     *         and handle the url itself, otherwise return false.
+     * @return {@code true} if the host application wants to leave the current WebView
+     *         and handle the url itself, otherwise return {@code false}.
      * @deprecated Use {@link #shouldOverrideUrlLoading(WebView, WebResourceRequest)
      *             shouldOverrideUrlLoading(WebView, WebResourceRequest)} instead.
      */
@@ -54,8 +54,8 @@
      * Give the host application a chance to take over the control when a new
      * url is about to be loaded in the current WebView. If WebViewClient is not
      * provided, by default WebView will ask Activity Manager to choose the
-     * proper handler for the url. If WebViewClient is provided, return true
-     * means the host application handles the url, while return false means the
+     * proper handler for the url. If WebViewClient is provided, return {@code true}
+     * means the host application handles the url, while return {@code false} means the
      * current WebView handles the url.
      *
      * <p>Notes:
@@ -63,15 +63,15 @@
      * <li>This method is not called for requests using the POST &quot;method&quot;.</li>
      * <li>This method is also called for subframes with non-http schemes, thus it is
      * strongly disadvised to unconditionally call {@link WebView#loadUrl(String)}
-     * with the request's url from inside the method and then return true,
+     * with the request's url from inside the method and then return {@code true},
      * as this will make WebView to attempt loading a non-http url, and thus fail.</li>
      * </ul>
      * </p>
      *
      * @param view The WebView that is initiating the callback.
      * @param request Object containing the details of the request.
-     * @return True if the host application wants to leave the current WebView
-     *         and handle the url itself, otherwise return false.
+     * @return {@code true} if the host application wants to leave the current WebView
+     *         and handle the url itself, otherwise return {@code false}.
      */
     public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
         return shouldOverrideUrlLoading(view, request.getUrl().toString());
@@ -148,7 +148,7 @@
 
     /**
      * Notify the host application of a resource request and allow the
-     * application to return the data.  If the return value is null, the WebView
+     * application to return the data.  If the return value is {@code null}, the WebView
      * will continue to load the resource as usual.  Otherwise, the return
      * response and data will be used.  NOTE: This method is called on a thread
      * other than the UI thread so clients should exercise caution
@@ -158,7 +158,7 @@
      *             resource.
      * @param url The raw url of the resource.
      * @return A {@link android.webkit.WebResourceResponse} containing the
-     *         response information or null if the WebView should load the
+     *         response information or {@code null} if the WebView should load the
      *         resource itself.
      * @deprecated Use {@link #shouldInterceptRequest(WebView, WebResourceRequest)
      *             shouldInterceptRequest(WebView, WebResourceRequest)} instead.
@@ -171,7 +171,7 @@
 
     /**
      * Notify the host application of a resource request and allow the
-     * application to return the data.  If the return value is null, the WebView
+     * application to return the data.  If the return value is {@code null}, the WebView
      * will continue to load the resource as usual.  Otherwise, the return
      * response and data will be used.  NOTE: This method is called on a thread
      * other than the UI thread so clients should exercise caution
@@ -181,7 +181,7 @@
      *             resource.
      * @param request Object containing the details of the request.
      * @return A {@link android.webkit.WebResourceResponse} containing the
-     *         response information or null if the WebView should load the
+     *         response information or {@code null} if the WebView should load the
      *         resource itself.
      */
     public WebResourceResponse shouldInterceptRequest(WebView view,
@@ -326,7 +326,7 @@
      *
      * @param view The WebView that is initiating the callback.
      * @param url The url being visited.
-     * @param isReload True if this url is being reloaded.
+     * @param isReload {@code true} if this url is being reloaded.
      */
     public void doUpdateVisitedHistory(WebView view, String url,
             boolean isReload) {
@@ -406,14 +406,14 @@
     /**
      * Give the host application a chance to handle the key event synchronously.
      * e.g. menu shortcut key events need to be filtered this way. If return
-     * true, WebView will not handle the key event. If return false, WebView
+     * true, WebView will not handle the key event. If return {@code false}, WebView
      * will always handle the key event, so none of the super in the view chain
-     * will see the key event. The default behavior returns false.
+     * will see the key event. The default behavior returns {@code false}.
      *
      * @param view The WebView that is initiating the callback.
      * @param event The key event.
-     * @return True if the host application wants to handle the key event
-     *         itself, otherwise return false
+     * @return {@code true} if the host application wants to handle the key event
+     *         itself, otherwise return {@code false}
      */
     public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
         return false;
@@ -422,7 +422,7 @@
     /**
      * Notify the host application that a key was not handled by the WebView.
      * Except system keys, WebView always consumes the keys in the normal flow
-     * or if shouldOverrideKeyEvent returns true. This is called asynchronously
+     * or if shouldOverrideKeyEvent returns {@code true}. This is called asynchronously
      * from where the key is dispatched. It gives the host application a chance
      * to handle the unhandled key events.
      *
@@ -436,7 +436,7 @@
     /**
      * Notify the host application that a input event was not handled by the WebView.
      * Except system keys, WebView always consumes input events in the normal flow
-     * or if shouldOverrideKeyEvent returns true. This is called asynchronously
+     * or if shouldOverrideKeyEvent returns {@code true}. This is called asynchronously
      * from where the event is dispatched. It gives the host application a chance
      * to handle the unhandled input events.
      *
@@ -483,7 +483,7 @@
      * user has been processed.
      * @param view The WebView requesting the login.
      * @param realm The account realm used to look up accounts.
-     * @param account An optional account. If not null, the account should be
+     * @param account An optional account. If not {@code null}, the account should be
      *                checked against accounts on the device. If it is a valid
      *                account, it should be used to log in the user.
      * @param args Authenticator specific arguments used to log in the user.
@@ -512,7 +512,7 @@
      *
      * @param view The WebView which needs to be cleaned up.
      * @param detail the reason why it exited.
-     * @return true if the host application handled the situation that process has
+     * @return {@code true} if the host application handled the situation that process has
      *         exited, otherwise, application will crash if render process crashed,
      *         or be killed if render process was killed by the system.
      */
diff --git a/core/java/android/webkit/WebViewDatabase.java b/core/java/android/webkit/WebViewDatabase.java
index 982c57b..de75d5d0 100644
--- a/core/java/android/webkit/WebViewDatabase.java
+++ b/core/java/android/webkit/WebViewDatabase.java
@@ -42,7 +42,7 @@
      * Gets whether there are any saved username/password pairs for web forms.
      * Note that these are unrelated to HTTP authentication credentials.
      *
-     * @return true if there are any saved username/password pairs
+     * @return {@code true} if there are any saved username/password pairs
      * @see WebView#savePassword
      * @see #clearUsernamePassword
      * @deprecated Saving passwords in WebView will not be supported in future versions.
@@ -129,7 +129,7 @@
      * @param host the host to which the credentials apply
      * @param realm the realm to which the credentials apply
      * @return the credentials as a String array, if found. The first element
-     *         is the username and the second element is the password. Null if
+     *         is the username and the second element is the password. {@code null} if
      *         no credentials are found.
      * @see #setHttpAuthUsernamePassword
      * @see #hasHttpAuthUsernamePassword
diff --git a/core/java/android/webkit/WebViewDelegate.java b/core/java/android/webkit/WebViewDelegate.java
index 92d0d71..7339931 100644
--- a/core/java/android/webkit/WebViewDelegate.java
+++ b/core/java/android/webkit/WebViewDelegate.java
@@ -68,22 +68,22 @@
     }
 
     /**
-     * Returns true if the WebView trace tag is enabled and false otherwise.
+     * Returns {@code true} if the WebView trace tag is enabled and {@code false} otherwise.
      */
     public boolean isTraceTagEnabled() {
         return Trace.isTagEnabled(Trace.TRACE_TAG_WEBVIEW);
     }
 
     /**
-     * Returns true if the draw GL functor can be invoked (see {@link #invokeDrawGlFunctor})
-     * and false otherwise.
+     * Returns {@code true} if the draw GL functor can be invoked (see {@link #invokeDrawGlFunctor})
+     * and {@code false} otherwise.
      */
     public boolean canInvokeDrawGlFunctor(View containerView) {
         return true;
     }
 
     /**
-     * Invokes the draw GL functor. If waitForCompletion is false the functor
+     * Invokes the draw GL functor. If waitForCompletion is {@code false} the functor
      * may be invoked asynchronously.
      *
      * @param nativeDrawGLFunctor the pointer to the native functor that implements
diff --git a/core/java/android/webkit/WebViewFactory.java b/core/java/android/webkit/WebViewFactory.java
index 668cfba..7c4154f 100644
--- a/core/java/android/webkit/WebViewFactory.java
+++ b/core/java/android/webkit/WebViewFactory.java
@@ -222,7 +222,7 @@
     }
 
     /**
-     * Returns true if the signatures match, false otherwise
+     * Returns {@code true} if the signatures match, {@code false} otherwise
      */
     private static boolean signaturesEquals(Signature[] s1, Signature[] s2) {
         if (s1 == null) {
diff --git a/core/java/android/webkit/WebViewProvider.java b/core/java/android/webkit/WebViewProvider.java
index 820b49a..c46c681 100644
--- a/core/java/android/webkit/WebViewProvider.java
+++ b/core/java/android/webkit/WebViewProvider.java
@@ -19,16 +19,16 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.SystemApi;
-import android.content.res.Configuration;
 import android.content.Intent;
+import android.content.res.Configuration;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.graphics.Picture;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
-import android.net.http.SslCertificate;
 import android.net.Uri;
+import android.net.http.SslCertificate;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
@@ -73,7 +73,8 @@
      * Initialize this WebViewProvider instance. Called after the WebView has fully constructed.
      * @param javaScriptInterfaces is a Map of interface names, as keys, and
      * object implementing those interfaces, as values.
-     * @param privateBrowsing If true the web view will be initialized in private / incognito mode.
+     * @param privateBrowsing If {@code true} the web view will be initialized in private /
+     * incognito mode.
      */
     public void init(Map<String, Object> javaScriptInterfaces,
             boolean privateBrowsing);
diff --git a/core/java/android/webkit/WebViewZygote.java b/core/java/android/webkit/WebViewZygote.java
index 0204dff..6e65c7a 100644
--- a/core/java/android/webkit/WebViewZygote.java
+++ b/core/java/android/webkit/WebViewZygote.java
@@ -28,7 +28,6 @@
 import com.android.internal.annotations.GuardedBy;
 
 import java.io.File;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -48,8 +47,8 @@
     private static final Object sLock = new Object();
 
     /**
-     * Instance that maintains the socket connection to the zygote. This is null if the zygote
-     * is not running or is not connected.
+     * Instance that maintains the socket connection to the zygote. This is {@code null} if the
+     * zygote is not running or is not connected.
      */
     @GuardedBy("sLock")
     private static ZygoteProcess sZygote;
@@ -75,7 +74,7 @@
     private static String sPackageCacheKey;
 
     /**
-     * Flag for whether multi-process WebView is enabled. If this is false, the zygote
+     * Flag for whether multi-process WebView is enabled. If this is {@code false}, the zygote
      * will not be started.
      */
     @GuardedBy("sLock")
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 8a374406..d23dfe4 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -1262,7 +1262,8 @@
         }
     }
 
-    void sendOnTextChanged(int start, int after) {
+    void sendOnTextChanged(int start, int before, int after) {
+        getSelectionActionModeHelper().onTextChanged(start, start + before);
         updateSpellCheckSpans(start, start + after, false);
 
         // Flip flag to indicate the word iterator needs to have the text reset.
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 46742b8..bc85fad 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -144,11 +144,6 @@
     private ArrayList<Action> mActions;
 
     /**
-     * A class to keep track of memory usage by this RemoteViews
-     */
-    private MemoryUsageCounter mMemoryUsageCounter;
-
-    /**
      * Maps bitmaps to unique indicies to avoid Bitmap duplication.
      */
     private BitmapCache mBitmapCache;
@@ -294,7 +289,6 @@
         public String asyncMethodName;
     }
 
-
     /**
      * This annotation indicates that a subclass of View is allowed to be used
      * with the {@link RemoteViews} mechanism.
@@ -386,14 +380,6 @@
             return 0;
         }
 
-        /**
-         * Overridden by each class to report on it's own memory usage
-         */
-        public void updateMemoryUsageEstimate(MemoryUsageCounter counter) {
-            // We currently only calculate Bitmap memory usage, so by default,
-            // don't do anything here
-        }
-
         public void setBitmapCache(BitmapCache bitmapCache) {
             // Do nothing
         }
@@ -466,7 +452,7 @@
         // We first copy the new RemoteViews, as the process of merging modifies the way the actions
         // reference the bitmap cache. We don't want to modify the object as it may need to
         // be merged and applied multiple times.
-        RemoteViews copy = newRv.clone();
+        RemoteViews copy = new RemoteViews(newRv);
 
         HashMap<String, Action> map = new HashMap<String, Action>();
         if (mActions == null) {
@@ -500,7 +486,6 @@
         // Because pruning can remove the need for bitmaps, we reconstruct the bitmap cache
         mBitmapCache = new BitmapCache();
         setBitmapCache(mBitmapCache);
-        recalculateMemoryUsage();
     }
 
     private static class RemoteViewsContextWrapper extends ContextWrapper {
@@ -1162,15 +1147,17 @@
     }
 
     private static class BitmapCache {
+
         ArrayList<Bitmap> mBitmaps;
+        int mBitmapMemory = -1;
 
         public BitmapCache() {
-            mBitmaps = new ArrayList<Bitmap>();
+            mBitmaps = new ArrayList<>();
         }
 
         public BitmapCache(Parcel source) {
             int count = source.readInt();
-            mBitmaps = new ArrayList<Bitmap>();
+            mBitmaps = new ArrayList<>(count);
             for (int i = 0; i < count; i++) {
                 Bitmap b = Bitmap.CREATOR.createFromParcel(source);
                 mBitmaps.add(b);
@@ -1185,6 +1172,7 @@
                     return mBitmaps.indexOf(b);
                 } else {
                     mBitmaps.add(b);
+                    mBitmapMemory = -1;
                     return (mBitmaps.size() - 1);
                 }
             }
@@ -1206,28 +1194,15 @@
             }
         }
 
-        public void assimilate(BitmapCache bitmapCache) {
-            ArrayList<Bitmap> bitmapsToBeAdded = bitmapCache.mBitmaps;
-            int count = bitmapsToBeAdded.size();
-            for (int i = 0; i < count; i++) {
-                Bitmap b = bitmapsToBeAdded.get(i);
-                if (!mBitmaps.contains(b)) {
-                    mBitmaps.add(b);
+        public int getBitmapMemory() {
+            if (mBitmapMemory < 0) {
+                mBitmapMemory = 0;
+                int count = mBitmaps.size();
+                for (int i = 0; i < count; i++) {
+                    mBitmapMemory += mBitmaps.get(i).getAllocationByteCount();
                 }
             }
-        }
-
-        public void addBitmapMemory(MemoryUsageCounter memoryCounter) {
-            for (int i = 0; i < mBitmaps.size(); i++) {
-                memoryCounter.addBitmapMemory(mBitmaps.get(i));
-            }
-        }
-
-        @Override
-        protected BitmapCache clone() {
-            BitmapCache bitmapCache = new BitmapCache();
-            bitmapCache.mBitmaps.addAll(mBitmaps);
-            return bitmapCache;
+            return mBitmapMemory;
         }
     }
 
@@ -1429,37 +1404,17 @@
                 case CHAR_SEQUENCE:
                     TextUtils.writeToParcel((CharSequence)this.value, out, flags);
                     break;
-                case URI:
-                    out.writeInt(this.value != null ? 1 : 0);
-                    if (this.value != null) {
-                        ((Uri)this.value).writeToParcel(out, flags);
-                    }
-                    break;
-                case BITMAP:
-                    out.writeInt(this.value != null ? 1 : 0);
-                    if (this.value != null) {
-                        ((Bitmap)this.value).writeToParcel(out, flags);
-                    }
-                    break;
                 case BUNDLE:
                     out.writeBundle((Bundle) this.value);
                     break;
+                case URI:
+                case BITMAP:
                 case INTENT:
-                    out.writeInt(this.value != null ? 1 : 0);
-                    if (this.value != null) {
-                        ((Intent)this.value).writeToParcel(out, flags);
-                    }
-                    break;
                 case COLOR_STATE_LIST:
-                    out.writeInt(this.value != null ? 1 : 0);
-                    if (this.value != null) {
-                        ((ColorStateList)this.value).writeToParcel(out, flags);
-                    }
-                    break;
                 case ICON:
                     out.writeInt(this.value != null ? 1 : 0);
                     if (this.value != null) {
-                        ((Icon)this.value).writeToParcel(out, flags);
+                        ((Parcelable) this.value).writeToParcel(out, flags);
                     }
                     break;
                 default:
@@ -1595,7 +1550,6 @@
     }
 
     private void configureRemoteViewsAsChild(RemoteViews rv) {
-        mBitmapCache.assimilate(rv.mBitmapCache);
         rv.setBitmapCache(mBitmapCache);
         rv.setNotRoot();
     }
@@ -1693,11 +1647,6 @@
         }
 
         @Override
-        public void updateMemoryUsageEstimate(MemoryUsageCounter counter) {
-            counter.increment(mNestedViews.estimateMemoryUsage());
-        }
-
-        @Override
         public void setBitmapCache(BitmapCache bitmapCache) {
             mNestedViews.setBitmapCache(bitmapCache);
         }
@@ -2302,30 +2251,6 @@
     }
 
     /**
-     * Simple class used to keep track of memory usage in a RemoteViews.
-     *
-     */
-    private class MemoryUsageCounter {
-        public void clear() {
-            mMemoryUsage = 0;
-        }
-
-        public void increment(int numBytes) {
-            mMemoryUsage += numBytes;
-        }
-
-        public int getMemoryUsage() {
-            return mMemoryUsage;
-        }
-
-        public void addBitmapMemory(Bitmap b) {
-            increment(b.getAllocationByteCount());
-        }
-
-        int mMemoryUsage;
-    }
-
-    /**
      * Create a new RemoteViews object that will display the views contained
      * in the specified layout file.
      *
@@ -2363,9 +2288,6 @@
         mApplication = application;
         mLayoutId = layoutId;
         mBitmapCache = new BitmapCache();
-        // setup the memory usage statistics
-        mMemoryUsageCounter = new MemoryUsageCounter();
-        recalculateMemoryUsage();
     }
 
     private boolean hasLandscapeAndPortraitLayouts() {
@@ -2393,14 +2315,49 @@
         mLandscape = landscape;
         mPortrait = portrait;
 
-        // setup the memory usage statistics
-        mMemoryUsageCounter = new MemoryUsageCounter();
-
         mBitmapCache = new BitmapCache();
         configureRemoteViewsAsChild(landscape);
         configureRemoteViewsAsChild(portrait);
+    }
 
-        recalculateMemoryUsage();
+    /**
+     * Creates a copy of another RemoteViews.
+     */
+    public RemoteViews(RemoteViews src) {
+        mBitmapCache = src.mBitmapCache;
+        mApplication = src.mApplication;
+        mIsRoot = src.mIsRoot;
+        mLayoutId = src.mLayoutId;
+        mIsWidgetCollectionChild = src.mIsWidgetCollectionChild;
+        mReapplyDisallowed = src.mReapplyDisallowed;
+
+        if (src.hasLandscapeAndPortraitLayouts()) {
+            mLandscape = new RemoteViews(src.mLandscape);
+            mPortrait = new RemoteViews(src.mPortrait);
+
+        }
+
+        if (src.mActions != null) {
+            mActions = new ArrayList<>();
+
+            Parcel p = Parcel.obtain();
+            int count = src.mActions.size();
+            for (int i = 0; i < count; i++) {
+                p.setDataPosition(0);
+                Action a = src.mActions.get(i);
+                a.writeToParcel(
+                        p, a.hasSameAppInfo(mApplication) ? PARCELABLE_ELIDE_DUPLICATES : 0);
+                p.setDataPosition(0);
+                // Since src is already in memory, we do not care about stack overflow as it has
+                // already been read once.
+                mActions.add(getActionFromParcel(p, 0));
+            }
+            p.recycle();
+        }
+
+        // Now that everything is initialized and duplicated, setting a new BitmapCache will
+        // re-initialize the cache.
+        setBitmapCache(new BitmapCache());
     }
 
     /**
@@ -2437,71 +2394,9 @@
 
             int count = parcel.readInt();
             if (count > 0) {
-                mActions = new ArrayList<Action>(count);
-                for (int i=0; i<count; i++) {
-                    int tag = parcel.readInt();
-                    switch (tag) {
-                        case SET_ON_CLICK_PENDING_INTENT_TAG:
-                            mActions.add(new SetOnClickPendingIntent(parcel));
-                            break;
-                        case SET_DRAWABLE_PARAMETERS_TAG:
-                            mActions.add(new SetDrawableParameters(parcel));
-                            break;
-                        case REFLECTION_ACTION_TAG:
-                            mActions.add(new ReflectionAction(parcel));
-                            break;
-                        case VIEW_GROUP_ACTION_ADD_TAG:
-                            mActions.add(new ViewGroupActionAdd(parcel, mBitmapCache, mApplication,
-                                    depth));
-                            break;
-                        case VIEW_GROUP_ACTION_REMOVE_TAG:
-                            mActions.add(new ViewGroupActionRemove(parcel));
-                            break;
-                        case SET_REFLECTION_ACTION_WITHOUT_PARAMS_TAG:
-                            mActions.add(new ReflectionActionWithoutParams(parcel));
-                            break;
-                        case SET_EMPTY_VIEW_ACTION_TAG:
-                            mActions.add(new SetEmptyView(parcel));
-                            break;
-                        case SET_PENDING_INTENT_TEMPLATE_TAG:
-                            mActions.add(new SetPendingIntentTemplate(parcel));
-                            break;
-                        case SET_ON_CLICK_FILL_IN_INTENT_TAG:
-                            mActions.add(new SetOnClickFillInIntent(parcel));
-                            break;
-                        case SET_REMOTE_VIEW_ADAPTER_INTENT_TAG:
-                            mActions.add(new SetRemoteViewsAdapterIntent(parcel));
-                            break;
-                        case TEXT_VIEW_DRAWABLE_ACTION_TAG:
-                            mActions.add(new TextViewDrawableAction(parcel));
-                            break;
-                        case TEXT_VIEW_SIZE_ACTION_TAG:
-                            mActions.add(new TextViewSizeAction(parcel));
-                            break;
-                        case VIEW_PADDING_ACTION_TAG:
-                            mActions.add(new ViewPaddingAction(parcel));
-                            break;
-                        case BITMAP_REFLECTION_ACTION_TAG:
-                            mActions.add(new BitmapReflectionAction(parcel));
-                            break;
-                        case SET_REMOTE_VIEW_ADAPTER_LIST_TAG:
-                            mActions.add(new SetRemoteViewsAdapterList(parcel));
-                            break;
-                        case TEXT_VIEW_DRAWABLE_COLOR_FILTER_ACTION_TAG:
-                            mActions.add(new TextViewDrawableColorFilterAction(parcel));
-                            break;
-                        case SET_REMOTE_INPUTS_ACTION_TAG:
-                            mActions.add(new SetRemoteInputsAction(parcel));
-                            break;
-                        case LAYOUT_PARAM_ACTION_TAG:
-                            mActions.add(new LayoutParamAction(parcel));
-                            break;
-                        case OVERRIDE_TEXT_COLORS_TAG:
-                            mActions.add(new OverrideTextColorsAction(parcel));
-                            break;
-                        default:
-                            throw new ActionException("Tag " + tag + " not found");
-                    }
+                mActions = new ArrayList<>(count);
+                for (int i = 0; i < count; i++) {
+                    mActions.add(getActionFromParcel(parcel, depth));
                 }
             }
         } else {
@@ -2512,40 +2407,69 @@
             mLayoutId = mPortrait.getLayoutId();
         }
         mReapplyDisallowed = parcel.readInt() == 0;
-
-        // setup the memory usage statistics
-        mMemoryUsageCounter = new MemoryUsageCounter();
-        recalculateMemoryUsage();
     }
 
+    private Action getActionFromParcel(Parcel parcel, int depth) {
+        int tag = parcel.readInt();
+        switch (tag) {
+            case SET_ON_CLICK_PENDING_INTENT_TAG:
+                return new SetOnClickPendingIntent(parcel);
+            case SET_DRAWABLE_PARAMETERS_TAG:
+                return new SetDrawableParameters(parcel);
+            case REFLECTION_ACTION_TAG:
+                return new ReflectionAction(parcel);
+            case VIEW_GROUP_ACTION_ADD_TAG:
+                return new ViewGroupActionAdd(parcel, mBitmapCache, mApplication, depth);
+            case VIEW_GROUP_ACTION_REMOVE_TAG:
+                return new ViewGroupActionRemove(parcel);
+            case SET_REFLECTION_ACTION_WITHOUT_PARAMS_TAG:
+                return new ReflectionActionWithoutParams(parcel);
+            case SET_EMPTY_VIEW_ACTION_TAG:
+                return new SetEmptyView(parcel);
+            case SET_PENDING_INTENT_TEMPLATE_TAG:
+                return new SetPendingIntentTemplate(parcel);
+            case SET_ON_CLICK_FILL_IN_INTENT_TAG:
+                return new SetOnClickFillInIntent(parcel);
+            case SET_REMOTE_VIEW_ADAPTER_INTENT_TAG:
+                return new SetRemoteViewsAdapterIntent(parcel);
+            case TEXT_VIEW_DRAWABLE_ACTION_TAG:
+                return new TextViewDrawableAction(parcel);
+            case TEXT_VIEW_SIZE_ACTION_TAG:
+                return new TextViewSizeAction(parcel);
+            case VIEW_PADDING_ACTION_TAG:
+                return new ViewPaddingAction(parcel);
+            case BITMAP_REFLECTION_ACTION_TAG:
+                return new BitmapReflectionAction(parcel);
+            case SET_REMOTE_VIEW_ADAPTER_LIST_TAG:
+                return new SetRemoteViewsAdapterList(parcel);
+            case TEXT_VIEW_DRAWABLE_COLOR_FILTER_ACTION_TAG:
+                return new TextViewDrawableColorFilterAction(parcel);
+            case SET_REMOTE_INPUTS_ACTION_TAG:
+                return new SetRemoteInputsAction(parcel);
+            case LAYOUT_PARAM_ACTION_TAG:
+                return new LayoutParamAction(parcel);
+            case OVERRIDE_TEXT_COLORS_TAG:
+                return new OverrideTextColorsAction(parcel);
+            default:
+                throw new ActionException("Tag " + tag + " not found");
+        }
+    };
+
     /**
      * Returns a deep copy of the RemoteViews object. The RemoteView may not be
      * attached to another RemoteView -- it must be the root of a hierarchy.
      *
+     * @deprecated use {@link #RemoteViews(RemoteViews)} instead.
      * @throws IllegalStateException if this is not the root of a RemoteView
      *         hierarchy
      */
     @Override
+    @Deprecated
     public RemoteViews clone() {
-        synchronized (this) {
-            Preconditions.checkState(mIsRoot, "RemoteView has been attached to another RemoteView. "
-                    + "May only clone the root of a RemoteView hierarchy.");
+        Preconditions.checkState(mIsRoot, "RemoteView has been attached to another RemoteView. "
+                + "May only clone the root of a RemoteView hierarchy.");
 
-            Parcel p = Parcel.obtain();
-
-            // Do not parcel the Bitmap cache - doing so creates an expensive copy of all bitmaps.
-            // Instead pretend we're not owning the cache while parceling.
-            mIsRoot = false;
-            writeToParcel(p, PARCELABLE_ELIDE_DUPLICATES);
-            p.setDataPosition(0);
-            mIsRoot = true;
-
-            RemoteViews rv = new RemoteViews(p, mBitmapCache.clone(), mApplication, 0);
-            rv.mIsRoot = true;
-
-            p.recycle();
-            return rv;
-        }
+        return new RemoteViews(this);
     }
 
     public String getPackage() {
@@ -2575,30 +2499,6 @@
     }
 
     /**
-     * Updates the memory usage statistics.
-     */
-    private void recalculateMemoryUsage() {
-        mMemoryUsageCounter.clear();
-
-        if (!hasLandscapeAndPortraitLayouts()) {
-            // Accumulate the memory usage for each action
-            if (mActions != null) {
-                final int count = mActions.size();
-                for (int i= 0; i < count; ++i) {
-                    mActions.get(i).updateMemoryUsageEstimate(mMemoryUsageCounter);
-                }
-            }
-            if (mIsRoot) {
-                mBitmapCache.addBitmapMemory(mMemoryUsageCounter);
-            }
-        } else {
-            mMemoryUsageCounter.increment(mLandscape.estimateMemoryUsage());
-            mMemoryUsageCounter.increment(mPortrait.estimateMemoryUsage());
-            mBitmapCache.addBitmapMemory(mMemoryUsageCounter);
-        }
-    }
-
-    /**
      * Recursively sets BitmapCache in the hierarchy and update the bitmap ids.
      */
     private void setBitmapCache(BitmapCache bitmapCache) {
@@ -2621,7 +2521,7 @@
      */
     /** @hide */
     public int estimateMemoryUsage() {
-        return mMemoryUsageCounter.getMemoryUsage();
+        return mBitmapCache.getBitmapMemory();
     }
 
     /**
@@ -2636,12 +2536,9 @@
                     " portrait layouts individually before constructing the combined layout.");
         }
         if (mActions == null) {
-            mActions = new ArrayList<Action>();
+            mActions = new ArrayList<>();
         }
         mActions.add(a);
-
-        // update the memory usage stats
-        a.updateMemoryUsageEstimate(mMemoryUsageCounter);
     }
 
     /**
diff --git a/core/java/android/widget/SelectionActionModeHelper.java b/core/java/android/widget/SelectionActionModeHelper.java
index 57a3468..36dc330 100644
--- a/core/java/android/widget/SelectionActionModeHelper.java
+++ b/core/java/android/widget/SelectionActionModeHelper.java
@@ -20,7 +20,6 @@
 import android.annotation.Nullable;
 import android.annotation.UiThread;
 import android.annotation.WorkerThread;
-import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.PointF;
 import android.graphics.RectF;
@@ -48,6 +47,7 @@
 import java.util.Objects;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
+import java.util.regex.Pattern;
 
 /**
  * Helper class for starting selection action mode
@@ -56,7 +56,7 @@
  */
 @UiThread
 @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
-final class SelectionActionModeHelper {
+public final class SelectionActionModeHelper {
 
     /**
      * Maximum time (in milliseconds) to wait for a result before timing out.
@@ -85,8 +85,7 @@
         mTextClassificationHelper = new TextClassificationHelper(
                 mTextView.getTextClassifier(), mTextView.getText(),
                 0, 1, mTextView.getTextLocales());
-        mSelectionTracker =
-                new SelectionTracker(mTextView.getContext(), mTextView.isTextEditable());
+        mSelectionTracker = new SelectionTracker(mTextView);
 
         if (SMART_SELECT_ANIMATION_ENABLED) {
             mSmartSelectSprite = new SmartSelectSprite(mTextView.getContext(),
@@ -147,10 +146,8 @@
                 SelectionEvent.ActionType.DRAG, mTextClassification);
     }
 
-    public void onTypeOverSelection() {
-        mSelectionTracker.onSelectionAction(
-                mTextView.getSelectionStart(), mTextView.getSelectionEnd(),
-                SelectionEvent.ActionType.OVERTYPE, mTextClassification);
+    public void onTextChanged(int start, int end) {
+        mSelectionTracker.onTextChanged(start, end, mTextClassification);
     }
 
     public boolean resetSelection(int textIndex) {
@@ -235,17 +232,6 @@
         final List<RectF> selectionRectangles =
                 convertSelectionToRectangles(layout, result.mStart, result.mEnd);
 
-        /*
-         * Do not run the Smart Select animation when there are multiple lines involved, as this
-         * behavior is currently broken.
-         *
-         * TODO fix Smart Select Animation when the selection spans multiple lines
-         */
-        if (selectionRectangles.size() != 1) {
-            onAnimationEndCallback.run();
-            return;
-        }
-
         final PointF touchPoint = new PointF(
                 mEditor.getLastUpPositionX(),
                 mEditor.getLastUpPositionY());
@@ -262,17 +248,66 @@
     private List<RectF> convertSelectionToRectangles(final Layout layout, final int start,
             final int end) {
         final List<RectF> result = new ArrayList<>();
-        // TODO filter out invalid rectangles
-        // getSelection might give us overlapping and zero-dimension rectangles which will interfere
-        // with the Smart Select animation
-        layout.getSelection(start, end, (left, top, right, bottom) ->
-                result.add(new RectF(left, top, right, bottom)));
+        layout.getSelection(start, end, (left, top, right, bottom, textSelectionLayout) ->
+                mergeRectangleIntoList(result, new RectF(left, top, right, bottom)));
 
         result.sort(SmartSelectSprite.RECTANGLE_COMPARATOR);
-
         return result;
     }
 
+    /**
+     * Merges a {@link RectF} into an existing list of rectangles. While merging, this method
+     * makes sure that:
+     *
+     * <ol>
+     * <li>No rectangle is redundant (contained within a bigger rectangle)</li>
+     * <li>Rectangles of the same height and vertical position that intersect get merged</li>
+     * </ol>
+     *
+     * @param list      the list of rectangles to merge the new rectangle in
+     * @param candidate the {@link RectF} to merge into the list
+     * @hide
+     */
+    @VisibleForTesting
+    public static void mergeRectangleIntoList(List<RectF> list, RectF candidate) {
+        if (candidate.isEmpty()) {
+            return;
+        }
+
+        final int elementCount = list.size();
+        for (int index = 0; index < elementCount; ++index) {
+            final RectF existingRectangle = list.get(index);
+            if (existingRectangle.contains(candidate)) {
+                return;
+            }
+            if (candidate.contains(existingRectangle)) {
+                existingRectangle.setEmpty();
+                continue;
+            }
+
+            final boolean rectanglesContinueEachOther = candidate.left == existingRectangle.right
+                    || candidate.right == existingRectangle.left;
+            final boolean canMerge = candidate.top == existingRectangle.top
+                    && candidate.bottom == existingRectangle.bottom
+                    && (RectF.intersects(candidate, existingRectangle)
+                    || rectanglesContinueEachOther);
+
+            if (canMerge) {
+                candidate.union(existingRectangle);
+                existingRectangle.setEmpty();
+            }
+        }
+
+        for (int index = elementCount - 1; index >= 0; --index) {
+            if (list.get(index).isEmpty()) {
+                list.remove(index);
+            }
+        }
+
+        list.add(candidate);
+    }
+
+
     /** @hide */
     @VisibleForTesting
     public static PointF movePointInsideNearestRectangle(final PointF point,
@@ -281,7 +316,9 @@
         float bestY = -1;
         double bestDistance = Double.MAX_VALUE;
 
-        for (final RectF rectangle : rectangles) {
+        final int elementCount = rectangles.size();
+        for (int index = 0; index < elementCount; ++index) {
+            final RectF rectangle = rectangles.get(index);
             final float candidateY = rectangle.centerY();
             final float candidateX;
 
@@ -337,19 +374,18 @@
      */
     private static final class SelectionTracker {
 
-        private final Context mContext;
+        private final TextView mTextView;
         private SelectionMetricsLogger mLogger;
 
         private int mOriginalStart;
         private int mOriginalEnd;
         private int mSelectionStart;
         private int mSelectionEnd;
-        private boolean mSelectionStarted;
         private boolean mAllowReset;
 
-        SelectionTracker(Context context, boolean editable) {
-            mContext = Preconditions.checkNotNull(context);
-            mLogger = new SelectionMetricsLogger(context, editable);
+        SelectionTracker(TextView textView) {
+            mTextView = Preconditions.checkNotNull(textView);
+            mLogger = new SelectionMetricsLogger(textView);
         }
 
         /**
@@ -357,11 +393,10 @@
          */
         public void onOriginalSelection(
                 CharSequence text, int selectionStart, int selectionEnd, boolean editableText) {
-            mOriginalStart = selectionStart;
-            mOriginalEnd = selectionEnd;
-            mSelectionStarted = true;
+            mOriginalStart = mSelectionStart = selectionStart;
+            mOriginalEnd = mSelectionEnd = selectionEnd;
             mAllowReset = false;
-            maybeInvalidateLogger(editableText);
+            maybeInvalidateLogger();
             mLogger.logSelectionStarted(text, selectionStart);
         }
 
@@ -369,7 +404,7 @@
          * Called when selection action mode is started and the results come from a classifier.
          */
         public void onSmartSelection(SelectionResult result) {
-            if (mSelectionStarted) {
+            if (isSelectionStarted()) {
                 mSelectionStart = result.mStart;
                 mSelectionEnd = result.mEnd;
                 mAllowReset = mSelectionStart != mOriginalStart || mSelectionEnd != mOriginalEnd;
@@ -384,7 +419,9 @@
         public void onSelectionUpdated(
                 int selectionStart, int selectionEnd,
                 @Nullable TextClassification classification) {
-            if (mSelectionStarted) {
+            if (isSelectionStarted()) {
+                mSelectionStart = selectionStart;
+                mSelectionEnd = selectionEnd;
                 mAllowReset = false;
                 mLogger.logSelectionModified(selectionStart, selectionEnd, classification, null);
             }
@@ -395,10 +432,13 @@
          */
         public void onSelectionDestroyed() {
             mAllowReset = false;
-            mSelectionStarted = false;
-            mLogger.logSelectionAction(
-                    mSelectionStart, mSelectionEnd,
-                    SelectionEvent.ActionType.ABANDON, null /* classification */);
+            // Wait a few ms to see if the selection was destroyed because of a text change event.
+            mTextView.postDelayed(() -> {
+                mLogger.logSelectionAction(
+                        mSelectionStart, mSelectionEnd,
+                        SelectionEvent.ActionType.ABANDON, null /* classification */);
+                mSelectionStart = mSelectionEnd = -1;
+            }, 100 /* ms */);
         }
 
         /**
@@ -408,7 +448,7 @@
                 int selectionStart, int selectionEnd,
                 @SelectionEvent.ActionType int action,
                 @Nullable TextClassification classification) {
-            if (mSelectionStarted) {
+            if (isSelectionStarted()) {
                 mAllowReset = false;
                 mLogger.logSelectionAction(selectionStart, selectionEnd, action, classification);
             }
@@ -422,13 +462,15 @@
          */
         public boolean resetSelection(int textIndex, Editor editor) {
             final TextView textView = editor.getTextView();
-            if (mSelectionStarted
+            if (isSelectionStarted()
                     && mAllowReset
                     && textIndex >= mSelectionStart && textIndex <= mSelectionEnd
                     && textView.getText() instanceof Spannable) {
                 mAllowReset = false;
                 boolean selected = editor.selectCurrentWord();
                 if (selected) {
+                    mSelectionStart = editor.getTextView().getSelectionStart();
+                    mSelectionEnd = editor.getTextView().getSelectionEnd();
                     mLogger.logSelectionAction(
                             textView.getSelectionStart(), textView.getSelectionEnd(),
                             SelectionEvent.ActionType.RESET, null /* classification */);
@@ -438,11 +480,21 @@
             return false;
         }
 
-        private void maybeInvalidateLogger(boolean editableText) {
-            if (mLogger.isEditTextLogger() != editableText) {
-                mLogger = new SelectionMetricsLogger(mContext, editableText);
+        public void onTextChanged(int start, int end, TextClassification classification) {
+            if (isSelectionStarted() && start == mSelectionStart && end == mSelectionEnd) {
+                onSelectionAction(start, end, SelectionEvent.ActionType.OVERTYPE, classification);
             }
         }
+
+        private void maybeInvalidateLogger() {
+            if (mLogger.isEditTextLogger() != mTextView.isTextEditable()) {
+                mLogger = new SelectionMetricsLogger(mTextView);
+            }
+        }
+
+        private boolean isSelectionStarted() {
+            return mSelectionStart >= 0 && mSelectionEnd >= 0 && mSelectionStart != mSelectionEnd;
+        }
     }
 
     // TODO: Write tests
@@ -462,20 +514,22 @@
     private static final class SelectionMetricsLogger {
 
         private static final String LOG_TAG = "SelectionMetricsLogger";
+        private static final Pattern PATTERN_WHITESPACE = Pattern.compile("\\s+");
 
         private final SmartSelectionEventTracker mDelegate;
         private final boolean mEditTextLogger;
-        private final BreakIterator mWordIterator = BreakIterator.getWordInstance();
+        private final BreakIterator mWordIterator;
         private int mStartIndex;
-        private int mEndIndex;
         private String mText;
 
-        SelectionMetricsLogger(Context context, boolean editable) {
-            final @SmartSelectionEventTracker.WidgetType int widgetType = editable
+        SelectionMetricsLogger(TextView textView) {
+            Preconditions.checkNotNull(textView);
+            final @SmartSelectionEventTracker.WidgetType int widgetType = textView.isTextEditable()
                     ? SmartSelectionEventTracker.WidgetType.EDITTEXT
                     : SmartSelectionEventTracker.WidgetType.TEXTVIEW;
-            mDelegate = new SmartSelectionEventTracker(context, widgetType);
-            mEditTextLogger = editable;
+            mDelegate = new SmartSelectionEventTracker(textView.getContext(), widgetType);
+            mEditTextLogger = textView.isTextEditable();
+            mWordIterator = BreakIterator.getWordInstance(textView.getTextLocale());
         }
 
         public void logSelectionStarted(CharSequence text, int index) {
@@ -487,7 +541,6 @@
                 }
                 mWordIterator.setText(mText);
                 mStartIndex = index;
-                mEndIndex = mWordIterator.following(index);
                 mDelegate.logEvent(SelectionEvent.selectionStarted(0));
             } catch (Exception e) {
                 // Avoid crashes due to logging.
@@ -550,12 +603,15 @@
             } else if (start < mStartIndex) {
                 wordIndices[0] = -countWordsForward(start);
             } else {  // start > mStartIndex
-                if (mStartIndex < start && start < mEndIndex) {
-                    // If the new selection did not move past the original word,
-                    // assume it has not moved.
-                    wordIndices[0] = 0;
-                } else {
-                    wordIndices[0] = countWordsBackward(start);
+                wordIndices[0] = countWordsBackward(start);
+
+                // For the selection start index, avoid counting a partial word backwards.
+                if (!mWordIterator.isBoundary(start)
+                        && !isWhitespace(
+                        mWordIterator.preceding(start),
+                        mWordIterator.following(start))) {
+                    // We counted a partial word. Remove it.
+                    wordIndices[0]--;
                 }
             }
 
@@ -599,7 +655,7 @@
         }
 
         private boolean isWhitespace(int start, int end) {
-            return mText.substring(start, end).trim().isEmpty();
+            return PATTERN_WHITESPACE.matcher(mText.substring(start, end)).matches();
         }
     }
 
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index 8de17c0..8696d0d 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -146,12 +146,17 @@
         // and relays them to the tab content.
         mTabKeyListener = new OnKeyListener() {
             public boolean onKey(View v, int keyCode, KeyEvent event) {
+                if (KeyEvent.isModifierKey(keyCode)) {
+                    return false;
+                }
                 switch (keyCode) {
                     case KeyEvent.KEYCODE_DPAD_CENTER:
                     case KeyEvent.KEYCODE_DPAD_LEFT:
                     case KeyEvent.KEYCODE_DPAD_RIGHT:
                     case KeyEvent.KEYCODE_DPAD_UP:
                     case KeyEvent.KEYCODE_DPAD_DOWN:
+                    case KeyEvent.KEYCODE_TAB:
+                    case KeyEvent.KEYCODE_SPACE:
                     case KeyEvent.KEYCODE_ENTER:
                         return false;
 
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 140ecc1..4b6c4d3 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -9402,7 +9402,7 @@
             }
         }
 
-        if (mEditor != null) mEditor.sendOnTextChanged(start, after);
+        if (mEditor != null) mEditor.sendOnTextChanged(start, before, after);
     }
 
     /**
@@ -10942,6 +10942,7 @@
     @Override
     public boolean performLongClick() {
         boolean handled = false;
+        boolean performedHapticFeedback = false;
 
         if (mEditor != null) {
             mEditor.mIsBeingLongClicked = true;
@@ -10949,6 +10950,7 @@
 
         if (super.performLongClick()) {
             handled = true;
+            performedHapticFeedback = true;
         }
 
         if (mEditor != null) {
@@ -10957,7 +10959,9 @@
         }
 
         if (handled) {
-            performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+            if (!performedHapticFeedback) {
+              performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+            }
             if (mEditor != null) mEditor.mDiscardNextActionUp = true;
         } else {
             MetricsLogger.action(
diff --git a/core/java/com/android/internal/app/PlatLogoActivity.java b/core/java/com/android/internal/app/PlatLogoActivity.java
index 36ab394..b22ce5e 100644
--- a/core/java/com/android/internal/app/PlatLogoActivity.java
+++ b/core/java/com/android/internal/app/PlatLogoActivity.java
@@ -53,8 +53,7 @@
 import android.widget.ImageView;
 
 public class PlatLogoActivity extends Activity {
-    public static final boolean REVEAL_THE_NAME = false;
-    public static final boolean FINISH = false;
+    public static final boolean FINISH = true;
 
     FrameLayout mLayout;
     int mTapCount;
@@ -85,15 +84,18 @@
         im.setAlpha(0f);
 
         im.setBackground(new RippleDrawable(
-                ColorStateList.valueOf(0xFFFFFFFF),
+                ColorStateList.valueOf(0xFF776677),
                 getDrawable(com.android.internal.R.drawable.platlogo),
                 null));
-//        im.setOutlineProvider(new ViewOutlineProvider() {
-//            @Override
-//            public void getOutline(View view, Outline outline) {
-//                outline.setOval(0, 0, view.getWidth(), view.getHeight());
-//            }
-//        });
+        im.setOutlineProvider(new ViewOutlineProvider() {
+            @Override
+            public void getOutline(View view, Outline outline) {
+                final int w = view.getWidth();
+                final int h = view.getHeight();
+                outline.setOval((int)(w*.125), (int)(h*.125), (int)(w*.96), (int)(h*.96));
+            }
+        });
+        im.setElevation(12f*dp);
         im.setClickable(true);
         im.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -103,18 +105,6 @@
                     public boolean onLongClick(View v) {
                         if (mTapCount < 5) return false;
 
-                        if (REVEAL_THE_NAME) {
-                            final Drawable overlay = getDrawable(
-                                com.android.internal.R.drawable.platlogo_m);
-                            overlay.setBounds(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
-                            im.getOverlay().clear();
-                            im.getOverlay().add(overlay);
-                            overlay.setAlpha(0);
-                            ObjectAnimator.ofInt(overlay, "alpha", 0, 255)
-                                .setDuration(500)
-                                .start();
-                        }
-
                         final ContentResolver cr = getContentResolver();
                         if (Settings.System.getLong(cr, Settings.System.EGG_MODE, 0)
                                 == 0) {
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index a9350db..4e4b5b8 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -16,14 +16,12 @@
 
 package com.android.internal.os;
 
-
+import android.os.IVold;
 import android.os.Trace;
-import dalvik.system.ZygoteHooks;
 import android.system.ErrnoException;
 import android.system.Os;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
+import dalvik.system.ZygoteHooks;
 
 /** @hide */
 public final class Zygote {
@@ -52,13 +50,13 @@
     public static final int DEBUG_JAVA_DEBUGGABLE = 1 << 8;
 
     /** No external storage should be mounted. */
-    public static final int MOUNT_EXTERNAL_NONE = 0;
+    public static final int MOUNT_EXTERNAL_NONE = IVold.REMOUNT_MODE_NONE;
     /** Default external storage should be mounted. */
-    public static final int MOUNT_EXTERNAL_DEFAULT = 1;
+    public static final int MOUNT_EXTERNAL_DEFAULT = IVold.REMOUNT_MODE_DEFAULT;
     /** Read-only external storage should be mounted. */
-    public static final int MOUNT_EXTERNAL_READ = 2;
+    public static final int MOUNT_EXTERNAL_READ = IVold.REMOUNT_MODE_READ;
     /** Read-write external storage should be mounted. */
-    public static final int MOUNT_EXTERNAL_WRITE = 3;
+    public static final int MOUNT_EXTERNAL_WRITE = IVold.REMOUNT_MODE_WRITE;
 
     private static final ZygoteHooks VM_HOOKS = new ZygoteHooks();
 
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index a413283..85251d4 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -1058,7 +1058,7 @@
         WindowManager.LayoutParams attrs = mWindow.getAttributes();
         int sysUiVisibility = attrs.systemUiVisibility | getWindowSystemUiVisibility();
 
-        if (!mWindow.mIsFloating && ActivityManager.isHighEndGfx()) {
+        if (!mWindow.mIsFloating) {
             boolean disallowAnimate = !isLaidOut();
             disallowAnimate |= ((mLastWindowFlags ^ attrs.flags)
                     & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
@@ -1311,11 +1311,12 @@
                 v.setTag(new Pair<>(verticalBar, seascape));
             } else {
                 final LayerDrawable d = (LayerDrawable) v.getBackground();
-                final InsetDrawable inset = ((InsetDrawable) d.getDrawable(0));
-                ((ColorDrawable) inset.getDrawable()).setColor(dividerColor);
-                ((ColorDrawable) d.getDrawable(1)).setColor(color);
+                final InsetDrawable inset = ((InsetDrawable) d.getDrawable(1));
+                ((ColorDrawable) inset.getDrawable()).setColor(color);
+                ((ColorDrawable) d.getDrawable(0)).setColor(dividerColor);
             }
         } else {
+            v.setTag(null);
             v.setBackgroundColor(color);
         }
     }
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java
index 2de9537..b13560c 100644
--- a/core/java/com/android/internal/policy/PhoneWindow.java
+++ b/core/java/com/android/internal/policy/PhoneWindow.java
@@ -2441,7 +2441,7 @@
 
         // Non-floating windows on high end devices must put up decor beneath the system bars and
         // therefore must know about visibility changes of those.
-        if (!mIsFloating && ActivityManager.isHighEndGfx()) {
+        if (!mIsFloating) {
             if (!targetPreL && a.getBoolean(
                     R.styleable.Window_windowDrawsSystemBarBackgrounds,
                     false)) {
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index f85333eb..b8ef82b 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -1614,7 +1614,8 @@
                         STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW,
                         SOME_AUTH_REQUIRED_AFTER_USER_REQUEST,
                         STRONG_AUTH_REQUIRED_AFTER_LOCKOUT,
-                        STRONG_AUTH_REQUIRED_AFTER_TIMEOUT})
+                        STRONG_AUTH_REQUIRED_AFTER_TIMEOUT,
+                        STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN})
         @Retention(RetentionPolicy.SOURCE)
         public @interface StrongAuthFlags {}
 
@@ -1651,6 +1652,11 @@
         public static final int STRONG_AUTH_REQUIRED_AFTER_TIMEOUT = 0x10;
 
         /**
+         * Strong authentication is required because the user has triggered lockdown.
+         */
+        public static final int STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN = 0x20;
+
+        /**
          * Strong auth flags that do not prevent fingerprint from being accepted as auth.
          *
          * If any other flags are set, fingerprint is disabled.
diff --git a/core/java/com/android/internal/widget/NotificationExpandButton.java b/core/java/com/android/internal/widget/NotificationExpandButton.java
index b702898..39f82a5 100644
--- a/core/java/com/android/internal/widget/NotificationExpandButton.java
+++ b/core/java/com/android/internal/widget/NotificationExpandButton.java
@@ -31,7 +31,6 @@
  */
 @RemoteViews.RemoteView
 public class NotificationExpandButton extends ImageView {
-    private View mLabeledBy;
 
     public NotificationExpandButton(Context context) {
         super(context);
@@ -69,12 +68,5 @@
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
         info.setClassName(Button.class.getName());
-        if (mLabeledBy != null) {
-            info.setLabeledBy(mLabeledBy);
-        }
-    }
-
-    public void setLabeledBy(View labeledBy) {
-        mLabeledBy = labeledBy;
     }
 }
diff --git a/core/java/com/android/internal/widget/PointerLocationView.java b/core/java/com/android/internal/widget/PointerLocationView.java
index 592576b..e53162c 100644
--- a/core/java/com/android/internal/widget/PointerLocationView.java
+++ b/core/java/com/android/internal/widget/PointerLocationView.java
@@ -25,6 +25,7 @@
 import android.hardware.input.InputManager.InputDeviceListener;
 import android.os.SystemProperties;
 import android.util.Log;
+import android.util.Slog;
 import android.view.InputDevice;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
@@ -630,6 +631,12 @@
                     >> MotionEvent.ACTION_POINTER_INDEX_SHIFT; // will be 0 for UP
 
             final int id = event.getPointerId(index);
+            if (id >= NP) {
+                Slog.wtf(TAG, "Got pointer ID out of bounds: id=" + id + " arraysize="
+                        + NP + " pointerindex=" + index
+                        + " action=0x" + Integer.toHexString(action));
+                return;
+            }
             final PointerState ps = mPointers.get(id);
             ps.mCurDown = false;
 
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 5b0f776..883d4db 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -133,6 +133,14 @@
     jmethodID mCallback;
 } gStrictModeCallbackOffsets;
 
+static struct thread_dispatch_offsets_t
+{
+    // Class state.
+    jclass mClass;
+    jmethodID mDispatchUncaughtException;
+    jmethodID mCurrentThread;
+} gThreadDispatchOffsets;
+
 // ****************************************************************************
 // ****************************************************************************
 // ****************************************************************************
@@ -166,6 +174,23 @@
     return vm->GetEnv((void **)&env, JNI_VERSION_1_4) >= 0 ? env : NULL;
 }
 
+// Report a java.lang.Error (or subclass). This may terminate the runtime.
+static void report_java_lang_error(JNIEnv* env, jthrowable error)
+{
+    // Try to run the uncaught exception machinery.
+    jobject thread = env->CallStaticObjectMethod(gThreadDispatchOffsets.mClass,
+            gThreadDispatchOffsets.mCurrentThread);
+    if (thread != nullptr) {
+        env->CallVoidMethod(thread, gThreadDispatchOffsets.mDispatchUncaughtException,
+                error);
+        // Should not return here, unless more errors occured.
+    }
+    // Some error occurred that meant that either dispatchUncaughtException could not be
+    // called or that it had an error itself (as this should be unreachable under normal
+    // conditions). Clear the exception.
+    env->ExceptionClear();
+}
+
 static void report_exception(JNIEnv* env, jthrowable excep, const char* msg)
 {
     env->ExceptionClear();
@@ -192,6 +217,10 @@
     }
 
     if (env->IsInstanceOf(excep, gErrorOffsets.mClass)) {
+        // Try to report the error. This should not return under normal circumstances.
+        report_java_lang_error(env, excep);
+        // The traditional handling: re-raise and abort.
+
         /*
          * It's an Error: Reraise the exception and ask the runtime to abort.
          */
@@ -1337,5 +1366,12 @@
     gStrictModeCallbackOffsets.mCallback = GetStaticMethodIDOrDie(env, clazz,
             "onBinderStrictModePolicyChange", "(I)V");
 
+    clazz = FindClassOrDie(env, "java/lang/Thread");
+    gThreadDispatchOffsets.mClass = MakeGlobalRefOrDie(env, clazz);
+    gThreadDispatchOffsets.mDispatchUncaughtException = GetMethodIDOrDie(env, clazz,
+            "dispatchUncaughtException", "(Ljava/lang/Throwable;)V");
+    gThreadDispatchOffsets.mCurrentThread = GetStaticMethodIDOrDie(env, clazz, "currentThread",
+            "()Ljava/lang/Thread;");
+
     return 0;
 }
diff --git a/core/proto/android/os/incident.proto b/core/proto/android/os/incident.proto
index 5dfcd2a..aab4142 100644
--- a/core/proto/android/os/incident.proto
+++ b/core/proto/android/os/incident.proto
@@ -31,22 +31,12 @@
 import "frameworks/base/core/proto/android/service/power.proto";
 import "frameworks/base/core/proto/android/service/print.proto";
 import "frameworks/base/core/proto/android/providers/settings.proto";
+import "frameworks/base/core/proto/android/os/incidentheader.proto";
 import "frameworks/base/core/proto/android/os/kernelwake.proto";
 import "frameworks/base/core/proto/android/os/procrank.proto";
 
 package android.os;
 
-message IncidentHeaderProto {
-    enum Cause {
-        CAUSE_UNKNOWN = 0;
-        CAUSE_USER = 1;
-        CAUSE_ANR = 2;
-        CAUSE_CRASH = 3;
-    }
-
-    Cause cause = 1;
-}
-
 // privacy field options must not be set at this level because all
 // the sections are able to be controlled and configured by section ids.
 // Instead privacy field options need to be configured in each section proto message.
diff --git a/core/proto/android/os/incidentheader.proto b/core/proto/android/os/incidentheader.proto
new file mode 100644
index 0000000..55a0616
--- /dev/null
+++ b/core/proto/android/os/incidentheader.proto
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_outer_classname = "IncidentHeaderProtoMetadata";
+
+package android.os;
+
+message IncidentHeaderProto {
+    enum Cause {
+        CAUSE_UNKNOWN = 0;
+        CAUSE_USER = 1;
+        CAUSE_ANR = 2;
+        CAUSE_CRASH = 3;
+    }
+
+    Cause cause = 1;
+}
+
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 0d9a995..d6f67f6 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -309,6 +309,10 @@
     <protected-broadcast android:name="com.android.server.usb.ACTION_OPEN_IN_APPS" />
     <protected-broadcast android:name="com.android.server.am.DELETE_DUMPHEAP" />
     <protected-broadcast android:name="com.android.server.net.action.SNOOZE_WARNING" />
+    <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.USER_DISMISSED_NOTIFICATION" />
+    <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.CONNECT_TO_NETWORK" />
+    <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.PICK_WIFI_NETWORK" />
+    <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.PICK_NETWORK_AFTER_FAILURE" />
     <protected-broadcast android:name="android.net.wifi.WIFI_STATE_CHANGED" />
     <protected-broadcast android:name="android.net.wifi.WIFI_AP_STATE_CHANGED" />
     <protected-broadcast android:name="android.net.wifi.WIFI_CREDENTIAL_CHANGED" />
diff --git a/core/res/res/drawable-nodpi/platlogo.xml b/core/res/res/drawable-nodpi/platlogo.xml
index 182ba24..a6dee8a 100644
--- a/core/res/res/drawable-nodpi/platlogo.xml
+++ b/core/res/res/drawable-nodpi/platlogo.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 Copyright (C) 2017 The Android Open Source Project
 
@@ -14,27 +15,35 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="480dp"
-        android:height="480dp"
-        android:viewportWidth="48.0"
-        android:viewportHeight="48.0">
-    <path
-        android:pathData="M25.0,25.0m-20.5,0.0a20.5,20.5,0,1,1,41.0,0.0a20.5,20.5,0,1,1,-41.0,0.0"
-        android:fillAlpha="0.066"
-        android:fillColor="#000000"/>
-    <path
-        android:pathData="M24.0,24.0m-20.0,0.0a20.0,20.0,0,1,1,40.0,0.0a20.0,20.0,0,1,1,-40.0,0.0"
-        android:fillColor="#FFC107"/>
-    <path
-        android:pathData="M44,24.2010101 L33.9004889,14.101499 L14.101499,33.9004889 L24.2010101,44 C29.2525804,43.9497929 34.2887564,41.9975027 38.1431296,38.1431296 C41.9975027,34.2887564 43.9497929,29.2525804 44,24.2010101 Z"
-        android:fillColor="#FE9F00"/>
-    <path
-        android:pathData="M24.0,24.0m-14.0,0.0a14.0,14.0,0,1,1,28.0,0.0a14.0,14.0,0,1,1,-28.0,0.0"
-        android:fillColor="#FED44F"/>
-    <path
-        android:pathData="M37.7829445,26.469236 L29.6578482,18.3441397 L18.3441397,29.6578482 L26.469236,37.7829445 C29.1911841,37.2979273 31.7972024,36.0037754 33.9004889,33.9004889 C36.0037754,31.7972024 37.2979273,29.1911841 37.7829445,26.469236 Z"
-        android:fillColor="#FFC107"/>
-    <path
-        android:pathData="M24.0,24.0m-8.0,0.0a8.0,8.0,0,1,1,16.0,0.0a8.0,8.0,0,1,1,-16.0,0.0"
-        android:fillColor="#FFFFFF"/>
+    android:width="48dp"
+    android:height="48dp"
+    android:viewportWidth="48"
+    android:viewportHeight="48">
+    <group>
+        <path
+            android:fillColor="#2C292A"
+            android:fillType="evenOdd"
+            android:pathData="M6,26a20,20 0 0,1 40,0a20,20 0 0,1 -40,0z"/>
+        <path
+            android:fillColor="#FAFAFA"
+            android:fillType="evenOdd"
+            android:pathData="M4,24a20,20 0 0,1 40,0a20,20 0 0,1 -40,0z"/>
+        <path
+            android:fillColor="#2C292A"
+            android:fillType="evenOdd"
+            android:pathData="M2,22a20,20 0 0,1 40,0a20,20 0 0,1 -40,0z"/>
+        <path
+            android:fillColor="#00000000"
+            android:strokeColor="#453F41"
+            android:strokeWidth="1"
+            android:fillType="evenOdd"
+            android:pathData="M26.5 29.5v3c0 1.13-.87 2-2 2s-2-.87-2-2v-3h-1v3c0 1.13-.87 2-2 2s-2-.87-2-2v-3H17a1.5 1.5 0 0 1-1.5-1.5V17.5h13V28a1.5 1.5 0 0 1-1.5 1.5h-.5zM13.5 17.5c1.13 0 2 .87 2 2v7c0 1.13-.87 2-2 2s-2-.87-2-2v-7c0-1.13.87-2 2-2zM30.5 17.5c1.13 0 2 .87 2 2v7c0 1.13-.87 2-2 2s-2-.87-2-2v-7c0-1.13.87-2 2-2zM26.3 12.11A6.46 6.46 0 0 1 28.5 17v.5h-13V17a6.46 6.46 0 0 1 2.2-4.89l-.9-.9a.98.98 0 0 1 0-1.41.98.98 0 0 1 1.4 0l1.26 1.25A6.33 6.33 0 0 1 22 10.5c.87 0 1.73.2 2.54.55L25.8 9.8a.98.98 0 0 1 1.4 0 .98.98 0 0 1 0 1.4l-.9.91z"/>
+        <path
+            android:fillColor="#453F41"
+            android:fillType="evenOdd"
+            android:pathData="M20.16 14.5a.66.66 0 1 1-1.31 0c0-.36.29-.65.65-.65.36 0 .65.29.65.65zM25.16 14.5c0 .36-.3.66-.66.66a.65.65 0 1 1 .66-.66z"/>
+        <path
+            android:fillColor="#453F41"
+            android:pathData="M22 40.5c0.36 0 0.73-0.01 1.09-0.03l-0.18-3A15.77 15.77 0 0 1 22 37.5v3zm2.17-0.13a18.48 18.48 0 0 0 1.08-0.15l-0.53-2.96c-0.3 0.05-0.6 0.1-0.9 0.13l0.35 2.98zM26.32 40a18.37 18.37 0 0 0 1.05-0.28l-0.87-2.87a15.37 15.37 0 0 1-0.88 0.23l0.7 2.92zm2.1-0.64l-1.03-2.81a15.39 15.39 0 0 0 0.84-0.34l1.2 2.74a18.39 18.39 0 0 1-1 0.41zm1.99-0.87l-1.37-2.67a15.46 15.46 0 0 0 0.8-0.44l1.52 2.59a18.46 18.46 0 0 1-0.95 0.52zm1.89-1.11l-1.67-2.5a15.55 15.55 0 0 0 0.74-0.52l1.81 2.39a18.55 18.55 0 0 1-0.88 0.63zm1.75-1.33l-1.95-2.28a15.6 15.6 0 0 0 0.67-0.61l2.09 2.15a18.6 18.6 0 0 1-0.8 0.74zm1.6-1.55l-2.22-2.02a15.6 15.6 0 0 0 0.6-0.7l2.33 1.9a18.6 18.6 0 0 1-0.72 0.82zM37 32.82l-2.43-1.76a15.53 15.53 0 0 0 0.5-0.75l2.54 1.6c-0.2 0.31-0.4 0.61-0.61 0.9zm1.15-1.8l-2.62-1.47a15.45 15.45 0 0 0 0.42-0.8l2.7 1.3a18.45 18.45 0 0 1-0.5 0.97zm0.95-1.98l-2.77-1.14a15.38 15.38 0 0 0 0.32-0.86l2.84 0.98a18.38 18.38 0 0 1-0.39 1.02zm0.72-2.09c0.1-0.34 0.18-0.7 0.26-1.05l-2.93-0.63a15.38 15.38 0 0 1-0.22 0.88l2.89 0.8zm0.46-2.15a18.52 18.52 0 0 0 0.13-1.08l-2.99-0.28a15.52 15.52 0 0 1-0.1 0.9l2.96 0.46zm0.2-2.2a18.81 18.81 0 0 0 0-1.1l-3 0.08a16 16 0 0 1 0 0.92l3 0.1zm-0.06-2.2a18.54 18.54 0 0 0-0.12-1.07l-2.97 0.43c0.04 0.3 0.08 0.6 0.1 0.9l3-0.25zm-0.31-2.15a18.39 18.39 0 0 0-0.25-1.06l-2.9 0.78a15.39 15.39 0 0 1 0.21 0.89l2.94-0.6zm-0.57-2.12l-2.85 0.95a15.37 15.37 0 0 0-0.31-0.85l2.78-1.12a18.37 18.37 0 0 1 0.38 1.02zm-0.83-2.06l-2.71 1.29a15.44 15.44 0 0 0-0.42-0.81l2.63-1.45a18.44 18.44 0 0 1 0.5 0.97zm-1.03-1.88l-2.54 1.6a15.53 15.53 0 0 0-0.5-0.76l2.44-1.74 0.6 0.9zm-1.28-1.79l-2.33 1.88a15.6 15.6 0 0 0-0.6-0.69l2.23-2.02a18.6 18.6 0 0 1 0.7 0.83zm-1.48-1.63l-2.1 2.14a15.6 15.6 0 0 0-0.67-0.62l1.97-2.26a18.6 18.6 0 0 1 0.8 0.74zM33.24 7.3l-1.82 2.38a15.55 15.55 0 0 0-0.74-0.53l1.68-2.49c0.3 0.2 0.6 0.42 0.88 0.64zm-1.71-1.17L29.98 8.7a15.47 15.47 0 0 0-0.8-0.45l1.4-2.66a18.47 18.47 0 0 1 0.95 0.54zm-1.95-1.02l-1.23 2.74A15.4 15.4 0 0 0 27.5 7.5l1.06-2.8a18.4 18.4 0 0 1 1.01 0.4zm-2.06-0.78l-0.9 2.86a15.37 15.37 0 0 0-0.87-0.24l0.72-2.92a18.37 18.37 0 0 1 1.05 0.3zM25.38 3.8a18.47 18.47 0 0 0-1.08-0.17l-0.37 2.98c0.3 0.04 0.6 0.08 0.9 0.14l0.55-2.95zm-2.2-0.27A18.75 18.75 0 0 0 22.1 3.5l-0.02 3L23 6.53l0.19-3zM21 3.53a18.6 18.6 0 0 0-1.08 0.09l0.33 2.98a15.6 15.6 0 0 1 0.91-0.08l-0.16-3zm-2.16 0.24A18.4 18.4 0 0 0 17.76 4l0.68 2.92a15.4 15.4 0 0 1 0.9-0.18l-0.51-2.96zm-2.14 0.5l0.86 2.88a15.37 15.37 0 0 0-0.86 0.28l-1.03-2.81a18.37 18.37 0 0 1 1.03-0.35zm-2.07 0.76l1.2 2.75a15.42 15.42 0 0 0-0.83 0.4L13.63 5.5a18.42 18.42 0 0 1 0.99-0.47zM12.7 6l1.5 2.6a15.5 15.5 0 0 0-0.76 0.48l-1.66-2.5A18.5 18.5 0 0 1 12.7 6zm-1.83 1.22l1.8 2.4a15.58 15.58 0 0 0-0.7 0.57L10.01 7.9a18.58 18.58 0 0 1 0.85-0.68zM9.19 8.66l2.07 2.16a15.6 15.6 0 0 0-0.63 0.65l-2.2-2.04a18.6 18.6 0 0 1 0.76-0.77zm-1.51 1.63l2.32 1.9a15.57 15.57 0 0 0-0.56 0.72l-2.42-1.76a18.57 18.57 0 0 1 0.66-0.86zm-1.23 1.69l2.52 1.62a15.5 15.5 0 0 0-0.47 0.78l-2.61-1.47a18.5 18.5 0 0 1 0.56-0.93zm-1.08 1.9l2.7 1.32a15.41 15.41 0 0 0-0.38 0.83l-2.77-1.15a18.41 18.41 0 0 1 0.45-1zm-0.85 2.04l2.84 0.98a15.37 15.37 0 0 0-0.28 0.87L4.2 16.96c0.1-0.35 0.2-0.7 0.32-1.04zm-0.6 2.12a18.43 18.43 0 0 0-0.2 1.07l2.97 0.47c0.05-0.3 0.1-0.6 0.17-0.9l-2.93-0.64zm-0.34 2.18a18.65 18.65 0 0 0-0.07 1.09l3 0.11 0.06-0.91-2.99-0.29zm-0.08 2.2a18.7 18.7 0 0 0 0.06 1.1l3-0.25a15.7 15.7 0 0 1-0.06-0.91l-3 0.07zm0.18 2.18a18.44 18.44 0 0 0 0.18 1.07l2.95-0.6a15.44 15.44 0 0 1-0.16-0.9L3.68 24.6zm0.43 2.14l2.9-0.77a15.37 15.37 0 0 0 0.26 0.88l-2.85 0.94a18.37 18.37 0 0 1-0.3-1.05zm0.7 2.1l2.78-1.11a15.4 15.4 0 0 0 0.36 0.83l-2.71 1.27a18.4 18.4 0 0 1-0.44-1zm0.9 1.95l2.65-1.43a15.48 15.48 0 0 0 0.45 0.8l-2.55 1.57a18.48 18.48 0 0 1-0.54-0.94zm1.17 1.87l2.45-1.73a15.56 15.56 0 0 0 0.54 0.73l-2.34 1.87a18.56 18.56 0 0 1-0.65-0.87zm1.37 1.72l2.23-2a15.6 15.6 0 0 0 0.63 0.65l-2.1 2.14a18.6 18.6 0 0 1-0.76-0.79zm1.58 1.56l1.98-2.26c0.22 0.2 0.46 0.39 0.7 0.58l-1.84 2.37a18.59 18.59 0 0 1-0.84-0.7zm1.66 1.28l1.7-2.46a15.52 15.52 0 0 0 0.77 0.5l-1.56 2.56a18.52 18.52 0 0 1-0.91-0.6zm1.87 1.14l1.4-2.65a15.43 15.43 0 0 0 0.82 0.4l-1.24 2.73a18.43 18.43 0 0 1-0.98-0.48zm2 0.91l1.08-2.8a15.37 15.37 0 0 0 0.86 0.3l-0.9 2.86a18.37 18.37 0 0 1-1.04-0.36zm2.1 0.67a18.4 18.4 0 0 0 1.07 0.23l0.56-2.94a15.4 15.4 0 0 1-0.9-0.2l-0.72 2.91zm2.18 0.41a18.57 18.57 0 0 0 1.08 0.1l0.2-2.99a15.57 15.57 0 0 1-0.9-0.09l-0.38 2.98zm2.2 0.15H22v-3h-0.13l-0.03 3z"/>
+    </group>
 </vector>
diff --git a/core/res/res/drawable-nodpi/platlogo_m.xml b/core/res/res/drawable-nodpi/platlogo_m.xml
index d9a558d..aacf674 100644
--- a/core/res/res/drawable-nodpi/platlogo_m.xml
+++ b/core/res/res/drawable-nodpi/platlogo_m.xml
@@ -1,5 +1,5 @@
 <!--
-Copyright (C) 2016 The Android Open Source Project
+Copyright (C) 2017 The Android Open Source Project
 
    Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -14,59 +14,27 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="48dp"
-        android:height="48dp"
+        android:width="480dp"
+        android:height="480dp"
         android:viewportWidth="48.0"
         android:viewportHeight="48.0">
+    <!--<path
+        android:pathData="M25.0,25.0m-20.5,0.0a20.5,20.5,0,1,1,41.0,0.0a20.5,20.5,0,1,1,-41.0,0.0"
+        android:fillAlpha="0.066"
+        android:fillColor="#000000"/>-->
     <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M33.8,38l-25.5,-25.5l-1.7000003,0.6999998l25.499998,25.5z"/>
+        android:pathData="M24.0,24.0m-20.0,0.0a20.0,20.0,0,1,1,40.0,0.0a20.0,20.0,0,1,1,-40.0,0.0"
+        android:fillColor="#FFC107"/>
     <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M40.8,34.8l-25.4,-25.5l-1.6999998,0.6999998l25.5,25.5z"/>
+        android:pathData="M44,24.2010101 L33.9004889,14.101499 L14.101499,33.9004889 L24.2010101,44 C29.2525804,43.9497929 34.2887564,41.9975027 38.1431296,38.1431296 C41.9975027,34.2887564 43.9497929,29.2525804 44,24.2010101 Z"
+        android:fillColor="#FE9F00"/>
     <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M11.1,13.1l-0.3,-0.4l1.1,-1.3l0,0l-1.6,0.8l-0.4,-0.4l2.6,-1.2l0.4,0.4l-1.1,1.3l0,0l1.6,-0.8l0.3,0.4L11.1,13.1z"/>
+        android:pathData="M24.0,24.0m-14.0,0.0a14.0,14.0,0,1,1,28.0,0.0a14.0,14.0,0,1,1,-28.0,0.0"
+        android:fillColor="#FED44F"/>
     <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M13,14.2l-0.5,-0.5l-0.6,0.2l-0.4,-0.4l3.1,-0.7l0.4,0.4l-2.1,1.7l-0.4,-0.4L13,14.2z M13,13.6l0.3,0.3l0.8,-0.6   l0,0L13,13.6z"/>
+        android:pathData="M37.7829445,26.469236 L29.6578482,18.3441397 L18.3441397,29.6578482 L26.469236,37.7829445 C29.1911841,37.2979273 31.7972024,36.0037754 33.9004889,33.9004889 C36.0037754,31.7972024 37.2979273,29.1911841 37.7829445,26.469236 Z"
+        android:fillColor="#FFC107"/>
     <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M16.3,14.6l-1.6,1.2l0,0l2.2,-0.6l0.5,0.5l-2.6,1.2l-0.3,-0.4l0.7,-0.3l1,-0.4l0,0l-2.1,0.5L13.9,16l1.4,-1.1l0,0   l-0.9,0.5l-0.7,0.3l-0.3,-0.4l2.6,-1.2L16.3,14.6z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M17.4,17.8l-0.6,-0.6l-0.7,0.3l0.7,0.7l-0.4,0.2l-1,-1l2.6,-1.2l1,1l-0.4,0.2l-0.7,-0.7L17.2,17l0.6,0.6L17.4,17.8   z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M18.8,18.7L18.8,18.7l1.3,-0.2l0.4,0.4l-2.1,0.3l-0.9,0.4l-0.3,-0.4l1,-0.4l1.2,-1.2l0.4,0.4L18.8,18.7z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M22.2,20.5l-1.6,1.2l0,0l2.2,-0.6l0.5,0.5l-2.6,1.2l-0.3,-0.4l0.7,-0.3l1,-0.4l0,0L20,22.1l-0.2,-0.2l1.4,-1.1l0,0   l-0.9,0.5l-0.7,0.3l-0.3,-0.4l2.6,-1.2L22.2,20.5z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M22,23.6c0,0,0.1,0.1,0.2,0.1c0.1,0,0.2,0,0.3,-0.1l0.3,0.3c-0.2,0.1,-0.4,0.1,-0.6,0.1c-0.2,0,-0.4,-0.1,-0.5,-0.2   c-0.2,-0.2,-0.2,-0.3,-0.1,-0.5c0.1,-0.2,0.2,-0.3,0.5,-0.4l0.2,-0.1c0.3,-0.1,0.5,-0.2,0.8,-0.2c0.2,0,0.5,0.1,0.6,0.3   c0.1,0.1,0.2,0.3,0.1,0.4c0,0.1,-0.2,0.3,-0.4,0.4L23,23.4c0.1,0,0.2,-0.1,0.2,-0.2c0,-0.1,0,-0.1,0,-0.2C23.1,23,23,22.9,22.9,23   c-0.1,0,-0.2,0.1,-0.4,0.1l-0.2,0.1c-0.2,0.1,-0.3,0.1,-0.3,0.2C21.9,23.5,21.9,23.5,22,23.6z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M23.8,25.9l-0.3,-0.4l1.1,-1.3l0,0L22.9,25l-0.4,-0.4l2.6,-1.2l0.4,0.4l-1.1,1.3l0,0l1.6,-0.8l0.3,0.4L23.8,25.9z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M25.7,27l-0.5,-0.5l-0.6,0.2l-0.4,-0.4l3.1,-0.7l0.4,0.4l-2.1,1.7l-0.4,-0.4L25.7,27z M25.7,26.4l0.3,0.3l0.8,-0.6   l0,0L25.7,26.4z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M29,27.4l-1.6,1.2l0,0l2.2,-0.6l0.5,0.5l-2.6,1.2l-0.3,-0.4l0.8,-0.3l1,-0.4l0,0L26.8,29l-0.2,-0.2l1.4,-1.1l0,0   L27,28.1l-0.8,0.3l-0.3,-0.4l2.6,-1.2L29,27.4z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M30,30.6L29.5,30l-0.7,0.3l0.7,0.7L29,31.2l-1,-1l2.6,-1.2l1,1l-0.4,0.2l-0.7,-0.7l-0.6,0.3l0.6,0.6L30,30.6z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M31.5,32.1l-0.6,-0.6L29.8,32l-0.4,-0.4l2.6,-1.2l1,1l-0.4,0.2L32,31l-0.7,0.3l0.6,0.6L31.5,32.1z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M32,33.5L31.6,33L31,33.2l-0.4,-0.4l3.1,-0.7l0.4,0.4l-2.1,1.7l-0.4,-0.4L32,33.5z M32.1,32.9l0.3,0.3l0.8,-0.6   l0,0L32.1,32.9z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M34.3,35.3c-0.3,0.1,-0.5,0.2,-0.8,0.1c-0.2,0,-0.5,-0.1,-0.6,-0.3c-0.2,-0.2,-0.2,-0.4,-0.2,-0.5   c0.1,-0.2,0.2,-0.3,0.6,-0.5l0.8,-0.4c0.3,-0.1,0.6,-0.2,0.9,-0.2c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.2,0.5c0,0.2,-0.2,0.3,-0.5,0.5   l-0.3,-0.4c0.2,-0.1,0.3,-0.1,0.3,-0.2c0,-0.1,0,-0.1,-0.1,-0.2C35,34,34.9,34,34.8,34c-0.1,0,-0.3,0,-0.5,0.1l-0.8,0.4   c-0.2,0.1,-0.3,0.2,-0.4,0.2c0,0.1,0,0.1,0,0.2c0.1,0.1,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.4,-0.1L34.3,35.3z"/>
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M36,36.6L35.4,36l-0.7,0.3l0.7,0.7l-0.4,0.2l-1,-1l2.6,-1.2l1,1l-0.4,0.2l-0.7,-0.7l-0.6,0.3l0.6,0.6L36,36.6z"/>
+        android:pathData="M24.0,24.0m-8.0,0.0a8.0,8.0,0,1,1,16.0,0.0a8.0,8.0,0,1,1,-16.0,0.0"
+        android:fillColor="#FFFFFF"/>
 </vector>
diff --git a/core/res/res/drawable-nodpi/stat_sys_adb.xml b/core/res/res/drawable-nodpi/stat_sys_adb.xml
index 89e42e6..2e2b395 100644
--- a/core/res/res/drawable-nodpi/stat_sys_adb.xml
+++ b/core/res/res/drawable-nodpi/stat_sys_adb.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 Copyright (C) 2017 The Android Open Source Project
 
@@ -14,19 +15,23 @@
     limitations under the License.
 -->
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M12.0,12.0m-10.0,0.0a10.0,10.0,0,1,1,20.0,0.0a10.0,10.0,0,1,1,-20.0,0.0"
-        android:fillAlpha="0.25"/>
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 C17.5228475,2 22,6.4771525 22,12 C22,17.5228475 17.5228475,22 12,22 Z M12,18.5 C15.5898509,18.5 18.5,15.5898509 18.5,12 C18.5,8.41014913 15.5898509,5.5 12,5.5 C8.41014913,5.5 5.5,8.41014913 5.5,12 C5.5,15.5898509 8.41014913,18.5 12,18.5 Z"/>
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M12,18.5 C8.41014913,18.5 5.5,15.5898509 5.5,12 C5.5,8.41014913 8.41014913,5.5 12,5.5 C15.5898509,5.5 18.5,8.41014913 18.5,12 C18.5,15.5898509 15.5898509,18.5 12,18.5 Z M12,15 C13.6568542,15 15,13.6568542 15,12 C15,10.3431458 13.6568542,9 12,9 C10.3431458,9 9,10.3431458 9,12 C9,13.6568542 10.3431458,15 12,15 Z"
-        android:fillAlpha="0.25"/>
-</vector>
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <group>
+        <path
+            android:fillColor="#FFFFFF"
+            android:fillAlpha=".33"
+            android:fillType="evenOdd"
+            android:pathData="M5.71 18.29A8.99 8.99 0 0 0 22 13c0-3-1.46-5.65-3.71-7.29A8.99 8.99 0 0 0 2 11c0 3 1.46 5.65 3.71 7.29z"/>
+        <path
+            android:fillColor="#FFFFFF"
+            android:fillType="evenOdd"
+            android:pathData="M7.25 19.18A8.5 8.5 0 0 0 19.19 7.24 9 9 0 0 1 7.24 19.19z"/>
+        <path
+            android:fillColor="#FFFFFF"
+            android:fillAlpha=".33"
+            android:pathData="M10.5 3a0.5 0.5 0 1 1 1 0v2.05a0.5 0.5 0 1 1-1 0V3zm3.1 0.42a0.5 0.5 0 0 1 0.93 0.39l-0.8 1.88A0.5 0.5 0 1 1 12.8 5.3l0.8-1.88zm2.7 1.57a0.5 0.5 0 1 1 0.71 0.7l-1.45 1.46a0.5 0.5 0 0 1-0.7-0.71l1.44-1.45zm1.9 2.5a0.5 0.5 0 0 1 0.38 0.92l-1.9 0.77a0.5 0.5 0 0 1-0.37-0.93l1.9-0.77zM19 10.5a0.5 0.5 0 1 1 0 1h-2.05a0.5 0.5 0 0 1 0-1H19zm-0.42 3.1a0.5 0.5 0 0 1-0.39 0.93l-1.88-0.8a0.5 0.5 0 1 1 0.39-0.92l1.88 0.8zm-1.57 2.7a0.5 0.5 0 1 1-0.7 0.71l-1.46-1.45a0.5 0.5 0 0 1 0.71-0.7l1.45 1.44zm-2.5 1.9a0.5 0.5 0 1 1-0.92 0.38l-0.77-1.9a0.5 0.5 0 0 1 0.93-0.37l0.77 1.9zM11.5 19a0.5 0.5 0 1 1-1 0v-2.05a0.5 0.5 0 0 1 1 0V19zm-3.1-0.42a0.5 0.5 0 0 1-0.93-0.39l0.8-1.88A0.5 0.5 0 0 1 9.2 16.7l-0.8 1.88zm-2.7-1.57a0.5 0.5 0 1 1-0.71-0.7l1.45-1.46a0.5 0.5 0 0 1 0.7 0.71L5.7 17.01zm-1.9-2.48a0.5 0.5 0 0 1-0.38-0.92l1.88-0.8a0.5 0.5 0 0 1 0.4 0.92l-1.9 0.8zM3 11.5a0.5 0.5 0 1 1 0-1h2.05a0.5 0.5 0 1 1 0 1H3zm0.42-3.1A0.5 0.5 0 0 1 3.8 7.46l1.88 0.8A0.5 0.5 0 1 1 5.3 9.2L3.42 8.4zm1.57-2.7a0.5 0.5 0 1 1 0.7-0.71l1.46 1.45a0.5 0.5 0 0 1-0.71 0.7L4.99 5.7zm2.5-1.9A0.5 0.5 0 0 1 8.4 3.41l0.77 1.9a0.5 0.5 0 0 1-0.93 0.37L7.48 3.8z"/>
+    </group>
+</vector>
\ No newline at end of file
diff --git a/core/res/res/drawable/ic_close.xml b/core/res/res/drawable/ic_close.xml
index 7086959..70565f2 100644
--- a/core/res/res/drawable/ic_close.xml
+++ b/core/res/res/drawable/ic_close.xml
@@ -19,6 +19,6 @@
         android:viewportWidth="24.0"
         android:viewportHeight="24.0">
     <path
-        android:pathData="M19.000000,6.400000l-1.400000,-1.400000 -5.600000,5.600000 -5.600000,-5.600000 -1.400000,1.400000 5.600000,5.600000 -5.600000,5.600000 1.400000,1.400000 5.600000,-5.600000 5.600000,5.600000 1.400000,-1.400000 -5.600000,-5.600000z"
+        android:pathData="M18.3,5.71a0.996,0.996 0,0 0,-1.41 0L12,10.59 7.11,5.7A0.996,0.996 0,1 0,5.7 7.11L10.59,12 5.7,16.89a0.996,0.996 0,1 0,1.41 1.41L12,13.41l4.89,4.89a0.996,0.996 0,1 0,1.41 -1.41L13.41,12l4.89,-4.89c0.38,-0.38 0.38,-1.02 0,-1.4z"
         android:fillColor="#FF000000"/>
 </vector>
diff --git a/core/res/res/drawable/ic_eject_24dp.xml b/core/res/res/drawable/ic_eject_24dp.xml
index 1bb351a..321ee3b 100644
--- a/core/res/res/drawable/ic_eject_24dp.xml
+++ b/core/res/res/drawable/ic_eject_24dp.xml
@@ -20,5 +20,8 @@
         android:viewportHeight="24.0">
     <path
         android:fillColor="#FF000000"
-        android:pathData="M5 17h14v2H5zm7,-12L5.33 15h13.34z"/>
+        android:pathData="M6,17h12c0.55,0 1,0.45 1,1v0c0,0.55 -0.45,1 -1,1H6c-0.55,0 -1,-0.45 -1,-1v0C5,17.45 5.45,17 6,17z"/>
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M11.1,5.48l-5.22,7.83C5.39,14.03 5.91,15 6.78,15h10.44c0.87,0 1.39,-0.97 0.9,-1.69L12.9,5.48C12.47,4.84 11.53,4.84 11.1,5.48z"/>
 </vector>
diff --git a/core/res/res/drawable/ic_feedback.xml b/core/res/res/drawable/ic_feedback.xml
index 365863d..c316e7d 100644
--- a/core/res/res/drawable/ic_feedback.xml
+++ b/core/res/res/drawable/ic_feedback.xml
@@ -20,5 +20,5 @@
         android:viewportHeight="24.0">
     <path
         android:fillColor="#FF000000"
-        android:pathData="M20.0,2.0L4.0,2.0c-1.1,0.0 -1.9,0.9 -1.99,2.0L2.0,22.0l4.0,-4.0l14.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L22.0,4.0c0.0,-1.1 -0.9,-2.0 -2.0,-2.0zm-7.0,12.0l-2.0,0.0l0.0,-2.0l2.0,0.0l0.0,2.0zm0.0,-4.0l-2.0,0.0L11.0,6.0l2.0,0.0l0.0,4.0z"/>
+        android:pathData="M20,2H4C2.9,2 2,2.9 2,4v17.39c0,0.54 0.65,0.81 1.04,0.43L6.86,18H20c1.1,0 2,-0.9 2,-2V4C22,2.9 21.1,2 20,2zM11,7c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v3c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1V7zM12,15.2c-0.61,0 -1.1,-0.49 -1.1,-1.1c0,-0.61 0.49,-1.1 1.1,-1.1c0.61,0 1.1,0.49 1.1,1.1C13.1,14.71 12.61,15.2 12,15.2z"/>
 </vector>
diff --git a/core/res/res/drawable/ic_refresh.xml b/core/res/res/drawable/ic_refresh.xml
index 1297407..5894f95 100644
--- a/core/res/res/drawable/ic_refresh.xml
+++ b/core/res/res/drawable/ic_refresh.xml
@@ -20,5 +20,5 @@
         android:viewportHeight="24.0">
     <path
         android:fillColor="#FF000000"
-        android:pathData="M17.65,6.35C16.2,4.9 14.21,4.0 12.0,4.0c-4.42,0.0 -7.99,3.58 -7.99,8.0s3.57,8.0 7.99,8.0c3.73,0.0 6.84,-2.55 7.73,-6.0l-2.08,0.0c-0.82,2.33 -3.04,4.0 -5.65,4.0 -3.31,0.0 -6.0,-2.69 -6.0,-6.0s2.69,-6.0 6.0,-6.0c1.66,0.0 3.1,0.69 4.22,1.78L13.0,11.0l7.0,0.0L20.0,4.0l-2.35,2.35z"/>
+        android:pathData="M17.65,6.35c-1.63,-1.63 -3.94,-2.57 -6.48,-2.31c-3.67,0.37 -6.69,3.35 -7.1,7.02C3.52,15.91 7.27,20 12,20c3.19,0 5.93,-1.87 7.21,-4.57c0.31,-0.66 -0.16,-1.43 -0.89,-1.43h-0.01c-0.37,0 -0.72,0.2 -0.88,0.53c-1.13,2.43 -3.84,3.97 -6.81,3.32c-2.22,-0.49 -4.01,-2.3 -4.49,-4.52C5.31,9.44 8.26,6 12,6c1.66,0 3.14,0.69 4.22,1.78l-2.37,2.37C13.54,10.46 13.76,11 14.21,11H19c0.55,0 1,-0.45 1,-1V5.21c0,-0.45 -0.54,-0.67 -0.85,-0.35L17.65,6.35z"/>
 </vector>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 81c6c1d..61b4123 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1891,6 +1891,7 @@
         <enum name="KEYCODE_SYSTEM_NAVIGATION_DOWN" value="281" />
         <enum name="KEYCODE_SYSTEM_NAVIGATION_LEFT" value="282" />
         <enum name="KEYCODE_SYSTEM_NAVIGATION_RIGHT" value="283" />
+        <enum name="KEYCODE_ALL_APPS" value="284" />
     </attr>
 
     <!-- ***************************************************************** -->
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index ddceb8b..83bb443 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -44,7 +44,11 @@
         <item><xliff:g id="id">@string/status_bar_zen</xliff:g></item>
         <item><xliff:g id="id">@string/status_bar_mute</xliff:g></item>
         <item><xliff:g id="id">@string/status_bar_volume</xliff:g></item>
+        <item><xliff:g id="id">@string/status_bar_vpn</xliff:g></item>
+        <item><xliff:g id="id">@string/status_bar_ethernet</xliff:g></item>
         <item><xliff:g id="id">@string/status_bar_wifi</xliff:g></item>
+        <item><xliff:g id="id">@string/status_bar_mobile</xliff:g></item>
+        <item><xliff:g id="id">@string/status_bar_airplane</xliff:g></item>
         <item><xliff:g id="id">@string/status_bar_cdma_eri</xliff:g></item>
         <item><xliff:g id="id">@string/status_bar_data_connection</xliff:g></item>
         <item><xliff:g id="id">@string/status_bar_phone_evdo_signal</xliff:g></item>
@@ -81,6 +85,10 @@
     <string translatable="false" name="status_bar_alarm_clock">alarm_clock</string>
     <string translatable="false" name="status_bar_secure">secure</string>
     <string translatable="false" name="status_bar_clock">clock</string>
+    <string translatable="false" name="status_bar_mobile">mobile</string>
+    <string translatable="false" name="status_bar_vpn">vpn</string>
+    <string translatable="false" name="status_bar_ethernet">ethernet</string>
+    <string translatable="false" name="status_bar_airplane">airplane</string>
 
     <!-- Flag indicating whether the surface flinger has limited
          alpha compositing functionality in hardware.  If set, the window
@@ -2359,12 +2367,14 @@
          "silent" = silent mode
          "users" = list of users
          "restart" = restart device
+         "lockdown" = Lock down device until the user authenticates
          -->
     <string-array translatable="false" name="config_globalActionsList">
         <item>power</item>
         <item>restart</item>
         <item>bugreport</item>
         <item>users</item>
+        <item>lockdown</item>
     </string-array>
 
     <!-- Number of milliseconds to hold a wake lock to ensure that drawing is fully
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 9bd779e..bd5b711 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -526,8 +526,8 @@
     <!-- label for item that launches voice assist in phone options dialog [CHAR LIMIT=15]-->
     <string name="global_action_voice_assist">Voice Assist</string>
 
-    <!-- label for item that locks the phone and enforces that it can't be unlocked without entering a credential. [CHAR LIMIT=15] -->
-    <string name="global_action_lockdown">Lock now</string>
+    <!-- label for item that locks the phone and enforces that it can't be unlocked without strong authentication. [CHAR LIMIT=15] -->
+    <string name="global_action_lockdown">Enter lockdown</string>
 
     <!-- Text to use when the number in a notification info is too large
          (greater than status_bar_notification_info_maxnum, defined in
diff --git a/core/tests/BroadcastRadioTests/src/android/hardware/radio/tests/functional/RadioTunerTest.java b/core/tests/BroadcastRadioTests/src/android/hardware/radio/tests/functional/RadioTunerTest.java
index c707240..a8d5164 100644
--- a/core/tests/BroadcastRadioTests/src/android/hardware/radio/tests/functional/RadioTunerTest.java
+++ b/core/tests/BroadcastRadioTests/src/android/hardware/radio/tests/functional/RadioTunerTest.java
@@ -275,6 +275,21 @@
     }
 
     @Test
+    public void testStepLoop() {
+        openTuner();
+
+        for (int i = 0; i < 10; i++) {
+            Log.d(TAG, "step loop iteration " + (i + 1));
+
+            int ret = mRadioTuner.step(RadioTuner.DIRECTION_DOWN, true);
+            assertEquals(RadioManager.STATUS_OK, ret);
+            verify(mCallback, timeout(kTuneCallbackTimeoutMs)).onProgramInfoChanged(any());
+
+            resetCallback();
+        }
+    }
+
+    @Test
     public void testTuneAndGetPI() {
         openTuner();
 
diff --git a/core/tests/coretests/src/android/content/pm/PackageBackwardCompatibilityTest.java b/core/tests/coretests/src/android/content/pm/PackageBackwardCompatibilityTest.java
index 4d2a047..1a54bd6 100644
--- a/core/tests/coretests/src/android/content/pm/PackageBackwardCompatibilityTest.java
+++ b/core/tests/coretests/src/android/content/pm/PackageBackwardCompatibilityTest.java
@@ -68,20 +68,58 @@
     }
 
     @Test
-    public void remove_org_apache_http_legacy_from_usesLibraries() {
-        mPackage.usesLibraries = arrayList(ORG_APACHE_HTTP_LEGACY);
+    public void targeted_at_O() {
+        mPackage.applicationInfo.targetSdkVersion = Build.VERSION_CODES.O;
         PackageBackwardCompatibility.modifySharedLibraries(mPackage);
-        assertNull("usesLibraries not updated correctly", mPackage.usesLibraries);
+        assertEquals("usesLibraries not updated correctly",
+                arrayList(ORG_APACHE_HTTP_LEGACY),
+                mPackage.usesLibraries);
+        assertNull("usesOptionalLibraries not updated correctly", mPackage.usesOptionalLibraries);
     }
 
     @Test
-    public void remove_org_apache_http_legacy_from_usesOptionalLibraries() {
+    public void targeted_at_O_org_apache_http_legacy_in_usesLibraries() {
+        mPackage.applicationInfo.targetSdkVersion = Build.VERSION_CODES.O;
+        mPackage.usesLibraries = arrayList(ORG_APACHE_HTTP_LEGACY);
+        PackageBackwardCompatibility.modifySharedLibraries(mPackage);
+        assertEquals("usesLibraries not updated correctly",
+                arrayList(ORG_APACHE_HTTP_LEGACY),
+                mPackage.usesLibraries);
+        assertNull("usesOptionalLibraries not updated correctly", mPackage.usesOptionalLibraries);
+    }
+
+    @Test
+    public void targeted_at_O_org_apache_http_legacy_in_usesOptionalLibraries() {
+        mPackage.applicationInfo.targetSdkVersion = Build.VERSION_CODES.O;
         mPackage.usesOptionalLibraries = arrayList(ORG_APACHE_HTTP_LEGACY);
         PackageBackwardCompatibility.modifySharedLibraries(mPackage);
+        assertNull("usesLibraries not updated correctly", mPackage.usesLibraries);
+        assertEquals("usesOptionalLibraries not updated correctly",
+                arrayList(ORG_APACHE_HTTP_LEGACY),
+                mPackage.usesOptionalLibraries);
+    }
+
+    @Test
+    public void org_apache_http_legacy_in_usesLibraries() {
+        mPackage.usesLibraries = arrayList(ORG_APACHE_HTTP_LEGACY);
+        PackageBackwardCompatibility.modifySharedLibraries(mPackage);
+        assertEquals("usesLibraries not updated correctly",
+                arrayList(ORG_APACHE_HTTP_LEGACY),
+                mPackage.usesLibraries);
         assertNull("usesOptionalLibraries not updated correctly", mPackage.usesOptionalLibraries);
     }
 
     @Test
+    public void org_apache_http_legacy_in_usesOptionalLibraries() {
+        mPackage.usesOptionalLibraries = arrayList(ORG_APACHE_HTTP_LEGACY);
+        PackageBackwardCompatibility.modifySharedLibraries(mPackage);
+        assertNull("usesLibraries not updated correctly", mPackage.usesLibraries);
+        assertEquals("usesOptionalLibraries not updated correctly",
+                arrayList(ORG_APACHE_HTTP_LEGACY),
+                mPackage.usesOptionalLibraries);
+    }
+
+    @Test
     public void android_test_runner_in_usesLibraries() {
         mPackage.usesLibraries = arrayList(ANDROID_TEST_RUNNER);
         PackageBackwardCompatibility.modifySharedLibraries(mPackage);
diff --git a/core/tests/coretests/src/android/net/LinkPropertiesTest.java b/core/tests/coretests/src/android/net/LinkPropertiesTest.java
index d5f6321..9686dd9 100644
--- a/core/tests/coretests/src/android/net/LinkPropertiesTest.java
+++ b/core/tests/coretests/src/android/net/LinkPropertiesTest.java
@@ -24,10 +24,15 @@
 import android.system.OsConstants;
 import android.test.suitebuilder.annotation.SmallTest;
 import android.test.suitebuilder.annotation.Suppress;
+import android.util.ArraySet;
+
 import junit.framework.TestCase;
 
 import java.net.InetAddress;
-import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
 
 
 public class LinkPropertiesTest extends TestCase {
@@ -678,4 +683,76 @@
         stacked.addRoute(new RouteInfo((IpPrefix) null, stackedAddress));
         assertTrue(v6lp.isReachable(DNS1));
     }
+
+    @SmallTest
+    public void testLinkPropertiesEnsureDirectlyConnectedRoutes() {
+        // IPv4 case: no route added initially
+        LinkProperties rmnet0 = new LinkProperties();
+        rmnet0.setInterfaceName("rmnet0");
+        rmnet0.addLinkAddress(new LinkAddress("10.0.0.2/8"));
+        RouteInfo directRoute0 = new RouteInfo(new IpPrefix("10.0.0.0/8"), null,
+                rmnet0.getInterfaceName());
+
+        // Since no routes is added explicitly, getAllRoutes() should return empty.
+        assertTrue(rmnet0.getAllRoutes().isEmpty());
+        rmnet0.ensureDirectlyConnectedRoutes();
+        // ensureDirectlyConnectedRoutes() should have added the missing local route.
+        assertEqualRoutes(Collections.singletonList(directRoute0), rmnet0.getAllRoutes());
+
+        // IPv4 case: both direct and default routes added initially
+        LinkProperties rmnet1 = new LinkProperties();
+        rmnet1.setInterfaceName("rmnet1");
+        rmnet1.addLinkAddress(new LinkAddress("10.0.0.3/8"));
+        RouteInfo defaultRoute1 = new RouteInfo((IpPrefix) null,
+                NetworkUtils.numericToInetAddress("10.0.0.1"), rmnet1.getInterfaceName());
+        RouteInfo directRoute1 = new RouteInfo(new IpPrefix("10.0.0.0/8"), null,
+                rmnet1.getInterfaceName());
+        rmnet1.addRoute(defaultRoute1);
+        rmnet1.addRoute(directRoute1);
+
+        // Check added routes
+        assertEqualRoutes(Arrays.asList(defaultRoute1, directRoute1), rmnet1.getAllRoutes());
+        // ensureDirectlyConnectedRoutes() shouldn't change the routes since direct connected
+        // route is already part of the configuration.
+        rmnet1.ensureDirectlyConnectedRoutes();
+        assertEqualRoutes(Arrays.asList(defaultRoute1, directRoute1), rmnet1.getAllRoutes());
+
+        // IPv6 case: only default routes added initially
+        LinkProperties rmnet2 = new LinkProperties();
+        rmnet2.setInterfaceName("rmnet2");
+        rmnet2.addLinkAddress(new LinkAddress("fe80::cafe/64"));
+        rmnet2.addLinkAddress(new LinkAddress("2001:db8::2/64"));
+        RouteInfo defaultRoute2 = new RouteInfo((IpPrefix) null,
+                NetworkUtils.numericToInetAddress("2001:db8::1"), rmnet2.getInterfaceName());
+        RouteInfo directRoute2 = new RouteInfo(new IpPrefix("2001:db8::/64"), null,
+                rmnet2.getInterfaceName());
+        RouteInfo linkLocalRoute2 = new RouteInfo(new IpPrefix("fe80::/64"), null,
+                rmnet2.getInterfaceName());
+        rmnet2.addRoute(defaultRoute2);
+
+        assertEqualRoutes(Arrays.asList(defaultRoute2), rmnet2.getAllRoutes());
+        rmnet2.ensureDirectlyConnectedRoutes();
+        assertEqualRoutes(Arrays.asList(defaultRoute2, directRoute2, linkLocalRoute2),
+                rmnet2.getAllRoutes());
+
+        // Corner case: no interface name
+        LinkProperties rmnet3 = new LinkProperties();
+        rmnet3.addLinkAddress(new LinkAddress("192.168.0.2/24"));
+        RouteInfo directRoute3 = new RouteInfo(new IpPrefix("192.168.0.0/24"), null,
+                rmnet3.getInterfaceName());
+
+        assertTrue(rmnet3.getAllRoutes().isEmpty());
+        rmnet3.ensureDirectlyConnectedRoutes();
+        assertEqualRoutes(Collections.singletonList(directRoute3), rmnet3.getAllRoutes());
+
+    }
+
+    private void assertEqualRoutes(Collection<RouteInfo> expected, Collection<RouteInfo> actual) {
+        Set<RouteInfo> expectedSet = new ArraySet<>(expected);
+        Set<RouteInfo> actualSet = new ArraySet<>(actual);
+        // Duplicated entries in actual routes are considered failures
+        assertEquals(actual.size(), actualSet.size());
+
+        assertEquals(expectedSet, actualSet);
+    }
 }
diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
index ce390e8..dd1a1e4 100644
--- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java
+++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
@@ -329,6 +329,7 @@
                     Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL,
                     Settings.Global.SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS,
                     Settings.Global.STORAGE_BENCHMARK_INTERVAL,
+                    Settings.Global.STORAGE_SETTINGS_CLOBBER_THRESHOLD,
                     Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
                     Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL,
                     Settings.Global.SYS_STORAGE_CACHE_MAX_BYTES,
diff --git a/core/tests/coretests/src/android/text/LayoutTest.java b/core/tests/coretests/src/android/text/LayoutTest.java
index 0cc41ba..9cf8e1e 100644
--- a/core/tests/coretests/src/android/text/LayoutTest.java
+++ b/core/tests/coretests/src/android/text/LayoutTest.java
@@ -299,7 +299,8 @@
          */
 
         layout.getSelection(5 /* startIndex */, 5 /* endIndex */,
-                (left, top, right, bottom) -> fail(String.format(Locale.getDefault(),
+                (left, top, right, bottom, textSelectionLayout) -> fail(
+                        String.format(Locale.getDefault(),
                         "Did not expect any rectangles, got a rectangle with (left: %f,"
                                 + " top: %f), (right: %f, bottom: %f)",
                         left, top, right, bottom)));
@@ -313,7 +314,8 @@
         final List<RectF> rectangles = new ArrayList<>();
 
         layout.getSelection(0 /* startIndex */, 1 /* endIndex */,
-                (left, top, right, bottom) -> rectangles.add(new RectF(left, top, right, bottom)));
+                (left, top, right, bottom, textSelectionLayout) -> rectangles.add(
+                        new RectF(left, top, right, bottom)));
 
         /*
          * The selection we expect will only cover the letter "a". Hence, we expect one rectangle
@@ -343,7 +345,8 @@
         final List<RectF> rectangles = new ArrayList<>();
 
         layout.getSelection(0 /* startIndex */, 2 /* endIndex */,
-                (left, top, right, bottom) -> rectangles.add(new RectF(left, top, right, bottom)));
+                (left, top, right, bottom, textSelectionLayout) -> rectangles.add(
+                        new RectF(left, top, right, bottom)));
 
         /*
          * The selection that will be selected is "a\n" - the selection starts at the beginning
@@ -388,7 +391,8 @@
         final List<RectF> rectangles = new ArrayList<>();
 
         layout.getSelection(0 /* startIndex */, 3 /* endIndex */,
-                (left, top, right, bottom) -> rectangles.add(new RectF(left, top, right, bottom)));
+                (left, top, right, bottom, textSelectionLayout) -> rectangles.add(
+                        new RectF(left, top, right, bottom)));
 
         /*
          * The selection that will be selected is "a\nb" - the selection starts at the beginning
@@ -430,7 +434,8 @@
         final List<RectF> rectangles = new ArrayList<>();
 
         layout.getSelection(0 /* startIndex */, 1 /* endIndex */,
-                (left, top, right, bottom) -> rectangles.add(new RectF(left, top, right, bottom)));
+                (left, top, right, bottom, textSelectionLayout) -> rectangles.add(
+                        new RectF(left, top, right, bottom)));
 
         /*
          * In the single line selection case, we expect that only one rectangle covering the letter
@@ -455,6 +460,44 @@
     }
 
     @Test
+    public void testGetSelection_latinTextDirection() {
+        final Layout layout = new StaticLayout("abc", mTextPaint, Integer.MAX_VALUE,
+                Alignment.ALIGN_LEFT, mSpacingMult, mSpacingAdd, false);
+
+        layout.getSelection(0 /* startIndex */, 2 /* endIndex */,
+                (left, top, right, bottom, textSelectionLayout) ->
+                        assertEquals(Layout.TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT,
+                                textSelectionLayout));
+    }
+
+    @Test
+    public void testGetSelection_arabicTextDirection() {
+        final Layout layout = new StaticLayout("غينيا", mTextPaint, Integer.MAX_VALUE,
+                Alignment.ALIGN_LEFT, mSpacingMult, mSpacingAdd, false);
+
+        layout.getSelection(0 /* startIndex */, 2 /* endIndex */,
+                (left, top, right, bottom, textSelectionLayout) ->
+                        assertEquals(Layout.TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT,
+                                textSelectionLayout));
+    }
+
+    @Test
+    public void testGetSelection_mixedLatinAndArabicTextDirection() {
+        final Layout layout = new StaticLayout("abcغينيا", mTextPaint, Integer.MAX_VALUE,
+                Alignment.ALIGN_LEFT, mSpacingMult, mSpacingAdd, false);
+
+        final List<Integer> layouts = new ArrayList<>(2);
+
+        layout.getSelection(0 /* startIndex */, 6 /* endIndex */,
+                (left, top, right, bottom, textSelectionLayout) -> layouts.add(
+                        textSelectionLayout));
+
+        assertEquals(2, layouts.size());
+        assertEquals(Layout.TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT, (long) layouts.get(0));
+        assertEquals(Layout.TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT, (long) layouts.get(1));
+    }
+
+    @Test
     public void testIsSpanned() {
         MockLayout layout = new MockLayout(LAYOUT_TEXT, mTextPaint, mWidth,
                 mAlign, mSpacingMult, mSpacingAdd);
diff --git a/core/tests/coretests/src/android/util/TimingsTraceLogTest.java b/core/tests/coretests/src/android/util/TimingsTraceLogTest.java
new file mode 100644
index 0000000..7bb4ab8
--- /dev/null
+++ b/core/tests/coretests/src/android/util/TimingsTraceLogTest.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.util;
+
+import static org.junit.Assert.assertTrue;
+
+import android.os.Trace;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * Tests for {@link TimingsTraceLog}.
+ * <p>Usage: bit FrameworksCoreTests:android.util.TimingsTraceLogTest
+ */
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class TimingsTraceLogTest {
+
+    @Test
+    public void testDifferentThreads() throws Exception {
+        TimingsTraceLog log = new TimingsTraceLog("TEST", Trace.TRACE_TAG_APP);
+        // Should be able to log on the same thread
+        log.traceBegin("test");
+        log.traceEnd();
+        final List<String> errors = new ArrayList<>();
+        // Calling from a different thread should fail
+        Thread t = new Thread(() -> {
+            try {
+                log.traceBegin("test");
+                errors.add("traceBegin should fail on a different thread");
+            } catch (IllegalStateException expected) {
+            }
+            try {
+                log.traceEnd();
+                errors.add("traceEnd should fail on a different thread");
+            } catch (IllegalStateException expected) {
+            }
+            // Verify that creating a new log will work
+            TimingsTraceLog log2 = new TimingsTraceLog("TEST", Trace.TRACE_TAG_APP);
+            log2.traceBegin("test");
+            log2.traceEnd();
+
+        });
+        t.start();
+        t.join();
+        assertTrue(errors.toString(), errors.isEmpty());
+    }
+
+}
diff --git a/core/tests/coretests/src/android/widget/RemoteViewsTest.java b/core/tests/coretests/src/android/widget/RemoteViewsTest.java
index bf994a9..d26437e 100644
--- a/core/tests/coretests/src/android/widget/RemoteViewsTest.java
+++ b/core/tests/coretests/src/android/widget/RemoteViewsTest.java
@@ -16,6 +16,10 @@
 
 package android.widget;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.drawable.BitmapDrawable;
@@ -36,10 +40,6 @@
 import org.junit.rules.ExpectedException;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.concurrent.CountDownLatch;
@@ -336,7 +336,9 @@
             parent.addView(R.id.layout, views);
             views = parent;
         }
+        // Both clone and parcel/unparcel work,
         views.clone();
+        parcelAndRecreate(views);
 
         views = new RemoteViews(mPackage, R.layout.remote_views_test);
         for (int i = 0; i < 11; i++) {
@@ -344,8 +346,10 @@
             parent.addView(R.id.layout, views);
             views = parent;
         }
-        exception.expect(IllegalArgumentException.class);
+        // Clone works but parcel/unparcel fails
         views.clone();
+        exception.expect(IllegalArgumentException.class);
+        parcelAndRecreate(views);
     }
 
     @Test
@@ -355,15 +359,27 @@
             views = new RemoteViews(views,
                     new RemoteViews(mPackage, R.layout.remote_views_test));
         }
+        // Both clone and parcel/unparcel work,
         views.clone();
+        parcelAndRecreate(views);
 
         views = new RemoteViews(mPackage, R.layout.remote_views_test);
         for (int i = 0; i < 11; i++) {
-            RemoteViews parent = new RemoteViews(mPackage, R.layout.remote_views_test);
-            parent.addView(R.id.layout, views);
-            views = parent;
+            views = new RemoteViews(views,
+                    new RemoteViews(mPackage, R.layout.remote_views_test));
         }
-        exception.expect(IllegalArgumentException.class);
+        // Clone works but parcel/unparcel fails
         views.clone();
+        exception.expect(IllegalArgumentException.class);
+        parcelAndRecreate(views);
+    }
+
+    private void parcelAndRecreate(RemoteViews views) {
+        Parcel p = Parcel.obtain();
+        views.writeToParcel(p, 0);
+        p.setDataPosition(0);
+
+        RemoteViews.CREATOR.createFromParcel(p);
+        p.recycle();
     }
 }
diff --git a/core/tests/coretests/src/android/widget/SelectionActionModeHelperTest.java b/core/tests/coretests/src/android/widget/SelectionActionModeHelperTest.java
index d94a017..b881053 100644
--- a/core/tests/coretests/src/android/widget/SelectionActionModeHelperTest.java
+++ b/core/tests/coretests/src/android/widget/SelectionActionModeHelperTest.java
@@ -25,6 +25,7 @@
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
@@ -110,4 +111,154 @@
         assertEquals(expectedPointY, adjustedPoint.y, 0.0f);
     }
 
+    @Test
+    public void testMergeRectangleIntoList_addThreeDisjointRectangles() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0, 0, 1, 1),
+                        new RectF(10, 10, 11, 11),
+                        new RectF(20, 20, 21, 21)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 1, 1),
+                        new RectF(10, 10, 11, 11),
+                        new RectF(20, 20, 21, 21)
+                }
+        );
+    }
+
+    @Test
+    public void testMergeRectangleIntoList_addAnEmptyRectangle() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0, 0, 0, 0)
+                },
+                new RectF[] {
+                }
+        );
+    }
+
+    @Test
+    public void testMergeRectangleIntoList_addAContainedRectangle() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0, 0, 10, 10),
+                        new RectF(9, 0, 10, 10)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 10, 10)
+                }
+        );
+    }
+
+    @Test
+    public void testMergeRectangleIntoList_addARectangleThatContainsExistingRectangles() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0, 0, 1, 1),
+                        new RectF(1, 0, 2, 1),
+                        new RectF(0, 0, 2, 1)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 2, 1)
+                }
+        );
+    }
+
+    @Test
+    public void testMergeRectangleIntoList_addRectangleThatIntersectsAndHasTheSameHeightOnRight() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0, 0, 1, 1),
+                        new RectF(0.5f, 0, 1.5f, 1)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 1.5f, 1)
+                }
+        );
+    }
+
+    @Test
+    public void testMergeRectangleIntoList_addRectangleThatIntersectsAndHasTheSameHeightOnLeft() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0.5f, 0, 1.5f, 1),
+                        new RectF(0, 0, 1, 1)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 1.5f, 1)
+                }
+        );
+    }
+
+    @Test
+    public void testMergeRectangleIntoList_addRectangleThatExpandsToTheRight() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0, 0, 1, 1),
+                        new RectF(1, 0, 1.5f, 1)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 1.5f, 1)
+                }
+        );
+    }
+
+    @Test
+    public void testMergeRectangleIntoList_addRectangleThatExpandsToTheLeft() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(1, 0, 1.5f, 1),
+                        new RectF(0, 0, 1, 1)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 1.5f, 1)
+                }
+        );
+    }
+
+
+    @Test
+    public void testMergeRectangleIntoList_addRectangleMadeObsoleteByMultipleExistingRectangles() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0, 0, 1, 1),
+                        new RectF(0.5f, 0, 1.5f, 1),
+                        new RectF(0.25f, 0, 1.25f, 1)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 1.5f, 1)
+                }
+        );
+    }
+
+    @Test
+    public void testMergeRectangleIntoList_threeRectanglesThatTouchEachOther() {
+        testExpandRectangleList(
+                new RectF[] {
+                        new RectF(0, 0, 1, 1),
+                        new RectF(1, 0, 2, 1),
+                        new RectF(2, 0, 3, 1)
+                },
+                new RectF[] {
+                        new RectF(0, 0, 3, 1)
+                }
+        );
+    }
+
+
+    private void testExpandRectangleList(final RectF[] inputRectangles,
+            final RectF[] outputRectangles) {
+        final List<RectF> expectedOutput = Arrays.asList(outputRectangles);
+
+        final List<RectF> result = new ArrayList<>();
+        final int size = inputRectangles.length;
+        for (int index = 0; index < size; ++index) {
+            SelectionActionModeHelper.mergeRectangleIntoList(result, inputRectangles[index]);
+        }
+
+        assertEquals(expectedOutput, result);
+    }
+
+
 }
diff --git a/core/tests/utiltests/jni/Android.bp b/core/tests/utiltests/jni/Android.bp
index e9a4144..b0b09c2 100644
--- a/core/tests/utiltests/jni/Android.bp
+++ b/core/tests/utiltests/jni/Android.bp
@@ -17,7 +17,6 @@
     shared_libs: [

         "libcutils",

     ],

-    clang: true,

     stl: "libc++",

     srcs: [

         "registration.cpp",

diff --git a/data/etc/platform.xml b/data/etc/platform.xml
index 26741fe..7e24530 100644
--- a/data/etc/platform.xml
+++ b/data/etc/platform.xml
@@ -170,7 +170,7 @@
     <library name="javax.obex"
             file="/system/framework/javax.obex.jar" />
     <library name="org.apache.http.legacy"
-            file="/system/framework/org.apache.http.legacy.jar" />
+            file="/system/framework/org.apache.http.legacy.boot.jar" />
 
     <!-- These are the standard packages that are white-listed to always have internet
          access while in power save mode, even if they aren't in the foreground. -->
diff --git a/data/keyboards/Vendor_054c_Product_09cc.kl b/data/keyboards/Vendor_054c_Product_09cc.kl
new file mode 100644
index 0000000..f465733
--- /dev/null
+++ b/data/keyboards/Vendor_054c_Product_09cc.kl
@@ -0,0 +1,67 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Sony Playstation(R) DualShock 4 Controller
+#
+
+
+# Mapping according to https://developer.android.com/training/game-controllers/controller-input.html
+
+# Square
+key 0x130    BUTTON_X
+# Cross
+key 0x131    BUTTON_A
+# Circle
+key 0x132    BUTTON_B
+# Triangle
+key 0x133    BUTTON_Y
+
+key 0x134    BUTTON_L1
+key 0x135    BUTTON_R1
+key 0x136    BUTTON_L2
+key 0x137    BUTTON_R2
+
+# L2 axis
+axis 0x03   LTRIGGER
+# R2 axis
+axis 0x04   RTRIGGER
+
+
+# Left Analog Stick
+axis 0x00    X
+axis 0x01    Y
+# Right Analog Stick
+axis 0x02    Z
+axis 0x05    RZ
+
+# Left stick click
+key 0x13a    BUTTON_THUMBL
+# Right stick click
+key 0x13b    BUTTON_THUMBR
+
+# Hat
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
+
+# Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt
+# Share
+key 0x138    BUTTON_SELECT
+# Options
+key 0x139    BUTTON_START
+
+# PS key
+key 0x13c    HOME
+# Touchpad press
+key 0x13d   BUTTON_MODE
diff --git a/data/sounds/AudioPackageGo.mk b/data/sounds/AudioPackageGo.mk
index 3756d30..ae742df 100644
--- a/data/sounds/AudioPackageGo.mk
+++ b/data/sounds/AudioPackageGo.mk
@@ -40,3 +40,9 @@
     $(LOCAL_PATH)/Alarm_Beep_03.ogg:system/media/audio/alarms/Alarm_Beep_03.ogg \
     $(LOCAL_PATH)/alarms/ogg/Helium.ogg:system/media/audio/alarms/Helium.ogg \
     $(LOCAL_PATH)/alarms/ogg/Oxygen.ogg:system/media/audio/alarms/Oxygen.ogg \
+    $(LOCAL_PATH)/effects/ogg/Effect_Tick.ogg:system/media/audio/ui/Effect_Tick.ogg \
+    $(LOCAL_PATH)/effects/ogg/KeypressStandard.ogg:system/media/audio/ui/KeypressStandard.ogg \
+    $(LOCAL_PATH)/effects/ogg/KeypressSpacebar.ogg:system/media/audio/ui/KeypressSpacebar.ogg \
+    $(LOCAL_PATH)/effects/ogg/KeypressDelete.ogg:system/media/audio/ui/KeypressDelete.ogg \
+    $(LOCAL_PATH)/effects/ogg/KeypressInvalid.ogg:system/media/audio/ui/KeypressInvalid.ogg \
+    $(LOCAL_PATH)/effects/ogg/KeypressReturn.ogg:system/media/audio/ui/KeypressReturn.ogg \
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index ccf9de0..7e959a8 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -754,6 +754,8 @@
                 // None of the key's SIDs can ever be authenticated
                 return new KeyPermanentlyInvalidatedException();
             }
+            case UNINITIALIZED:
+                return new KeyPermanentlyInvalidatedException();
             default:
                 return new InvalidKeyException("Keystore operation failed", e);
         }
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index aa6d2f3..4a5b2c7 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -162,8 +162,8 @@
     void addRenderNode(RenderNode* node, bool placeFront);
     void removeRenderNode(RenderNode* node);
 
-    void setContentDrawBounds(int left, int top, int right, int bottom) {
-        mContentDrawBounds.set(left, top, right, bottom);
+    void setContentDrawBounds(const Rect& bounds) {
+        mContentDrawBounds = bounds;
     }
 
     RenderState& getRenderState() {
diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp
index 7d641d3..a097272 100644
--- a/libs/hwui/renderthread/DrawFrameTask.cpp
+++ b/libs/hwui/renderthread/DrawFrameTask.cpp
@@ -32,6 +32,7 @@
 DrawFrameTask::DrawFrameTask()
         : mRenderThread(nullptr)
         , mContext(nullptr)
+        , mContentDrawBounds(0, 0, 0, 0)
         , mSyncResult(SyncResult::OK) {
 }
 
@@ -123,6 +124,7 @@
         mLayers[i]->apply();
     }
     mLayers.clear();
+    mContext->setContentDrawBounds(mContentDrawBounds);
     mContext->prepareTree(info, mFrameInfo, mSyncQueued, mTargetNode);
 
     // This is after the prepareTree so that any pending operations
diff --git a/libs/hwui/renderthread/DrawFrameTask.h b/libs/hwui/renderthread/DrawFrameTask.h
index fb48062..83ecb98 100644
--- a/libs/hwui/renderthread/DrawFrameTask.h
+++ b/libs/hwui/renderthread/DrawFrameTask.h
@@ -61,6 +61,9 @@
     virtual ~DrawFrameTask();
 
     void setContext(RenderThread* thread, CanvasContext* context, RenderNode* targetNode);
+    void setContentDrawBounds(int left, int top, int right, int bottom) {
+        mContentDrawBounds.set(left, top, right, bottom);
+    }
 
     void pushLayerUpdate(DeferredLayerUpdater* layer);
     void removeLayerUpdate(DeferredLayerUpdater* layer);
@@ -82,6 +85,7 @@
     RenderThread* mRenderThread;
     CanvasContext* mContext;
     RenderNode* mTargetNode = nullptr;
+    Rect mContentDrawBounds;
 
     /*********************************************
      *  Single frame data
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 6904743..a6aa301 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -551,20 +551,8 @@
     staticPostAndWait(task);
 }
 
-CREATE_BRIDGE5(setContentDrawBounds, CanvasContext* context, int left, int top,
-        int right, int bottom) {
-    args->context->setContentDrawBounds(args->left, args->top, args->right, args->bottom);
-    return nullptr;
-}
-
 void RenderProxy::setContentDrawBounds(int left, int top, int right, int bottom) {
-    SETUP_TASK(setContentDrawBounds);
-    args->context = mContext;
-    args->left = left;
-    args->top = top;
-    args->right = right;
-    args->bottom = bottom;
-    staticPostAndWait(task);
+    mDrawFrameTask.setContentDrawBounds(left, top, right, bottom);
 }
 
 CREATE_BRIDGE1(serializeDisplayListTree, CanvasContext* context) {
diff --git a/libs/incident/include/android/os/IncidentReportArgs.h b/libs/incident/include/android/os/IncidentReportArgs.h
index 956ef6c..da80989 100644
--- a/libs/incident/include/android/os/IncidentReportArgs.h
+++ b/libs/incident/include/android/os/IncidentReportArgs.h
@@ -39,12 +39,13 @@
     virtual status_t readFromParcel(const Parcel* in);
 
     void setAll(bool all);
+    void setDest(int dest);
     void addSection(int section);
     void addHeader(const vector<int8_t>& header);
 
-    inline bool all() const { return mAll; };
+    inline bool all() const { return mAll; }
     bool containsSection(int section) const;
-
+    inline int dest() const { return mDest; }
     inline const set<int>& sections() const { return mSections; }
     inline const vector<vector<int8_t>>& headers() const { return mHeaders; }
 
@@ -54,6 +55,7 @@
     set<int> mSections;
     vector<vector<int8_t>> mHeaders;
     bool mAll;
+    int mDest;
 };
 
 }
diff --git a/libs/incident/src/IncidentReportArgs.cpp b/libs/incident/src/IncidentReportArgs.cpp
index f604909..e628722 100644
--- a/libs/incident/src/IncidentReportArgs.cpp
+++ b/libs/incident/src/IncidentReportArgs.cpp
@@ -25,14 +25,16 @@
 
 IncidentReportArgs::IncidentReportArgs()
     :mSections(),
-     mAll(false)
+     mAll(false),
+     mDest(-1)
 {
 }
 
 IncidentReportArgs::IncidentReportArgs(const IncidentReportArgs& that)
     :mSections(that.mSections),
      mHeaders(that.mHeaders),
-     mAll(that.mAll)
+     mAll(that.mAll),
+     mDest(that.mDest)
 {
 }
 
@@ -74,6 +76,11 @@
         }
     }
 
+    err = out->writeInt32(mDest);
+    if (err != NO_ERROR) {
+        return err;
+    }
+
     return NO_ERROR;
 }
 
@@ -120,6 +127,13 @@
         }
     }
 
+    int32_t dest;
+    err = in->readInt32(&dest);
+    if (err != NO_ERROR) {
+        return err;
+    }
+    mDest = dest;
+
     return OK;
 }
 
@@ -133,6 +147,12 @@
 }
 
 void
+IncidentReportArgs::setDest(int dest)
+{
+    mDest = dest;
+}
+
+void
 IncidentReportArgs::addSection(int section)
 {
     if (!mAll) {
diff --git a/libs/usb/Android.bp b/libs/usb/Android.bp
new file mode 100644
index 0000000..b8f2904
--- /dev/null
+++ b/libs/usb/Android.bp
@@ -0,0 +1 @@
+subdirs = ["tests/*"]
diff --git a/libs/usb/tests/AccessoryChat/Android.bp b/libs/usb/tests/AccessoryChat/Android.bp
new file mode 100644
index 0000000..4af6274
--- /dev/null
+++ b/libs/usb/tests/AccessoryChat/Android.bp
@@ -0,0 +1 @@
+subdirs = ["accessorychat"]
diff --git a/libs/usb/tests/AccessoryChat/accessorychat/Android.bp b/libs/usb/tests/AccessoryChat/accessorychat/Android.bp
new file mode 100644
index 0000000..5613745
--- /dev/null
+++ b/libs/usb/tests/AccessoryChat/accessorychat/Android.bp
@@ -0,0 +1,30 @@
+cc_binary {
+    name: "accessorychat",
+    host_supported: true,
+
+    srcs: ["accessorychat.c"],
+    cflags: [
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
+
+    target: {
+        android: {
+            shared_libs: [
+                "libusbhost",
+                "libcutils",
+            ],
+        },
+        host: {
+            static_libs: [
+                "libusbhost",
+                "libcutils",
+            ],
+
+            cflags: ["-O0"],
+        },
+        darwin: {
+            enabled: false,
+        },
+    },
+}
diff --git a/libs/usb/tests/AccessoryChat/accessorychat/Android.mk b/libs/usb/tests/AccessoryChat/accessorychat/Android.mk
deleted file mode 100644
index 51f2111..0000000
--- a/libs/usb/tests/AccessoryChat/accessorychat/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-# Build for Linux (desktop) host
-ifeq ($(HOST_OS),linux)
-
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := accessorychat.c
-
-LOCAL_MODULE := accessorychat
-
-LOCAL_STATIC_LIBRARIES := libusbhost libcutils
-LOCAL_LDLIBS += -lpthread
-LOCAL_CFLAGS := -g -O0
-
-include $(BUILD_HOST_EXECUTABLE)
-
-endif
-
-# Build for device
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := accessorychat.c
-
-LOCAL_MODULE := accessorychat
-
-LOCAL_SHARED_LIBRARIES := libusbhost libcutils
-
-include $(BUILD_EXECUTABLE)
diff --git a/libs/usb/tests/accessorytest/Android.bp b/libs/usb/tests/accessorytest/Android.bp
new file mode 100644
index 0000000..c6340e3
--- /dev/null
+++ b/libs/usb/tests/accessorytest/Android.bp
@@ -0,0 +1,28 @@
+cc_binary_host {
+    name: "accessorytest",
+
+    srcs: [
+        "accessory.c",
+        "audio.c",
+        "hid.c",
+        "usb.c",
+    ],
+
+    static_libs: [
+        "libusbhost",
+        "libcutils",
+        "libtinyalsa",
+    ],
+    cflags: [
+        "-O0",
+        "-Wno-unused-parameter",
+        "-Werror",
+    ],
+
+    target: {
+        darwin: {
+            // Build for Linux host only
+            enabled: false,
+        },
+    },
+}
diff --git a/libs/usb/tests/accessorytest/Android.mk b/libs/usb/tests/accessorytest/Android.mk
deleted file mode 100644
index 6d9a946..0000000
--- a/libs/usb/tests/accessorytest/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-# Build for Linux host only
-ifeq ($(HOST_OS),linux)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES :=  accessory.c \
-                    audio.c     \
-                    hid.c       \
-                    usb.c
-
-LOCAL_C_INCLUDES += external/tinyalsa/include
-
-LOCAL_MODULE := accessorytest
-
-LOCAL_STATIC_LIBRARIES := libusbhost libcutils libtinyalsa
-LOCAL_LDLIBS += -lpthread
-LOCAL_CFLAGS := -g -O0
-
-include $(BUILD_HOST_EXECUTABLE)
-
-endif
diff --git a/libs/usb/tests/accessorytest/accessory.h b/libs/usb/tests/accessorytest/accessory.h
index 55c4550..e86986e 100644
--- a/libs/usb/tests/accessorytest/accessory.h
+++ b/libs/usb/tests/accessorytest/accessory.h
@@ -19,7 +19,7 @@
 
 int init_audio(unsigned int ic, unsigned int id, unsigned int oc, unsigned int od);
 void init_hid();
-void usb_run(int enable_accessory);
+void usb_run(uintptr_t enable_accessory);
 
 struct usb_device* usb_wait_for_device();
 
diff --git a/libs/usb/tests/accessorytest/hid.c b/libs/usb/tests/accessorytest/hid.c
index b70d678..283755d 100644
--- a/libs/usb/tests/accessorytest/hid.c
+++ b/libs/usb/tests/accessorytest/hid.c
@@ -139,7 +139,7 @@
 
     fprintf(stderr, "opened /dev/%s\n", name);
     pthread_t th;
-    pthread_create(&th, NULL, hid_thread, (void *)fd);
+    pthread_create(&th, NULL, hid_thread, (void *)(uintptr_t)fd);
 }
 
 static void* inotify_thread(void* arg)
diff --git a/libs/usb/tests/accessorytest/usb.c b/libs/usb/tests/accessorytest/usb.c
index ac72b35..1a161ad 100644
--- a/libs/usb/tests/accessorytest/usb.c
+++ b/libs/usb/tests/accessorytest/usb.c
@@ -219,7 +219,7 @@
     return device;
 }
 
-void usb_run(int enable_accessory) {
+void usb_run(uintptr_t enable_accessory) {
     struct usb_host_context* context = usb_host_init();
 
     usb_host_run(context, usb_device_added, usb_device_removed, NULL, (void *)enable_accessory);
diff --git a/media/java/android/media/session/MediaSession.java b/media/java/android/media/session/MediaSession.java
index 1291dfb..b8184a0 100644
--- a/media/java/android/media/session/MediaSession.java
+++ b/media/java/android/media/session/MediaSession.java
@@ -119,7 +119,7 @@
     private final ISession mBinder;
     private final CallbackStub mCbStub;
 
-    private CallbackMessageHandler mCallback;
+    private CallbackMessageHandler mCallbackHandler;
     private VolumeProvider mVolumeProvider;
     private PlaybackState mPlaybackState;
 
@@ -194,16 +194,14 @@
      */
     public void setCallback(@Nullable Callback callback, @Nullable Handler handler) {
         synchronized (mLock) {
-            if (callback == null) {
-                if (mCallback != null) {
-                    mCallback.mCallback.mSession = null;
-                }
-                mCallback = null;
-                return;
-            }
-            if (mCallback != null) {
+            if (mCallbackHandler != null) {
                 // We're updating the callback, clear the session from the old one.
-                mCallback.mCallback.mSession = null;
+                mCallbackHandler.mCallback.mSession = null;
+                mCallbackHandler.removeCallbacksAndMessages(null);
+            }
+            if (callback == null) {
+                mCallbackHandler = null;
+                return;
             }
             if (handler == null) {
                 handler = new Handler();
@@ -211,7 +209,7 @@
             callback.mSession = this;
             CallbackMessageHandler msgHandler = new CallbackMessageHandler(handler.getLooper(),
                     callback);
-            mCallback = msgHandler;
+            mCallbackHandler = msgHandler;
         }
     }
 
@@ -636,8 +634,8 @@
 
     private void postToCallback(int what, Object obj, Bundle extras) {
         synchronized (mLock) {
-            if (mCallback != null) {
-                mCallback.post(what, obj, extras);
+            if (mCallbackHandler != null) {
+                mCallbackHandler.post(what, obj, extras);
             }
         }
     }
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 2d008c7..022198b 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -137,7 +137,7 @@
     mLooper->start(
             false,      // runOnCallingThread
             true,       // canCallJava
-            PRIORITY_FOREGROUND);
+            ANDROID_PRIORITY_VIDEO);
 
     if (nameIsType) {
         mCodec = MediaCodec::CreateByType(mLooper, name, encoder, &mInitStatus);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java
index fcb861c..cf5882f 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java
@@ -271,7 +271,7 @@
          * @see android.hardware.camera2.ICameraDeviceCallbacks#onRepeatingRequestError()
          */
         @Override
-        public void onRepeatingRequestError(long lastFrameNumber) {
+        public void onRepeatingRequestError(long lastFrameNumber, int repeatingRequestId) {
             // TODO Auto-generated method stub
         }
     }
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java
index 476f016..e628b68 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java
@@ -161,7 +161,7 @@
          * @see android.hardware.camera2.ICameraDeviceCallbacks#onRepeatingRequestError()
          */
         @Override
-        public void onRepeatingRequestError(long lastFrameNumber) {
+        public void onRepeatingRequestError(long lastFrameNumber, int repeatingRequestId) {
             // TODO Auto-generated method stub
         }
     }
diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
index a61881f..95ec83d 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
@@ -181,7 +181,8 @@
     }
 
     private void done(boolean success) {
-        if (DBG) logd(String.format("Result success %b for %s", success, mUrl.toString()));
+        if (DBG) logd(String.format("Result success %b for %s", success,
+                mUrl != null ? mUrl.toString() : "null"));
         if (success) {
             // Trigger re-evaluation upon success http response code
             CarrierActionUtils.applyCarrierAction(
diff --git a/packages/EasterEgg/AndroidManifest.xml b/packages/EasterEgg/AndroidManifest.xml
index 14861c26..172490d 100644
--- a/packages/EasterEgg/AndroidManifest.xml
+++ b/packages/EasterEgg/AndroidManifest.xml
@@ -84,5 +84,16 @@
                 <action android:name="android.service.quicksettings.action.QS_TILE" />
             </intent-filter>
         </service>
+
+        <!-- FileProvider for sending pictures -->
+        <provider
+                android:name="android.support.v4.content.FileProvider"
+                android:authorities="com.android.egg.fileprovider"
+                android:grantUriPermissions="true"
+                android:exported="false">
+            <meta-data
+                    android:name="android.support.FILE_PROVIDER_PATHS"
+                    android:resource="@xml/filepaths" />
+        </provider>
     </application>
 </manifest>
diff --git a/packages/EasterEgg/res/drawable/food_cookie.xml b/packages/EasterEgg/res/drawable/food_cookie.xml
new file mode 100644
index 0000000..74dd134
--- /dev/null
+++ b/packages/EasterEgg/res/drawable/food_cookie.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (C) 2017 The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <group>
+        <path
+            android:fillColor="#55FFFFFF"
+            android:fillType="evenOdd"
+            android:pathData="M5.71 18.29A8.99 8.99 0 0 0 22 13c0-3-1.46-5.65-3.71-7.29A8.99 8.99 0 0 0 2 11c0 3 1.46 5.65 3.71 7.29z"/>
+        <path
+            android:fillColor="#FFFFFFFF"
+            android:fillType="evenOdd"
+            android:pathData="M7.25 19.18A8.5 8.5 0 0 0 19.19 7.24 9 9 0 0 1 7.24 19.19z"/>
+        <path
+            android:fillColor="#55FFFFFF"
+            android:pathData="M10.5 3a0.5 0.5 0 1 1 1 0v2.05a0.5 0.5 0 1 1-1 0V3zm3.1 0.42a0.5 0.5 0 0 1 0.93 0.39l-0.8 1.88A0.5 0.5 0 1 1 12.8 5.3l0.8-1.88zm2.7 1.57a0.5 0.5 0 1 1 0.71 0.7l-1.45 1.46a0.5 0.5 0 0 1-0.7-0.71l1.44-1.45zm1.9 2.5a0.5 0.5 0 0 1 0.38 0.92l-1.9 0.77a0.5 0.5 0 0 1-0.37-0.93l1.9-0.77zM19 10.5a0.5 0.5 0 1 1 0 1h-2.05a0.5 0.5 0 0 1 0-1H19zm-0.42 3.1a0.5 0.5 0 0 1-0.39 0.93l-1.88-0.8a0.5 0.5 0 1 1 0.39-0.92l1.88 0.8zm-1.57 2.7a0.5 0.5 0 1 1-0.7 0.71l-1.46-1.45a0.5 0.5 0 0 1 0.71-0.7l1.45 1.44zm-2.5 1.9a0.5 0.5 0 1 1-0.92 0.38l-0.77-1.9a0.5 0.5 0 0 1 0.93-0.37l0.77 1.9zM11.5 19a0.5 0.5 0 1 1-1 0v-2.05a0.5 0.5 0 0 1 1 0V19zm-3.1-0.42a0.5 0.5 0 0 1-0.93-0.39l0.8-1.88A0.5 0.5 0 0 1 9.2 16.7l-0.8 1.88zm-2.7-1.57a0.5 0.5 0 1 1-0.71-0.7l1.45-1.46a0.5 0.5 0 0 1 0.7 0.71L5.7 17.01zm-1.9-2.48a0.5 0.5 0 0 1-0.38-0.92l1.88-0.8a0.5 0.5 0 0 1 0.4 0.92l-1.9 0.8zM3 11.5a0.5 0.5 0 1 1 0-1h2.05a0.5 0.5 0 1 1 0 1H3zm0.42-3.1A0.5 0.5 0 0 1 3.8 7.46l1.88 0.8A0.5 0.5 0 1 1 5.3 9.2L3.42 8.4zm1.57-2.7a0.5 0.5 0 1 1 0.7-0.71l1.46 1.45a0.5 0.5 0 0 1-0.71 0.7L4.99 5.7zm2.5-1.9A0.5 0.5 0 0 1 8.4 3.41l0.77 1.9a0.5 0.5 0 0 1-0.93 0.37L7.48 3.8z"/>
+    </group>
+</vector>
\ No newline at end of file
diff --git a/packages/EasterEgg/res/values/strings.xml b/packages/EasterEgg/res/values/strings.xml
index 8478a43..61e3834 100644
--- a/packages/EasterEgg/res/values/strings.xml
+++ b/packages/EasterEgg/res/values/strings.xml
@@ -17,6 +17,7 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
     <string name="app_name" translatable="false">Android Easter Egg</string>
     <string name="notification_name" translatable="false">Android Neko</string>
+    <string name="notification_channel_name" translatable="false">New cats</string>
     <string name="default_tile_name" translatable="false">\????</string>
     <string name="notification_title" translatable="false">A cat is here.</string>
     <string name="default_cat_name" translatable="false">Cat #%s</string>
@@ -34,7 +35,7 @@
         <item>@drawable/food_bits</item>
         <item>@drawable/food_sysuituna</item>
         <item>@drawable/food_chicken</item>
-        <item>@drawable/food_donut</item>
+        <item>@drawable/food_cookie</item>
     </array>
     <integer-array name="food_intervals">
         <item>0</item>
diff --git a/packages/EasterEgg/res/xml/filepaths.xml b/packages/EasterEgg/res/xml/filepaths.xml
new file mode 100644
index 0000000..2130025
--- /dev/null
+++ b/packages/EasterEgg/res/xml/filepaths.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (C) 2017 The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<paths>
+    <external-path name="cats" path="Pictures/Cats" />
+</paths>
\ No newline at end of file
diff --git a/packages/EasterEgg/src/com/android/egg/neko/Cat.java b/packages/EasterEgg/src/com/android/egg/neko/Cat.java
index a4df372..dd1bd07 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/Cat.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/Cat.java
@@ -31,6 +31,8 @@
 import com.android.egg.R;
 import com.android.internal.logging.MetricsLogger;
 
+import static com.android.egg.neko.NekoLand.CHAN_ID;
+
 public class Cat extends Drawable {
     public static final long[] PURR = {0, 40, 20, 40, 20, 40, 20, 40, 20, 40, 20, 40};
 
@@ -218,6 +220,7 @@
                 .setContentText(getName())
                 .setContentIntent(PendingIntent.getActivity(context, 0, intent, 0))
                 .setAutoCancel(true)
+                .setChannel(CHAN_ID)
                 .setVibrate(PURR)
                 .addExtras(extras);
     }
diff --git a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
index 689e381..d2e37d8 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java
@@ -31,6 +31,7 @@
 import android.os.Bundle;
 import android.os.Environment;
 import android.provider.MediaStore.Images;
+import android.support.v4.content.FileProvider;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.util.Log;
@@ -56,6 +57,8 @@
 import java.util.List;
 
 public class NekoLand extends Activity implements PrefsListener {
+    public static String CHAN_ID = "EGG";
+
     public static boolean DEBUG = false;
     public static boolean DEBUG_NOTIFICATIONS = false;
 
@@ -289,10 +292,13 @@
                         new String[] {png.toString()},
                         new String[] {"image/png"},
                         null);
-                Uri uri = Uri.fromFile(png);
+                Log.v("Neko", "cat file: " + png);
+                Uri uri = FileProvider.getUriForFile(this, "com.android.egg.fileprovider", png);
+                Log.v("Neko", "cat uri: " + uri);
                 Intent intent = new Intent(Intent.ACTION_SEND);
                 intent.putExtra(Intent.EXTRA_STREAM, uri);
                 intent.putExtra(Intent.EXTRA_SUBJECT, cat.getName());
+                intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
                 intent.setType("image/png");
                 startActivity(Intent.createChooser(intent, null));
                 cat.logShare(this);
diff --git a/packages/EasterEgg/src/com/android/egg/neko/NekoService.java b/packages/EasterEgg/src/com/android/egg/neko/NekoService.java
index 808ec36..42506e6 100644
--- a/packages/EasterEgg/src/com/android/egg/neko/NekoService.java
+++ b/packages/EasterEgg/src/com/android/egg/neko/NekoService.java
@@ -15,15 +15,15 @@
 package com.android.egg.neko;
 
 import android.app.Notification;
+import android.app.NotificationChannel;
 import android.app.NotificationManager;
 import android.app.job.JobInfo;
 import android.app.job.JobParameters;
 import android.app.job.JobScheduler;
 import android.app.job.JobService;
-import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
-import android.content.Intent;
+import android.net.Uri;
 import android.os.Bundle;
 
 import java.util.List;
@@ -33,6 +33,9 @@
 
 import java.util.Random;
 
+import static com.android.egg.neko.Cat.PURR;
+import static com.android.egg.neko.NekoLand.CHAN_ID;
+
 public class NekoService extends JobService {
 
     private static final String TAG = "NekoService";
@@ -40,6 +43,7 @@
     public static int JOB_ID = 42;
 
     public static int CAT_NOTIFICATION = 1;
+    public static int DEBUG_NOTIFICATION = 1234;
 
     public static float CAT_CAPTURE_PROB = 1.0f; // generous
 
@@ -50,6 +54,18 @@
 
     public static float INTERVAL_JITTER_FRAC = 0.25f;
 
+    private static void setupNotificationChannels(Context context) {
+        NotificationManager noman = context.getSystemService(NotificationManager.class);
+        NotificationChannel eggChan = new NotificationChannel(CHAN_ID,
+                context.getString(R.string.notification_channel_name),
+                NotificationManager.IMPORTANCE_DEFAULT);
+        eggChan.setSound(Uri.EMPTY, Notification.AUDIO_ATTRIBUTES_DEFAULT); // cats are quiet
+        eggChan.setVibrationPattern(PURR); // not totally quiet though
+        eggChan.setBlockableSystem(true); // unlike a real cat, you can push this one off your lap
+        eggChan.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); // cats sit in the window
+        noman.createNotificationChannel(eggChan);
+    }
+
     @Override
     public boolean onStartJob(JobParameters params) {
         Log.v(TAG, "Starting job: " + String.valueOf(params));
@@ -64,8 +80,9 @@
             final Notification.Builder builder
                     = cat.buildNotification(this)
                         .setContentTitle("DEBUG")
+                        .setChannel(NekoLand.CHAN_ID)
                         .setContentText("Ran job: " + params);
-            noman.notify(1, builder.build());
+            noman.notify(DEBUG_NOTIFICATION, builder.build());
         }
 
         final PrefState prefs = new PrefState(this);
@@ -111,6 +128,8 @@
     }
 
     public static void registerJob(Context context, long intervalMinutes) {
+        setupNotificationChannels(context);
+
         JobScheduler jss = context.getSystemService(JobScheduler.class);
         jss.cancel(JOB_ID);
         long interval = intervalMinutes * MINUTES;
@@ -126,12 +145,13 @@
 
         if (NekoLand.DEBUG_NOTIFICATIONS) {
             NotificationManager noman = context.getSystemService(NotificationManager.class);
-            noman.notify(500, new Notification.Builder(context)
+            noman.notify(DEBUG_NOTIFICATION, new Notification.Builder(context)
                     .setSmallIcon(R.drawable.stat_icon)
                     .setContentTitle(String.format("Job scheduled in %d min", (interval / MINUTES)))
                     .setContentText(String.valueOf(jobInfo))
                     .setPriority(Notification.PRIORITY_MIN)
                     .setCategory(Notification.CATEGORY_SERVICE)
+                    .setChannel(NekoLand.CHAN_ID)
                     .setShowWhen(true)
                     .build());
         }
diff --git a/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java b/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
index bf1bf34..40c2b1f 100644
--- a/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
+++ b/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
@@ -339,26 +339,35 @@
         synchronized (mEntriesMap) {
             AppEntry entry = mEntriesMap.get(userId).get(packageName);
             if (entry != null && (entry.info.flags & ApplicationInfo.FLAG_INSTALLED) != 0) {
-                mBackgroundHandler.post(() -> {
-                    try {
-                        final StorageStats stats = mStats.queryStatsForPackage(
-                                entry.info.storageUuid, packageName, UserHandle.of(userId));
-                        final PackageStats legacy = new PackageStats(packageName, userId);
-                        legacy.codeSize = stats.getCodeBytes();
-                        legacy.dataSize = stats.getDataBytes();
-                        legacy.cacheSize = stats.getCacheBytes();
-                        try {
-                            mBackgroundHandler.mStatsObserver.onGetStatsCompleted(legacy, true);
-                        } catch (RemoteException ignored) {
-                        }
-                    } catch (NameNotFoundException | IOException e) {
-                        Log.w(TAG, "Failed to query stats: " + e);
-                        try {
-                            mBackgroundHandler.mStatsObserver.onGetStatsCompleted(null, false);
-                        } catch (RemoteException ignored) {
-                        }
-                    }
-                });
+                mBackgroundHandler.post(
+                        () -> {
+                            try {
+                                final StorageStats stats =
+                                        mStats.queryStatsForPackage(
+                                                entry.info.storageUuid,
+                                                packageName,
+                                                UserHandle.of(userId));
+                                final long cacheQuota =
+                                        mStats.getCacheQuotaBytes(
+                                                entry.info.storageUuid.toString(), entry.info.uid);
+                                final PackageStats legacy = new PackageStats(packageName, userId);
+                                legacy.codeSize = stats.getCodeBytes();
+                                legacy.dataSize = stats.getDataBytes();
+                                legacy.cacheSize = Math.min(stats.getCacheBytes(), cacheQuota);
+                                try {
+                                    mBackgroundHandler.mStatsObserver.onGetStatsCompleted(
+                                            legacy, true);
+                                } catch (RemoteException ignored) {
+                                }
+                            } catch (NameNotFoundException | IOException e) {
+                                Log.w(TAG, "Failed to query stats: " + e);
+                                try {
+                                    mBackgroundHandler.mStatsObserver.onGetStatsCompleted(
+                                            null, false);
+                                } catch (RemoteException ignored) {
+                                }
+                            }
+                        });
             }
             if (DEBUG_LOCKING) Log.v(TAG, "...requestSize releasing lock");
         }
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 109446d..2873fb6 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -335,8 +335,7 @@
     }
 
     public int getProfileConnectionState(LocalBluetoothProfile profile) {
-        if (mProfileConnectionState == null ||
-                mProfileConnectionState.get(profile) == null) {
+        if (mProfileConnectionState.get(profile) == null) {
             // If cache is empty make the binder call to get the state
             int state = profile.getConnectionStatus(mDevice);
             mProfileConnectionState.put(profile, state);
diff --git a/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java b/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
index fc0a444..713e967 100644
--- a/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
@@ -428,15 +428,6 @@
                     if (metaData.containsKey(META_DATA_PREFERENCE_CUSTOM_VIEW)) {
                         int layoutId = metaData.getInt(META_DATA_PREFERENCE_CUSTOM_VIEW);
                         remoteViews = new RemoteViews(applicationInfo.packageName, layoutId);
-                        if (metaData.containsKey(META_DATA_PREFERENCE_SUMMARY_URI)) {
-                            String uriString = metaData.getString(
-                                    META_DATA_PREFERENCE_SUMMARY_URI);
-                            String overrideSummary = getTextFromUri(context, uriString, providerMap,
-                                    META_DATA_PREFERENCE_SUMMARY);
-                            if (overrideSummary != null) {
-                                remoteViews.setTextViewText(android.R.id.summary, overrideSummary);
-                            }
-                        }
                     }
                 }
             } catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) {
@@ -543,6 +534,30 @@
         }
     }
 
+    public static void updateTileUsingSummaryUri(Context context, Tile tile) {
+        if (tile == null || tile.metaData == null ||
+            !tile.metaData.containsKey(META_DATA_PREFERENCE_SUMMARY_URI)) {
+            return;
+        }
+
+        final Map<String, IContentProvider> providerMap = new HashMap<>();
+
+        final String uriString = tile.metaData.getString(META_DATA_PREFERENCE_SUMMARY_URI);
+        final Bundle bundle = getBundleFromUri(context, uriString, providerMap);
+        final String overrideSummary = getString(bundle, META_DATA_PREFERENCE_SUMMARY);
+        final String overrideTitle = getString(bundle, META_DATA_PREFERENCE_TITLE);
+        if (overrideSummary != null) {
+            tile.remoteViews.setTextViewText(android.R.id.summary, overrideSummary);
+        }
+        if (overrideTitle != null) {
+            tile.remoteViews.setTextViewText(android.R.id.title, overrideTitle);
+        }
+    }
+
+    private static String getString(Bundle bundle, String key) {
+        return bundle == null ? null : bundle.getString(key);
+    }
+
     private static IContentProvider getProviderFromUri(Context context, Uri uri,
             Map<String, IContentProvider> providerMap) {
         if (uri == null) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/TimestampedScoredNetwork.java b/packages/SettingsLib/src/com/android/settingslib/wifi/TimestampedScoredNetwork.java
index cb15a79..abc9b022 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/TimestampedScoredNetwork.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/TimestampedScoredNetwork.java
@@ -57,7 +57,7 @@
 
     @Override
     public void writeToParcel(Parcel dest, int flags) {
-        dest.writeParcelable(mScore, flags);
+        mScore.writeToParcel(dest, flags);
         dest.writeLong(mUpdatedTimestampMillis);
     }
 
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java
index 3e90435..88035e4 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java
@@ -22,10 +22,12 @@
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.argThat;
-import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static org.robolectric.RuntimeEnvironment.application;
@@ -64,9 +66,6 @@
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.annotation.Config;
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.internal.ShadowExtractor;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -75,8 +74,7 @@
 
 @RunWith(RobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
-        sdk = TestConfig.SDK_VERSION,
-        shadows = {TileUtilsTest.TileUtilsShadowRemoteViews.class})
+        sdk = TestConfig.SDK_VERSION)
 public class TileUtilsTest {
 
     @Mock
@@ -421,24 +419,12 @@
     }
 
     @Test
-    public void getTilesForIntent_summaryUriSpecified_shouldOverrideRemoteViewSummary()
+    public void updateTileUsingSummaryUri_summaryUriSpecified_shouldOverrideRemoteViewSummary()
             throws RemoteException {
-        Intent intent = new Intent();
-        Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
-        List<Tile> outTiles = new ArrayList<>();
-        List<ResolveInfo> info = new ArrayList<>();
-        ResolveInfo resolveInfo = newInfo(true, null /* category */, null,
-                null, URI_GET_SUMMARY);
-        resolveInfo.activityInfo.metaData.putInt("com.android.settings.custom_view",
-                R.layout.user_preference);
-        info.add(resolveInfo);
-
-        when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
-                .thenReturn(info);
-
         // Mock the content provider interaction.
         Bundle bundle = new Bundle();
-        bundle.putString(TileUtils.META_DATA_PREFERENCE_SUMMARY, "new summary text");
+        String expectedSummary = "new summary text";
+        bundle.putString(TileUtils.META_DATA_PREFERENCE_SUMMARY, expectedSummary);
         when(mIContentProvider.call(anyString(),
                 eq(TileUtils.getMethodFromUri(Uri.parse(URI_GET_SUMMARY))), eq(URI_GET_SUMMARY),
                 any())).thenReturn(bundle);
@@ -447,57 +433,12 @@
         when(mContentResolver.acquireUnstableProvider(any(Uri.class)))
                 .thenReturn(mIContentProvider);
 
-        TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
-                null /* defaultCategory */, outTiles, false /* usePriority */,
-                false /* checkCategory */, true /* forceTintExternalIcon */);
-
-        assertThat(outTiles.size()).isEqualTo(1);
-        Tile tile = outTiles.get(0);
-        assertThat(tile.remoteViews).isNotNull();
-        assertThat(tile.remoteViews.getLayoutId()).isEqualTo(R.layout.user_preference);
-        // Make sure the summary TextView got a new text string.
-        TileUtilsShadowRemoteViews shadowRemoteViews =
-                (TileUtilsShadowRemoteViews) ShadowExtractor.extract(tile.remoteViews);
-        assertThat(shadowRemoteViews.overrideViewId).isEqualTo(android.R.id.summary);
-        assertThat(shadowRemoteViews.overrideText).isEqualTo("new summary text");
-    }
-
-    @Test
-    public void getTilesForIntent_providerUnavailable_shouldNotOverrideRemoteViewSummary()
-            throws RemoteException {
-        Intent intent = new Intent();
-        Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
-        List<Tile> outTiles = new ArrayList<>();
-        List<ResolveInfo> info = new ArrayList<>();
-        ResolveInfo resolveInfo = newInfo(true, null /* category */, null,
-                null, URI_GET_SUMMARY);
-        resolveInfo.activityInfo.metaData.putInt("com.android.settings.custom_view",
-                R.layout.user_preference);
-        info.add(resolveInfo);
-
-        when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
-                .thenReturn(info);
-
-        // Mock the content provider interaction.
-        Bundle bundle = new Bundle();
-        bundle.putString(TileUtils.META_DATA_PREFERENCE_SUMMARY, "new summary text");
-        when(mIContentProvider.call(anyString(),
-                eq(TileUtils.getMethodFromUri(Uri.parse(URI_GET_SUMMARY))), eq(URI_GET_SUMMARY),
-                any())).thenReturn(bundle);
-
-        TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
-                null /* defaultCategory */, outTiles, false /* usePriority */,
-                false /* checkCategory */, true /* forceTintExternalIcon */);
-
-        assertThat(outTiles.size()).isEqualTo(1);
-        Tile tile = outTiles.get(0);
-        assertThat(tile.remoteViews).isNotNull();
-        assertThat(tile.remoteViews.getLayoutId()).isEqualTo(R.layout.user_preference);
-        // Make sure the summary TextView didn't get any text view updates.
-        TileUtilsShadowRemoteViews shadowRemoteViews =
-                (TileUtilsShadowRemoteViews) ShadowExtractor.extract(tile.remoteViews);
-        assertThat(shadowRemoteViews.overrideViewId).isNull();
-        assertThat(shadowRemoteViews.overrideText).isNull();
+        Tile tile = new Tile();
+        tile.metaData = new Bundle();
+        tile.metaData.putString(TileUtils.META_DATA_PREFERENCE_SUMMARY_URI, URI_GET_SUMMARY);
+        tile.remoteViews = mock(RemoteViews.class);
+        TileUtils.updateTileUsingSummaryUri(mContext, tile);
+        verify(tile.remoteViews, times(1)).setTextViewText(anyInt(), eq(expectedSummary));
     }
 
     public static ResolveInfo newInfo(boolean systemApp, String category) {
@@ -558,16 +499,4 @@
         }
     }
 
-    @Implements(RemoteViews.class)
-    public static class TileUtilsShadowRemoteViews {
-
-        private Integer overrideViewId;
-        private CharSequence overrideText;
-
-        @Implementation
-        public void setTextViewText(int viewId, CharSequence text) {
-            overrideViewId = viewId;
-            overrideText = text;
-        }
-    }
 }
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/wifi/TimestampedScoredNetworkTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/wifi/TimestampedScoredNetworkTest.java
new file mode 100644
index 0000000..b2d9d67b
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/wifi/TimestampedScoredNetworkTest.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+package com.android.settingslib.wifi;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.net.NetworkKey;
+import android.net.ScoredNetwork;
+import android.net.WifiKey;
+import android.os.Parcel;
+
+import com.android.settingslib.SettingsLibRobolectricTestRunner;
+import com.android.settingslib.TestConfig;
+import java.util.Date;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+@RunWith(SettingsLibRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class TimestampedScoredNetworkTest {
+  private TimestampedScoredNetwork impl;
+
+  private ScoredNetwork createTestScoredNetwork(String ssid) {
+    return new ScoredNetwork(
+        new NetworkKey(new WifiKey("\"" + ssid + "\"", "00:00:00:00:00:00")), null);
+  }
+
+  @Before
+  public void setUp() {
+    impl = new TimestampedScoredNetwork(createTestScoredNetwork("test"),
+        0 /* updatedTimestampMillis */);
+  }
+
+  @Test
+  public void testUpdate() {
+    long time = new Date().getTime();
+    ScoredNetwork updated = createTestScoredNetwork("updated");
+    impl.update(updated, time);
+
+    assertThat(impl.getScore()).isEqualTo(updated);
+    assertThat(impl.getUpdatedTimestampMillis()).isEqualTo(time);
+  }
+
+  @Test
+  public void testParcel() {
+    Parcel parcel = Parcel.obtain();
+    impl.writeToParcel(parcel, 0);
+    parcel.setDataPosition(0);
+
+    TimestampedScoredNetwork fromParcel = TimestampedScoredNetwork.CREATOR.createFromParcel(parcel);
+
+    assertThat(fromParcel.getScore()).isEqualTo(impl.getScore());
+    assertThat(fromParcel.getUpdatedTimestampMillis()).isEqualTo(impl.getUpdatedTimestampMillis());
+  }
+}
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 75e9199..87971cb 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -318,15 +318,20 @@
             android:exported="false">
         </activity>
 
+        <!-- Springboard for launching the share activity -->
+        <receiver android:name=".screenshot.GlobalScreenshot$ShareReceiver"
+            android:process=":screenshot"
+            android:exported="false" />
+
         <!-- Callback for dismissing screenshot notification after a share target is picked -->
         <receiver android:name=".screenshot.GlobalScreenshot$TargetChosenReceiver"
-                  android:process=":screenshot"
-                  android:exported="false" />
+            android:process=":screenshot"
+            android:exported="false" />
 
         <!-- Callback for deleting screenshot notification -->
         <receiver android:name=".screenshot.GlobalScreenshot$DeleteScreenshotReceiver"
-                  android:process=":screenshot"
-                  android:exported="false" />
+            android:process=":screenshot"
+            android:exported="false" />
 
         <!-- started from UsbDeviceSettingsManager -->
         <activity android:name=".usb.UsbConfirmActivity"
diff --git a/packages/SystemUI/res/color/qs_detail_progress_track.xml b/packages/SystemUI/res/color/qs_detail_progress_track.xml
index c56382e..d86119f 100644
--- a/packages/SystemUI/res/color/qs_detail_progress_track.xml
+++ b/packages/SystemUI/res/color/qs_detail_progress_track.xml
@@ -16,5 +16,5 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <!-- I really don't want to define this, but the View that uses this asset uses both the
          light and dark accent colors. -->
-    <item android:alpha="0.6" android:drawable="@*android:color/accent_device_default_light" />
+    <item android:alpha="0.6" android:drawable="@*android:color/accent_device_default_dark" />
 </selector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_no_sim.xml b/packages/SystemUI/res/drawable/ic_qs_no_sim.xml
index 69869fe..5dcd9f7 100644
--- a/packages/SystemUI/res/drawable/ic_qs_no_sim.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_no_sim.xml
@@ -1,5 +1,5 @@
 <!--
-Copyright (C) 2014 The Android Open Source Project
+Copyright (C) 2017 The Android Open Source Project
 
    Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -16,10 +16,14 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
         android:width="32dp"
         android:height="32dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
+        android:viewportWidth="18.4"
+        android:viewportHeight="18.4">
 
-    <path
-        android:fillColor="#FFFFFFFF"
-        android:pathData="M19.0,5.0c0.0,-1.1 -0.9,-2.0 -2.0,-2.0l-7.0,0.0L7.7,5.3L19.0,16.7L19.0,5.0zM3.7,3.9L2.4,5.2L5.0,7.8L5.0,19.0c0.0,1.1 0.9,2.0 2.0,2.0l10.0,0.0c0.4,0.0 0.7,-0.1 1.0,-0.3l1.9,1.9l1.3,-1.3L3.7,3.9z"/>
+    <group
+        android:translateX="0.7"
+        android:translateY="1.0">
+        <path
+            android:fillColor="#FFFFFFFF"
+            android:pathData="M13.91,11.84L5.14,3.08l1.81,-1.81h5.41c0.85,0 1.54,0.69 1.54,1.54l0.01,9.03zM15.06,14.95L2.54,2.44c-0.28,-0.28 -0.71,-0.28 -0.99,0s-0.28,0.71 0,0.98l1.53,1.53v8.67c0,0.85 0.69,1.54 1.54,1.54h7.74c0.27,0 0.52,-0.07 0.74,-0.2l0.96,0.96c0.28,0.28 0.71,0.28 0.99,0 0.28,-0.26 0.28,-0.69 0.01,-0.97z"/>
+    </group>
 </vector>
diff --git a/packages/SystemUI/res/layout/car_fullscreen_user_pod.xml b/packages/SystemUI/res/layout/car_fullscreen_user_pod.xml
index dde2db2..2f16516 100644
--- a/packages/SystemUI/res/layout/car_fullscreen_user_pod.xml
+++ b/packages/SystemUI/res/layout/car_fullscreen_user_pod.xml
@@ -30,7 +30,8 @@
     <TextView android:id="@+id/user_name"
         android:layout_width="@dimen/car_fullscreen_user_pod_width"
         android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/car_fullscreen_user_pod_margin_above_text"
+        android:layout_marginTop="@dimen/car_fullscreen_user_pod_margin_name_top"
+        android:layout_marginBottom="@dimen/car_fullscreen_user_pod_margin_name_bottom"
         android:textSize="@dimen/car_fullscreen_user_pod_text_size"
         android:textColor="@color/qs_user_detail_name"
         android:ellipsize="end"
diff --git a/packages/SystemUI/res/layout/car_qs_footer.xml b/packages/SystemUI/res/layout/car_qs_footer.xml
index 96f34fc..044090b 100644
--- a/packages/SystemUI/res/layout/car_qs_footer.xml
+++ b/packages/SystemUI/res/layout/car_qs_footer.xml
@@ -18,23 +18,24 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/qs_footer"
     android:layout_width="match_parent"
-    android:layout_height="@dimen/qs_footer_height"
+    android:layout_height="@dimen/car_qs_footer_height"
     android:baselineAligned="false"
     android:clickable="false"
     android:clipChildren="false"
     android:clipToPadding="false"
-    android:paddingBottom="16dp"
-    android:paddingTop="16dp"
-    android:paddingEnd="32dp"
-    android:paddingStart="32dp"
+    android:paddingBottom="@dimen/car_qs_footer_padding_bottom"
+    android:paddingTop="@dimen/car_qs_footer_padding_top"
+    android:paddingEnd="@dimen/car_qs_footer_padding_end"
+    android:paddingStart="@dimen/car_qs_footer_padding_start"
     android:gravity="center_vertical">
 
     <com.android.systemui.statusbar.phone.MultiUserSwitch
         android:id="@+id/multi_user_switch"
         android:layout_alignParentStart="true"
         android:layout_centerVertical="true"
-        android:layout_width="48dp"
-        android:layout_height="48dp"
+        android:layout_width="@dimen/car_qs_footer_icon_width"
+        android:layout_height="@dimen/car_qs_footer_icon_height"
+        android:layout_marginRight="@dimen/car_qs_footer_user_switch_margin_right"
         android:background="@drawable/ripple_drawable"
         android:focusable="true">
 
@@ -43,15 +44,24 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_gravity="center"
-            android:scaleType="centerInside"/>
+            android:scaleType="fitCenter"/>
     </com.android.systemui.statusbar.phone.MultiUserSwitch>
 
+    <TextView android:id="@+id/user_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textSize="@dimen/car_qs_footer_user_name_text_size"
+        android:textColor="@color/car_qs_footer_user_name_color"
+        android:gravity="start|center_vertical"
+        android:layout_centerVertical="true"
+        android:layout_toEndOf="@id/multi_user_switch" />
+
     <com.android.systemui.statusbar.phone.SettingsButton
         android:id="@+id/settings_button"
         android:layout_alignParentEnd="true"
         android:layout_centerVertical="true"
-        android:layout_width="48dp"
-        android:layout_height="48dp"
+        android:layout_width="@dimen/car_qs_footer_icon_width"
+        android:layout_height="@dimen/car_qs_footer_icon_height"
         android:background="@drawable/ripple_drawable"
         android:contentDescription="@string/accessibility_quick_settings_settings"
         android:scaleType="centerCrop"
diff --git a/packages/SystemUI/res/layout/notification_info.xml b/packages/SystemUI/res/layout/notification_info.xml
index bbd315e..6df1657 100644
--- a/packages/SystemUI/res/layout/notification_info.xml
+++ b/packages/SystemUI/res/layout/notification_info.xml
@@ -62,7 +62,9 @@
             android:layout_height="wrap_content"
             android:textAppearance="@*android:style/TextAppearance.Material.Notification.Info"
             android:layout_marginStart="2dp"
-            android:layout_marginEnd="2dp"/>
+            android:layout_marginEnd="2dp"
+            android:ellipsize="end"
+            android:maxLines="1"/>
     </LinearLayout>
 
     <!-- Channel Info Block -->
diff --git a/packages/SystemUI/res/values-h600dp/dimens_car.xml b/packages/SystemUI/res/values-h600dp/dimens_car.xml
new file mode 100644
index 0000000..c3e62c8
--- /dev/null
+++ b/packages/SystemUI/res/values-h600dp/dimens_car.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (c) 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+-->
+<resources>
+    <dimen name="car_body2_size">32sp</dimen> <!-- B2 -->
+</resources>
diff --git a/packages/SystemUI/res/values-ldrtl/config.xml b/packages/SystemUI/res/values-ldrtl/config.xml
index 40604c1..884c95f 100644
--- a/packages/SystemUI/res/values-ldrtl/config.xml
+++ b/packages/SystemUI/res/values-ldrtl/config.xml
@@ -17,5 +17,5 @@
 <resources>
     <!-- Bounds [left top right bottom] on screen for picture-in-picture (PIP) windows,
          when the PIP menu is shown with settings. -->
-    <string translatable="false" name="pip_settings_bounds">"778 54 1258 324"</string>
+    <string translatable="false" name="pip_settings_bounds">"778 756 1258 1026"</string>
 </resources>
diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml
index 745d6015..a923f0b 100644
--- a/packages/SystemUI/res/values/attrs.xml
+++ b/packages/SystemUI/res/values/attrs.xml
@@ -34,6 +34,7 @@
         <attr name="recentItemLayout" format="reference" />
         <!-- Style for the "Clear all" button. -->
         <attr name="clearAllStyle" format="reference" />
+        <attr name="clearAllBackgroundColor" format="reference" />
     </declare-styleable>
     <declare-styleable name="DeadZone">
         <attr name="minSize" format="dimension" />
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index f72f379..f244d88 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -60,6 +60,11 @@
     <!-- The background color for the freeform workspace. -->
     <color name="recents_freeform_workspace_bg_color">#33FFFFFF</color>
 
+    <!-- The background color for clear all button on light backgrounds if not transparent. -->
+    <color name="recents_clear_all_button_bg_light_color">#CCFFFFFF</color>
+    <!-- The background color for clear all button on dark backgrounds if not transparent. -->
+    <color name="recents_clear_all_button_bg_dark_color">#CC000000</color>
+
     <color name="keyguard_affordance">#ffffffff</color>
 
     <!-- The color of the legacy notification background -->
diff --git a/packages/SystemUI/res/values/colors_car.xml b/packages/SystemUI/res/values/colors_car.xml
index 1b8c2fa..710b3e0 100644
--- a/packages/SystemUI/res/values/colors_car.xml
+++ b/packages/SystemUI/res/values/colors_car.xml
@@ -20,8 +20,12 @@
     <color name="car_qs_background_primary">#263238</color> <!-- Blue Gray 900 -->
     <color name="car_user_switcher_progress_bgcolor">#00000000</color> <!-- Transparent -->
     <color name="car_user_switcher_progress_fgcolor">#80CBC4</color> <!-- Teal 200 -->
-    <color name="car_user_switcher_no_user_image_bgcolor">#FAFAFA</color> <!-- Grey 50 -->
-    <color name="car_user_switcher_no_user_image_fgcolor">#212121</color> <!-- Grey 900 -->
-    <color name="car_start_driving_background">#FAFAFA</color> <!-- Grey 50 -->
-    <color name="car_start_driving_text">#212121</color> <!-- Grey 900 -->
+    <color name="car_user_switcher_no_user_image_bgcolor">@color/car_grey_50</color>
+    <color name="car_user_switcher_no_user_image_fgcolor">@color/car_grey_900</color>
+    <color name="car_start_driving_background">@color/car_grey_50</color>
+    <color name="car_start_driving_text">@color/car_grey_900</color>
+    <color name="car_qs_footer_user_name_color">@color/car_grey_50</color>
+
+    <color name="car_grey_50">#FAFAFA</color>
+    <color name="car_grey_900">#212121</color>
 </resources>
diff --git a/packages/SystemUI/res/values/dimens_car.xml b/packages/SystemUI/res/values/dimens_car.xml
index 5f56c4e..8853587 100644
--- a/packages/SystemUI/res/values/dimens_car.xml
+++ b/packages/SystemUI/res/values/dimens_car.xml
@@ -18,7 +18,8 @@
 <resources>
     <dimen name="car_margin">148dp</dimen>
 
-    <dimen name="car_fullscreen_user_pod_margin_above_text">24dp</dimen>
+    <dimen name="car_fullscreen_user_pod_margin_name_top">24dp</dimen>
+    <dimen name="car_fullscreen_user_pod_margin_name_bottom">64dp</dimen>
     <dimen name="car_fullscreen_user_pod_margin_between">24dp</dimen>
     <dimen name="car_fullscreen_user_pod_icon_text_size">96dp</dimen>
     <dimen name="car_fullscreen_user_pod_image_avatar_width">192dp</dimen>
@@ -37,5 +38,17 @@
     <dimen name="car_start_driving_corner_radius">16dp</dimen>
     <dimen name="car_start_driving_padding_side">30dp</dimen>
     <dimen name="car_start_driving_height">80dp</dimen>
-    <dimen name="car_start_driving_text_size">32sp</dimen> <!-- B2 -->
+    <dimen name="car_start_driving_text_size">@dimen/car_body2_size</dimen>
+
+    <dimen name="car_qs_footer_height">112dp</dimen>
+    <dimen name="car_qs_footer_padding_bottom">16dp</dimen>
+    <dimen name="car_qs_footer_padding_top">16dp</dimen>
+    <dimen name="car_qs_footer_padding_end">46dp</dimen>
+    <dimen name="car_qs_footer_padding_start">46dp</dimen>
+    <dimen name="car_qs_footer_icon_width">56dp</dimen>
+    <dimen name="car_qs_footer_icon_height">56dp</dimen>
+    <dimen name="car_qs_footer_user_switch_margin_right">46dp</dimen>
+    <dimen name="car_qs_footer_user_name_text_size">@dimen/car_body2_size</dimen>
+
+    <dimen name="car_body2_size">26sp</dimen>
 </resources>
diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml
index b27dedd..2148c80 100644
--- a/packages/SystemUI/res/values/ids.xml
+++ b/packages/SystemUI/res/values/ids.xml
@@ -59,6 +59,7 @@
     <item type="id" name="transformation_start_y_tag"/>
     <item type="id" name="transformation_start_scale_x_tag"/>
     <item type="id" name="transformation_start_scale_y_tag"/>
+    <item type="id" name="continuous_clipping_tag"/>
 
     <!-- Whether the icon is from a notification for which targetSdk < L -->
     <item type="id" name="icon_is_pre_L"/>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 2199fff..90c5977 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -34,11 +34,13 @@
         <item name="android:windowShowWallpaper">true</item>
         <item name="android:windowDisablePreview">true</item>
         <item name="clearAllStyle">@style/ClearAllButtonDefaultMargins</item>
+        <item name="clearAllBackgroundColor">@color/recents_clear_all_button_bg_dark_color</item>
         <item name="wallpaperTextColor">@*android:color/primary_text_material_dark</item>
         <item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_dark</item>
     </style>
 
     <style name="RecentsTheme.Wallpaper.Light">
+        <item name="clearAllBackgroundColor">@color/recents_clear_all_button_bg_light_color</item>
         <item name="wallpaperTextColor">@*android:color/primary_text_material_light</item>
         <item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_light</item>
     </style>
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index c596398..d95402c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -50,6 +50,7 @@
 import android.os.BatteryManager;
 import android.os.CancellationSignal;
 import android.os.Handler;
+import android.os.IBinder;
 import android.os.IRemoteCallback;
 import android.os.Message;
 import android.os.RemoteException;
@@ -58,6 +59,8 @@
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings;
+import android.service.dreams.DreamService;
+import android.service.dreams.IDreamManager;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
@@ -67,8 +70,6 @@
 import android.util.SparseBooleanArray;
 import android.util.SparseIntArray;
 
-import com.google.android.collect.Lists;
-
 import com.android.internal.telephony.IccCardConstants;
 import com.android.internal.telephony.IccCardConstants.State;
 import com.android.internal.telephony.PhoneConstants;
@@ -77,6 +78,8 @@
 import com.android.systemui.recents.misc.SystemServicesProxy;
 import com.android.systemui.recents.misc.SystemServicesProxy.TaskStackListener;
 
+import com.google.android.collect.Lists;
+
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
 import java.lang.ref.WeakReference;
@@ -217,6 +220,8 @@
     private UserManager mUserManager;
     private int mFingerprintRunningState = FINGERPRINT_STATE_STOPPED;
     private LockPatternUtils mLockPatternUtils;
+    private final IDreamManager mDreamManager;
+    private boolean mIsDreaming;
 
     /**
      * Short delay before restarting fingerprint authentication after a successful try
@@ -458,6 +463,26 @@
         updateFingerprintListeningState();
     }
 
+    /**
+     * @return a cached version of DreamManager.isDreaming()
+     */
+    public boolean isDreaming() {
+        return mIsDreaming;
+    }
+
+    /**
+     * If the device is dreaming, awakens the device
+     */
+    public void awakenFromDream() {
+        if (mIsDreaming && mDreamManager != null) {
+            try {
+                mDreamManager.awaken();
+            } catch (RemoteException e) {
+                Log.e(TAG, "Unable to awaken from dream");
+            }
+        }
+    }
+
     private void onFingerprintAuthenticated(int userId) {
         Trace.beginSection("KeyGuardUpdateMonitor#onFingerPrintAuthenticated");
         mUserFingerprintAuthenticated.put(userId, true);
@@ -1037,11 +1062,11 @@
 
     private void handleDreamingStateChanged(int dreamStart) {
         final int count = mCallbacks.size();
-        boolean showingDream = dreamStart == 1;
+        mIsDreaming = dreamStart == 1;
         for (int i = 0; i < count; i++) {
             KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
             if (cb != null) {
-                cb.onDreamingStateChanged(showingDream);
+                cb.onDreamingStateChanged(mIsDreaming);
             }
         }
     }
@@ -1146,6 +1171,9 @@
         mLockPatternUtils = new LockPatternUtils(context);
         mLockPatternUtils.registerStrongAuthTracker(mStrongAuthTracker);
 
+        mDreamManager = IDreamManager.Stub.asInterface(
+                ServiceManager.getService(DreamService.DREAM_SERVICE));
+
         if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
             mFpm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
         }
@@ -1183,7 +1211,7 @@
     private boolean shouldListenForFingerprint() {
         return (mKeyguardIsVisible || !mDeviceInteractive ||
                 (mBouncer && !mKeyguardGoingAway) || mGoingToSleep ||
-                shouldListenForFingerprintAssistant())
+                shouldListenForFingerprintAssistant() || (mKeyguardOccluded && mIsDreaming))
                 && !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
                 && !mKeyguardGoingAway;
     }
diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
index fd2447b..2b31967 100644
--- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
+++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
@@ -49,6 +49,7 @@
 import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
 import com.android.systemui.statusbar.policy.DarkIconDispatcher;
 import com.android.systemui.statusbar.policy.DarkIconDispatcher.DarkReceiver;
+import com.android.systemui.statusbar.policy.IconLogger;
 import com.android.systemui.tuner.TunerService;
 import com.android.systemui.tuner.TunerService.Tunable;
 
@@ -150,7 +151,9 @@
     public void onTuningChanged(String key, String newValue) {
         if (StatusBarIconController.ICON_BLACKLIST.equals(key)) {
             ArraySet<String> icons = StatusBarIconController.getIconBlacklist(newValue);
-            setVisibility(icons.contains(mSlotBattery) ? View.GONE : View.VISIBLE);
+            boolean hidden = icons.contains(mSlotBattery);
+            Dependency.get(IconLogger.class).onIconVisibility(mSlotBattery, !hidden);
+            setVisibility(hidden ? View.GONE : View.VISIBLE);
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/Dependency.java b/packages/SystemUI/src/com/android/systemui/Dependency.java
index 49253ec..a9a915b 100644
--- a/packages/SystemUI/src/com/android/systemui/Dependency.java
+++ b/packages/SystemUI/src/com/android/systemui/Dependency.java
@@ -42,6 +42,7 @@
 import com.android.systemui.power.PowerUI;
 import com.android.systemui.statusbar.phone.ConfigurationControllerImpl;
 import com.android.systemui.statusbar.phone.DarkIconDispatcherImpl;
+import com.android.systemui.statusbar.phone.LightBarController;
 import com.android.systemui.statusbar.phone.ManagedProfileController;
 import com.android.systemui.statusbar.phone.ManagedProfileControllerImpl;
 import com.android.systemui.statusbar.phone.StatusBarIconController;
@@ -66,6 +67,8 @@
 import com.android.systemui.statusbar.policy.FlashlightControllerImpl;
 import com.android.systemui.statusbar.policy.HotspotController;
 import com.android.systemui.statusbar.policy.HotspotControllerImpl;
+import com.android.systemui.statusbar.policy.IconLogger;
+import com.android.systemui.statusbar.policy.IconLoggerImpl;
 import com.android.systemui.statusbar.policy.KeyguardMonitor;
 import com.android.systemui.statusbar.policy.KeyguardMonitorImpl;
 import com.android.systemui.statusbar.policy.LocationController;
@@ -294,9 +297,13 @@
 
         mProviders.put(UiOffloadThread.class, UiOffloadThread::new);
 
-
         mProviders.put(PowerUI.WarningsUI.class, () -> new PowerNotificationWarnings(mContext));
 
+        mProviders.put(IconLogger.class, () -> new IconLoggerImpl(mContext,
+                getDependency(BG_LOOPER), getDependency(MetricsLogger.class)));
+
+        mProviders.put(LightBarController.class, () -> new LightBarController(mContext));
+
         // Put all dependencies above here so the factory can override them if it wants.
         SystemUIFactory.getInstance().injectDependencies(mProviders, mContext);
     }
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index 33d5617..4cbbbd6 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -14,6 +14,8 @@
 
 package com.android.systemui.globalactions;
 
+import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN;
+
 import com.android.internal.R;
 import com.android.internal.colorextraction.ColorExtractor;
 import com.android.internal.colorextraction.ColorExtractor.GradientColors;
@@ -310,7 +312,10 @@
             } else if (GLOBAL_ACTION_KEY_SETTINGS.equals(actionKey)) {
                 mItems.add(getSettingsAction());
             } else if (GLOBAL_ACTION_KEY_LOCKDOWN.equals(actionKey)) {
-                mItems.add(getLockdownAction());
+                if (Settings.Secure.getInt(mContext.getContentResolver(),
+                            Settings.Secure.LOCKDOWN_IN_POWER_MENU, 0) != 0) {
+                    mItems.add(getLockdownAction());
+                }
             } else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) {
                 mItems.add(getVoiceAssistAction());
             } else if (GLOBAL_ACTION_KEY_ASSIST.equals(actionKey)) {
@@ -575,7 +580,9 @@
 
             @Override
             public void onPress() {
-                new LockPatternUtils(mContext).requireCredentialEntry(UserHandle.USER_ALL);
+                new LockPatternUtils(mContext)
+                        .requireStrongAuth(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN,
+                                UserHandle.USER_ALL);
                 try {
                     WindowManagerGlobal.getWindowManagerService().lockNow(null);
                 } catch (RemoteException e) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java b/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java
index 3d8f9ff..5f26093 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java
@@ -44,7 +44,10 @@
     }
 
     protected void updateIcon(ImageView iv, State state) {
-        if (!Objects.equals(state.icon, iv.getTag(R.id.qs_icon_tag))) {
+        if (!(state.icon instanceof SignalIcon)) {
+            super.updateIcon(iv, state);
+            return;
+        } else if (!Objects.equals(state.icon, iv.getTag(R.id.qs_icon_tag))) {
             mSignalDrawable.setLevel(((SignalIcon) state.icon).getState());
             iv.setImageDrawable(mSignalDrawable);
             iv.setTag(R.id.qs_icon_tag, state.icon);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/car/CarQSFooter.java b/packages/SystemUI/src/com/android/systemui/qs/car/CarQSFooter.java
index d42b87b..142aab2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/car/CarQSFooter.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/car/CarQSFooter.java
@@ -22,6 +22,7 @@
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
+import android.widget.TextView;
 
 import com.android.systemui.Dependency;
 import com.android.systemui.R;
@@ -44,6 +45,7 @@
     private UserInfoController mUserInfoController;
 
     private MultiUserSwitch mMultiUserSwitch;
+    private TextView mUserName;
     private ImageView mMultiUserAvatar;
     private UserGridView mUserGridView;
 
@@ -56,6 +58,7 @@
         super.onFinishInflate();
         mMultiUserSwitch = findViewById(R.id.multi_user_switch);
         mMultiUserAvatar = mMultiUserSwitch.findViewById(R.id.multi_user_avatar);
+        mUserName = findViewById(R.id.user_name);
 
         mUserInfoController = Dependency.get(UserInfoController.class);
 
@@ -89,6 +92,7 @@
     @Override
     public void onUserInfoChanged(String name, Drawable picture, String userAccount) {
         mMultiUserAvatar.setImageDrawable(picture);
+        mUserName.setText(name);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
index 6c95a80..5a3081c 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
@@ -18,6 +18,7 @@
 import android.animation.Animator;
 import android.animation.Animator.AnimatorListener;
 import android.animation.AnimatorListenerAdapter;
+import android.app.AlertDialog;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.graphics.drawable.Drawable;
@@ -35,6 +36,8 @@
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
+import android.view.WindowManager;
+import android.view.WindowManager.LayoutParams;
 import android.widget.LinearLayout;
 import android.widget.Toolbar;
 import android.widget.Toolbar.OnMenuItemClickListener;
@@ -48,7 +51,9 @@
 import com.android.systemui.qs.QSContainerImpl;
 import com.android.systemui.qs.QSDetailClipper;
 import com.android.systemui.qs.QSTileHost;
+import com.android.systemui.statusbar.phone.LightBarController;
 import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
+import com.android.systemui.statusbar.phone.SystemUIDialog;
 import com.android.systemui.statusbar.policy.KeyguardMonitor;
 import com.android.systemui.statusbar.policy.KeyguardMonitor.Callback;
 
@@ -67,6 +72,7 @@
     private static final String EXTRA_QS_CUSTOMIZING = "qs_customizing";
 
     private final QSDetailClipper mClipper;
+    private final LightBarController mLightBarController;
 
     private boolean isShown;
     private QSTileHost mHost;
@@ -80,6 +86,7 @@
     private int mX;
     private int mY;
     private boolean mOpening;
+    private boolean mIsShowingNavBackdrop;
 
     public QSCustomizer(Context context, AttributeSet attrs) {
         super(new ContextThemeWrapper(context, R.style.edit_theme), attrs);
@@ -114,6 +121,7 @@
         DefaultItemAnimator animator = new DefaultItemAnimator();
         animator.setMoveDuration(TileAdapter.MOVE_DURATION);
         mRecyclerView.setItemAnimator(animator);
+        mLightBarController = Dependency.get(LightBarController.class);
         updateNavBackDrop(getResources().getConfiguration());
     }
 
@@ -125,11 +133,16 @@
 
     private void updateNavBackDrop(Configuration newConfig) {
         View navBackdrop = findViewById(R.id.nav_bar_background);
+        mIsShowingNavBackdrop = newConfig.smallestScreenWidthDp >= 600
+                || newConfig.orientation != Configuration.ORIENTATION_LANDSCAPE;
         if (navBackdrop != null) {
-            boolean shouldShow = newConfig.smallestScreenWidthDp >= 600
-                    || newConfig.orientation != Configuration.ORIENTATION_LANDSCAPE;
-            navBackdrop.setVisibility(shouldShow ? View.VISIBLE : View.GONE);
+            navBackdrop.setVisibility(mIsShowingNavBackdrop ? View.VISIBLE : View.GONE);
         }
+        updateNavColors();
+    }
+
+    private void updateNavColors() {
+        mLightBarController.setQsCustomizing(mIsShowingNavBackdrop && isShown);
     }
 
     public void setHost(QSTileHost host) {
@@ -161,6 +174,7 @@
             announceForAccessibility(mContext.getString(
                     R.string.accessibility_desc_quick_settings_edit));
             Dependency.get(KeyguardMonitor.class).addCallback(mKeyguardCallback);
+            updateNavColors();
         }
     }
 
@@ -176,6 +190,7 @@
             mNotifQsContainer.setCustomizerAnimating(false);
             mNotifQsContainer.setCustomizerShowing(true);
             Dependency.get(KeyguardMonitor.class).addCallback(mKeyguardCallback);
+            updateNavColors();
         }
     }
 
@@ -201,6 +216,7 @@
             announceForAccessibility(mContext.getString(
                     R.string.accessibility_desc_quick_settings));
             Dependency.get(KeyguardMonitor.class).removeCallback(mKeyguardCallback);
+            updateNavColors();
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
index 017365f..176112b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
@@ -31,6 +31,7 @@
 import android.service.quicksettings.IQSTileService;
 import android.service.quicksettings.Tile;
 import android.service.quicksettings.TileService;
+import android.text.format.DateUtils;
 import android.util.Log;
 import android.view.IWindowManager;
 import android.view.WindowManagerGlobal;
@@ -51,6 +52,8 @@
 public class CustomTile extends QSTileImpl<State> implements TileChangeListener {
     public static final String PREFIX = "custom(";
 
+    private static final long CUSTOM_STALE_TIMEOUT = DateUtils.HOUR_IN_MILLIS;
+
     private static final boolean DEBUG = false;
 
     // We don't want to thrash binding and unbinding if the user opens and closes the panel a lot.
@@ -83,6 +86,11 @@
         mUser = ActivityManager.getCurrentUser();
     }
 
+    @Override
+    protected long getStaleTimeout() {
+        return CUSTOM_STALE_TIMEOUT + DateUtils.MINUTE_IN_MILLIS * mHost.indexOf(getTileSpec());
+    }
+
     private void setTileIcon() {
         try {
             PackageManager pm = mContext.getPackageManager();
@@ -186,7 +194,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (mListening == listening) return;
         mListening = listening;
         try {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
index 672f2c2..576a447 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
@@ -17,12 +17,12 @@
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_QS_CLICK;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_QS_LONG_PRESS;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_QS_SECONDARY_CLICK;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_CONTEXT;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_QS_POSITION;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_QS_VALUE;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_ACTION;
 import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
 
-import android.R.attr;
 import android.app.ActivityManager;
 import android.content.Context;
 import android.content.Intent;
@@ -32,10 +32,12 @@
 import android.os.Looper;
 import android.os.Message;
 import android.service.quicksettings.Tile;
+import android.text.format.DateUtils;
 import android.util.ArraySet;
 import android.util.Log;
 import android.util.SparseArray;
 
+import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.logging.MetricsLogger;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.Utils;
@@ -45,6 +47,7 @@
 import com.android.systemui.plugins.qs.QSIconView;
 import com.android.systemui.plugins.qs.QSTile;
 import com.android.systemui.plugins.qs.QSTile.State;
+import com.android.systemui.qs.PagedTileLayout.TilePage;
 import com.android.systemui.qs.QSHost;
 
 import java.util.ArrayList;
@@ -60,14 +63,18 @@
     protected final String TAG = "Tile." + getClass().getSimpleName();
     protected static final boolean DEBUG = Log.isLoggable("Tile", Log.DEBUG);
 
+    private static final long DEFAULT_STALE_TIMEOUT = 10 * DateUtils.MINUTE_IN_MILLIS;
+
     protected final QSHost mHost;
     protected final Context mContext;
-    protected final H mHandler = new H(Dependency.get(Dependency.BG_LOOPER));
+    // @NonFinalForTesting
+    protected H mHandler = new H(Dependency.get(Dependency.BG_LOOPER));
     protected final Handler mUiHandler = new Handler(Looper.getMainLooper());
     private final ArraySet<Object> mListeners = new ArraySet<>();
     private final MetricsLogger mMetricsLogger = Dependency.get(MetricsLogger.class);
 
     private final ArrayList<Callback> mCallbacks = new ArrayList<>();
+    private final Object mStaleListener = new Object();
     protected TState mState = newTileState();
     private TState mTmpState = newTileState();
     private boolean mAnnounceNextStateChange;
@@ -93,6 +100,7 @@
     protected QSTileImpl(QSHost host) {
         mHost = host;
         mContext = host.getContext();
+        handleStale(); // Tile was just created, must be stale.
     }
 
     /**
@@ -104,6 +112,7 @@
             if (mListeners.add(listener) && mListeners.size() == 1) {
                 if (DEBUG) Log.d(TAG, "setListening " + true);
                 mHandler.obtainMessage(H.SET_LISTENING, 1, 0).sendToTarget();
+                refreshState(); // Ensure we get at least one refresh after listening.
             }
         } else {
             if (mListeners.remove(listener) && mListeners.size() == 0) {
@@ -113,6 +122,15 @@
         }
     }
 
+    protected long getStaleTimeout() {
+        return DEFAULT_STALE_TIMEOUT;
+    }
+
+    @VisibleForTesting
+    protected void handleStale() {
+        setListening(mStaleListener, true);
+    }
+
     public String getTileSpec() {
         return mTileSpec;
     }
@@ -180,9 +198,19 @@
             logMaker.addTaggedData(FIELD_QS_VALUE, ((BooleanState) mState).value ? 1 : 0);
         }
         return logMaker.setSubtype(getMetricsCategory())
+                .addTaggedData(FIELD_CONTEXT, isFullQs())
                 .addTaggedData(FIELD_QS_POSITION, mHost.indexOf(mTileSpec));
     }
 
+    private int isFullQs() {
+        for (Object listener : mListeners) {
+            if (TilePage.class.equals(listener.getClass())) {
+                return 1;
+            }
+        }
+        return 0;
+    }
+
     public void showDetail(boolean show) {
         mHandler.obtainMessage(H.SHOW_DETAIL, show ? 1 : 0, 0).sendToTarget();
     }
@@ -261,6 +289,9 @@
         if (changed) {
             handleStateChanged();
         }
+        mHandler.removeMessages(H.STALE);
+        mHandler.sendEmptyMessageDelayed(H.STALE, getStaleTimeout());
+        setListening(mStaleListener, false);
     }
 
     private void handleStateChanged() {
@@ -314,11 +345,11 @@
         handleRefreshState(null);
     }
 
-    protected abstract void setListening(boolean listening);
+    protected abstract void handleSetListening(boolean listening);
 
     protected void handleDestroy() {
         if (mListeners.size() != 0) {
-            setListening(false);
+            handleSetListening(false);
         }
         mCallbacks.clear();
     }
@@ -368,8 +399,10 @@
         private static final int REMOVE_CALLBACKS = 12;
         private static final int REMOVE_CALLBACK = 13;
         private static final int SET_LISTENING = 14;
+        private static final int STALE = 15;
 
-        private H(Looper looper) {
+        @VisibleForTesting
+        protected H(Looper looper) {
             super(looper);
         }
 
@@ -424,8 +457,11 @@
                     name = "handleClearState";
                     handleClearState();
                 } else if (msg.what == SET_LISTENING) {
-                    name = "setListening";
-                    setListening(msg.arg1 != 0);
+                    name = "handleSetListening";
+                    handleSetListening(msg.arg1 != 0);
+                } else if (msg.what == STALE) {
+                    name = "handleStale";
+                    handleStale();
                 } else {
                     throw new IllegalArgumentException("Unknown msg: " + msg.what);
                 }
@@ -439,15 +475,22 @@
 
     public static class DrawableIcon extends Icon {
         protected final Drawable mDrawable;
+        protected final Drawable mInvisibleDrawable;
 
         public DrawableIcon(Drawable drawable) {
             mDrawable = drawable;
+            mInvisibleDrawable = drawable.getConstantState().newDrawable();
         }
 
         @Override
         public Drawable getDrawable(Context context) {
             return mDrawable;
         }
+
+        @Override
+        public Drawable getInvisibleDrawable(Context context) {
+            return mInvisibleDrawable;
+        }
     }
 
     public static class DrawableIconWithRes extends DrawableIcon {
@@ -503,7 +546,7 @@
         }
     }
 
-    protected class AnimationIcon extends ResourceIcon {
+    protected static class AnimationIcon extends ResourceIcon {
         private final int mAnimatedResId;
 
         public AnimationIcon(int resId, int staticResId) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
index 2e7012e..bef1aff 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
@@ -110,7 +110,7 @@
         }
     }
 
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (mListening == listening) return;
         mListening = listening;
         if (listening) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BatterySaverTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BatterySaverTile.java
index 3f419a8..95504ed 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BatterySaverTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BatterySaverTile.java
@@ -55,7 +55,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mBatteryController.addCallback(this);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
index bc6233d..774f0b3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
@@ -76,7 +76,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mController.addCallback(mCallback);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
index 2fc9fc7..fb396b9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
@@ -91,9 +91,9 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (mController == null) return;
-        if (DEBUG) Log.d(TAG, "setListening " + listening);
+        if (DEBUG) Log.d(TAG, "handleSetListening " + listening);
         if (listening) {
             mController.addCallback(mCallback);
             mKeyguard.addCallback(mCallback);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index 0e0f949..2e389ba 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -92,7 +92,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mController.addCallback(mSignalCallback);
         } else {
@@ -112,6 +112,9 @@
 
     @Override
     protected void handleClick() {
+        if (getState().state == Tile.STATE_UNAVAILABLE) {
+            return;
+        }
         if (mDataController.isMobileDataEnabled()) {
             if (mKeyguardMonitor.isSecure() && !mKeyguardMonitor.canSkipBouncer()) {
                 mActivityStarter.postQSRunnableDismissingKeyguard(this::showDisableDialog);
@@ -183,9 +186,14 @@
         state.value = mDataController.isMobileDataSupported()
                 && mDataController.isMobileDataEnabled();
 
-        state.icon = new SignalIcon(cb.mobileSignalIconId);
-        if (cb.airplaneModeEnabled) {
-            state.state = Tile.STATE_INACTIVE;
+        if (cb.noSim) {
+            state.icon = ResourceIcon.get(R.drawable.ic_qs_no_sim);
+        } else {
+            state.icon = new SignalIcon(cb.mobileSignalIconId);
+        }
+
+        if (cb.airplaneModeEnabled | cb.noSim) {
+            state.state = Tile.STATE_UNAVAILABLE;
         } else {
             state.state = Tile.STATE_ACTIVE;
         }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
index 40fe484..b93f1c2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
@@ -63,7 +63,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         mSetting.setListening(listening);
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
index 8b62beb..a102696 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
@@ -45,7 +45,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mDataSaverController.addCallback(this);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
index 5938749..9e265e22 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
@@ -232,7 +232,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (mListening == listening) return;
         mListening = listening;
         if (mListening) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java
index e6ac908..f2ead1c 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java
@@ -54,7 +54,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mFlashlightController.addCallback(this);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index c17573d..910b6b1 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -74,7 +74,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (mListening == listening) return;
         mListening = listening;
         if (listening) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
index 00cfbfa..4f4004c 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
@@ -76,7 +76,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
index 5e66334..c35f591 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
@@ -55,7 +55,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mController.addCallback(mCallback);
             mKeyguard.addCallback(mCallback);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/NfcTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/NfcTile.java
index 6500740..b3ff4e5b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/NfcTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/NfcTile.java
@@ -51,7 +51,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         mListening = listening;
         if (mListening) {
             mContext.registerReceiver(mNfcReceiver,
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
index 2a12769..4c20361 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java
@@ -95,7 +95,7 @@
     }
 
     @Override
-    protected void setListening(boolean listening) {
+    protected void handleSetListening(boolean listening) {
         mIsListening = listening;
         if (listening) {
             mController.setListener(this);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
index fb937bd..1e00894 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
@@ -62,7 +62,7 @@
         return new BooleanState();
     }
 
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (mController == null) return;
         if (listening) {
             mController.addCallback(mCallback);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserTile.java
index d6043f4..bde1c98 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserTile.java
@@ -69,7 +69,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mUserInfoController.addCallback(this);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
index 136cf21..33b1512 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
@@ -75,7 +75,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mController.addCallback(mSignalCallback);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java
index 38821f6..5f7d6fb 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java
@@ -48,7 +48,7 @@
     }
 
     @Override
-    public void setListening(boolean listening) {
+    public void handleSetListening(boolean listening) {
         if (listening) {
             mProfileController.addCallback(this);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index f844866..f545556 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -65,6 +65,7 @@
 import com.android.systemui.recents.events.activity.LaunchTaskFailedEvent;
 import com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent;
 import com.android.systemui.recents.events.activity.MultiWindowStateChangedEvent;
+import com.android.systemui.recents.events.activity.RecentsActivityStartingEvent;
 import com.android.systemui.recents.events.activity.ToggleRecentsEvent;
 import com.android.systemui.recents.events.component.ActivityUnpinnedEvent;
 import com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent;
@@ -119,6 +120,7 @@
     private boolean mFinishedOnStartup;
     private boolean mIgnoreAltTabRelease;
     private boolean mIsVisible;
+    private boolean mRecentsStartRequested;
     private Configuration mLastConfig;
 
     // Top level views
@@ -416,6 +418,7 @@
             launchState.launchedFromHome = false;
             onEnterAnimationComplete();
         }
+        mRecentsStartRequested = false;
     }
 
     @Override
@@ -449,7 +452,6 @@
      * Reloads the stack views upon launching Recents.
      */
     private void reloadStackView() {
-
         // If the Recents component has preloaded a load plan, then use that to prevent
         // reconstructing the task stack
         RecentsTaskLoader loader = Recents.getTaskLoader();
@@ -572,7 +574,9 @@
         MetricsLogger.hidden(this, MetricsEvent.OVERVIEW_ACTIVITY);
         Recents.getTaskLoader().getHighResThumbnailLoader().setVisible(false);
 
-        if (!isChangingConfigurations()) {
+        // When recents starts again before onStop, do not reset launch flags so entrance animation
+        // can run
+        if (!isChangingConfigurations() && !mRecentsStartRequested) {
             // Workaround for b/22542869, if the RecentsActivity is started again, but without going
             // through SystemUI, we need to reset the config launch flags to ensure that we do not
             // wait on the system to send a signal that was never queued.
@@ -718,6 +722,10 @@
         MetricsLogger.action(this, MetricsEvent.ACTION_OVERVIEW_PAGE);
     }
 
+    public final void onBusEvent(RecentsActivityStartingEvent event) {
+        mRecentsStartRequested = true;
+    }
+
     public final void onBusEvent(UserInteractionEvent event) {
         // Stop the fast-toggle dozer
         mIterateTrigger.stopDozing();
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 71f06cb..c44cd72 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -205,6 +205,10 @@
                         mStackButtonShadowDistance.x, mStackButtonShadowDistance.y,
                         mStackButtonShadowColor);
             }
+            if (Recents.getConfiguration().isLowRamDevice) {
+                int bgColor = Utils.getColorAttr(mContext, R.attr.clearAllBackgroundColor);
+                mStackActionButton.setBackgroundColor(bgColor);
+            }
         }
 
         // Let's also require dark status and nav bars if the text is dark
@@ -955,8 +959,8 @@
         int left, top;
         if (Recents.getConfiguration().isLowRamDevice) {
             Rect windowRect = Recents.getSystemServices().getWindowRect();
-            left = (windowRect.width() - mSystemInsets.left - mSystemInsets.right
-                    - mStackActionButton.getMeasuredWidth()) / 2;
+            int spaceLeft = windowRect.width() - mSystemInsets.left - mSystemInsets.right;
+            left = (spaceLeft - mStackActionButton.getMeasuredWidth()) / 2 + mSystemInsets.left;
             top = windowRect.height() - (mStackActionButton.getMeasuredHeight()
                     + mSystemInsets.bottom + mStackActionButton.getPaddingBottom() / 2);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
index a633a3e..8899e30 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -2396,10 +2396,14 @@
     }
 
     private void updateStackActionButtonVisibility() {
+        if (Recents.getConfiguration().isLowRamDevice) {
+            return;
+        }
+
         // Always show the button in grid layout.
         if (useGridLayout() ||
                 (mStackScroller.getStackScroll() < SHOW_STACK_ACTION_BUTTON_SCROLL_THRESHOLD &&
-                        mStack.getTaskCount() > 0 && !Recents.getConfiguration().isLowRamDevice)) {
+                        mStack.getTaskCount() > 0)) {
             EventBus.getDefault().send(new ShowStackActionButtonEvent(false /* translate */));
         } else {
             EventBus.getDefault().send(new HideStackActionButtonEvent());
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/lowram/TaskStackLowRamLayoutAlgorithm.java b/packages/SystemUI/src/com/android/systemui/recents/views/lowram/TaskStackLowRamLayoutAlgorithm.java
index 52fa7b5..17e6b9e 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/lowram/TaskStackLowRamLayoutAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/lowram/TaskStackLowRamLayoutAlgorithm.java
@@ -126,7 +126,6 @@
             return transformOut;
         }
         boolean visible = true;
-        int x = mPaddingLeftRight;
         int y;
         if (taskCount > 1) {
             y = getTaskTopFromIndex(taskIndex) - percentageToScroll(stackScroll);
@@ -255,7 +254,7 @@
         transformOut.dimAlpha = 0f;
         transformOut.viewOutlineAlpha = 1f;
         transformOut.rect.set(getTaskRect());
-        transformOut.rect.offset(mPaddingLeftRight, y);
+        transformOut.rect.offset(mPaddingLeftRight + mSystemInsets.left, y);
         Utilities.scaleRectAboutCenter(transformOut.rect, transformOut.scale);
         transformOut.visible = visible;
     }
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index a35310f..991c3c8 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -16,11 +16,16 @@
 
 package com.android.systemui.screenshot;
 
+import static com.android.systemui.screenshot.GlobalScreenshot.SHARING_INTENT;
+import static com.android.systemui.statusbar.phone.StatusBar.SYSTEM_DIALOG_REASON_SCREENSHOT;
+
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
 import android.animation.AnimatorSet;
 import android.animation.ValueAnimator;
 import android.animation.ValueAnimator.AnimatorUpdateListener;
+import android.app.ActivityManager;
+import android.app.ActivityOptions;
 import android.app.admin.DevicePolicyManager;
 import android.app.Notification;
 import android.app.Notification.BigPictureStyle;
@@ -48,6 +53,7 @@
 import android.os.Environment;
 import android.os.PowerManager;
 import android.os.Process;
+import android.os.RemoteException;
 import android.os.UserHandle;
 import android.provider.MediaStore;
 import android.util.DisplayMetrics;
@@ -277,14 +283,13 @@
             sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
             sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
 
-            // Create a share action for the notification
-            PendingIntent chooseAction = PendingIntent.getBroadcast(context, 0,
-                    new Intent(context, GlobalScreenshot.TargetChosenReceiver.class),
-                    PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
-            Intent chooserIntent = Intent.createChooser(sharingIntent, null,
-                    chooseAction.getIntentSender())
-                    .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
-            PendingIntent shareAction = PendingIntent.getActivity(context, 0, chooserIntent,
+            // Create a share action for the notification. Note, we proxy the call to ShareReceiver
+            // because RemoteViews currently forces an activity options on the PendingIntent being
+            // launched, and since we don't want to trigger the share sheet in this case, we will
+            // start the chooser activitiy directly in ShareReceiver.
+            PendingIntent shareAction = PendingIntent.getBroadcast(context, 0,
+                    new Intent(context, GlobalScreenshot.ShareReceiver.class)
+                            .putExtra(SHARING_INTENT, sharingIntent),
                     PendingIntent.FLAG_CANCEL_CURRENT);
             Notification.Action.Builder shareActionBuilder = new Notification.Action.Builder(
                     R.drawable.ic_screenshot_share,
@@ -292,7 +297,7 @@
             mNotificationBuilder.addAction(shareActionBuilder.build());
 
             // Create a delete action for the notification
-            PendingIntent deleteAction = PendingIntent.getBroadcast(context,  0,
+            PendingIntent deleteAction = PendingIntent.getBroadcast(context, 0,
                     new Intent(context, GlobalScreenshot.DeleteScreenshotReceiver.class)
                             .putExtra(GlobalScreenshot.SCREENSHOT_URI_ID, uri.toString()),
                     PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
@@ -403,6 +408,7 @@
 
 class GlobalScreenshot {
     static final String SCREENSHOT_URI_ID = "android:screenshot_uri_id";
+    static final String SHARING_INTENT = "android:screenshot_sharing_intent";
 
     private static final int SCREENSHOT_FLASH_TO_PEAK_DURATION = 130;
     private static final int SCREENSHOT_DROP_IN_DURATION = 430;
@@ -897,6 +903,30 @@
     }
 
     /**
+     * Receiver to proxy the share intent.
+     */
+    public static class ShareReceiver extends BroadcastReceiver {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            try {
+                ActivityManager.getService().closeSystemDialogs(SYSTEM_DIALOG_REASON_SCREENSHOT);
+            } catch (RemoteException e) {
+            }
+
+            Intent sharingIntent = intent.getParcelableExtra(SHARING_INTENT);
+            PendingIntent chooseAction = PendingIntent.getBroadcast(context, 0,
+                    new Intent(context, GlobalScreenshot.TargetChosenReceiver.class),
+                    PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
+            Intent chooserIntent = Intent.createChooser(sharingIntent, null,
+                    chooseAction.getIntentSender())
+                    .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
+            ActivityOptions opts = ActivityOptions.makeBasic();
+            opts.setDisallowEnterPictureInPictureWhileLaunching(true);
+            context.startActivityAsUser(chooserIntent, opts.toBundle(), UserHandle.CURRENT);
+        }
+    }
+
+    /**
      * Removes the notification for a screenshot after a share target is chosen.
      */
     public static class TargetChosenReceiver extends BroadcastReceiver {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java
index 1ffb3b5..3b23a0c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java
@@ -126,7 +126,7 @@
                             | PackageManager.MATCH_DIRECT_BOOT_UNAWARE
                             | PackageManager.MATCH_DIRECT_BOOT_AWARE);
             if (info != null) {
-                mAppUid = info.uid;
+                mAppUid = sbn.getUid();
                 mAppName = String.valueOf(pm.getApplicationLabel(info));
                 pkgicon = pm.getApplicationIcon(info);
             }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 5eefe9a..5557dde 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -22,10 +22,12 @@
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
+import android.graphics.Rect;
 import android.os.SystemProperties;
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
 import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.android.systemui.Interpolators;
@@ -53,6 +55,7 @@
             SystemProperties.getBoolean("debug.icon_opening_animations", true);
     private static final boolean ICON_ANMATIONS_WHILE_SCROLLING
             = SystemProperties.getBoolean("debug.icon_scroll_animations", true);
+    private static final int TAG_CONTINUOUS_CLIPPING = R.id.continuous_clipping_tag;
     private ViewInvertHelper mViewInvertHelper;
     private boolean mDark;
     private NotificationIconContainer mShelfIcons;
@@ -305,6 +308,16 @@
         mShelfIcons.setSpeedBumpIndex(mAmbientState.getSpeedBumpIndex());
         mShelfIcons.calculateIconTranslations();
         mShelfIcons.applyIconStates();
+        for (int i = 0; i < mHostLayout.getChildCount(); i++) {
+            View child = mHostLayout.getChildAt(i);
+            if (!(child instanceof ExpandableNotificationRow)
+                    || child.getVisibility() == GONE) {
+                continue;
+            }
+            ExpandableNotificationRow row = (ExpandableNotificationRow) child;
+            updateIconClipAmount(row);
+            updateContinuousClipping(row);
+        }
         boolean hideBackground = numViewsInShelf < 1.0f;
         setHideBackground(hideBackground || backgroundForceHidden);
         if (mNotGoneIndex == -1) {
@@ -312,6 +325,43 @@
         }
     }
 
+    private void updateIconClipAmount(ExpandableNotificationRow row) {
+        float maxTop = row.getTranslationY();
+        StatusBarIconView icon = row.getEntry().expandedIcon;
+        float shelfIconPosition = getTranslationY() + icon.getTop() + icon.getTranslationY();
+        if (shelfIconPosition < maxTop) {
+            int top = (int) (maxTop - shelfIconPosition);
+            Rect clipRect = new Rect(0, top, icon.getWidth(), Math.max(top, icon.getHeight()));
+            icon.setClipBounds(clipRect);
+        } else {
+            icon.setClipBounds(null);
+        }
+    }
+
+    private void updateContinuousClipping(final ExpandableNotificationRow row) {
+        StatusBarIconView icon = row.getEntry().expandedIcon;
+        boolean needsContinuousClipping = ViewState.isAnimatingY(icon);
+        boolean isContinuousClipping = icon.getTag(TAG_CONTINUOUS_CLIPPING) != null;
+        if (needsContinuousClipping && !isContinuousClipping) {
+            ViewTreeObserver.OnPreDrawListener predrawListener =
+                    new ViewTreeObserver.OnPreDrawListener() {
+                        @Override
+                        public boolean onPreDraw() {
+                            boolean animatingY = ViewState.isAnimatingY(icon);
+                            if (!animatingY || !icon.isAttachedToWindow()) {
+                                icon.getViewTreeObserver().removeOnPreDrawListener(this);
+                                icon.setTag(TAG_CONTINUOUS_CLIPPING, null);
+                                return true;
+                            }
+                            updateIconClipAmount(row);
+                            return true;
+                        }
+                    };
+            icon.getViewTreeObserver().addOnPreDrawListener(predrawListener);
+            icon.setTag(TAG_CONTINUOUS_CLIPPING, predrawListener);
+        }
+    }
+
     private void updateNotificationClipHeight(ExpandableNotificationRow row,
             float notificationClipEnd) {
         float viewEnd = row.getTranslationY() + row.getActualHeight();
@@ -330,6 +380,15 @@
         }
     }
 
+    @Override
+    public void setFakeShadowIntensity(float shadowIntensity, float outlineAlpha, int shadowYEnd,
+            int outlineTranslation) {
+        if (!mHasItemsInStableShelf) {
+            shadowIntensity = 0.0f;
+        }
+        super.setFakeShadowIntensity(shadowIntensity, outlineAlpha, shadowYEnd, outlineTranslation);
+    }
+
     /**
      * @return the icon amount how much this notification is in the shelf;
      */
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index 25f3e25..759d2cf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -43,6 +43,7 @@
 import com.android.systemui.statusbar.phone.StatusBarIconController;
 import com.android.systemui.statusbar.policy.DarkIconDispatcher;
 import com.android.systemui.statusbar.policy.DarkIconDispatcher.DarkReceiver;
+import com.android.systemui.statusbar.policy.IconLogger;
 import com.android.systemui.statusbar.policy.NetworkController;
 import com.android.systemui.statusbar.policy.NetworkController.IconState;
 import com.android.systemui.statusbar.policy.NetworkControllerImpl;
@@ -65,6 +66,7 @@
     private static final String SLOT_MOBILE = "mobile";
     private static final String SLOT_WIFI = "wifi";
     private static final String SLOT_ETHERNET = "ethernet";
+    private static final String SLOT_VPN = "vpn";
 
     private final NetworkController mNetworkController;
     private final SecurityController mSecurityController;
@@ -117,6 +119,8 @@
     private boolean mActivityEnabled;
     private boolean mForceBlockWifi;
 
+    private final IconLogger mIconLogger = Dependency.get(IconLogger.class);
+
     public SignalClusterView(Context context) {
         this(context, null);
     }
@@ -447,14 +451,15 @@
     private void apply() {
         if (mWifiGroup == null) return;
 
-        mVpn.setVisibility(mVpnVisible ? View.VISIBLE : View.GONE);
         if (mVpnVisible) {
             if (mLastVpnIconId != mVpnIconId) {
                 setIconForView(mVpn, mVpnIconId);
                 mLastVpnIconId = mVpnIconId;
             }
+            mIconLogger.onIconShown(SLOT_VPN);
             mVpn.setVisibility(View.VISIBLE);
         } else {
+            mIconLogger.onIconHidden(SLOT_VPN);
             mVpn.setVisibility(View.GONE);
         }
         if (DEBUG) Log.d(TAG, String.format("vpn: %s", mVpnVisible ? "VISIBLE" : "GONE"));
@@ -466,8 +471,10 @@
                 mLastEthernetIconId = mEthernetIconId;
             }
             mEthernetGroup.setContentDescription(mEthernetDescription);
+            mIconLogger.onIconShown(SLOT_ETHERNET);
             mEthernetGroup.setVisibility(View.VISIBLE);
         } else {
+            mIconLogger.onIconHidden(SLOT_ETHERNET);
             mEthernetGroup.setVisibility(View.GONE);
         }
 
@@ -481,9 +488,11 @@
                 setIconForView(mWifiDark, mWifiStrengthId);
                 mLastWifiStrengthId = mWifiStrengthId;
             }
+            mIconLogger.onIconShown(SLOT_WIFI);
             mWifiGroup.setContentDescription(mWifiDescription);
             mWifiGroup.setVisibility(View.VISIBLE);
         } else {
+            mIconLogger.onIconHidden(SLOT_WIFI);
             mWifiGroup.setVisibility(View.GONE);
         }
 
@@ -505,6 +514,11 @@
                 }
             }
         }
+        if (anyMobileVisible) {
+            mIconLogger.onIconShown(SLOT_MOBILE);
+        } else {
+            mIconLogger.onIconHidden(SLOT_MOBILE);
+        }
 
         if (mIsAirplaneMode) {
             if (mLastAirplaneIconId != mAirplaneIconId) {
@@ -512,8 +526,10 @@
                 mLastAirplaneIconId = mAirplaneIconId;
             }
             mAirplane.setContentDescription(mAirplaneContentDescription);
+            mIconLogger.onIconShown(SLOT_AIRPLANE);
             mAirplane.setVisibility(View.VISIBLE);
         } else {
+            mIconLogger.onIconHidden(SLOT_AIRPLANE);
             mAirplane.setVisibility(View.GONE);
         }
 
@@ -529,7 +545,13 @@
             mWifiSignalSpacer.setVisibility(View.GONE);
         }
 
-        mNoSimsCombo.setVisibility(mNoSimsVisible ? View.VISIBLE : View.GONE);
+        if (mNoSimsVisible) {
+            mIconLogger.onIconShown(SLOT_MOBILE);
+            mNoSimsCombo.setVisibility(View.VISIBLE);
+        } else {
+            mIconLogger.onIconHidden(SLOT_MOBILE);
+            mNoSimsCombo.setVisibility(View.GONE);
+        }
 
         boolean anythingVisible = mNoSimsVisible || mWifiVisible || mIsAirplaneMode
                 || anyMobileVisible || mVpnVisible || mEthernetVisible;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
index fcc982ea..b95b8a3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHeaderViewWrapper.java
@@ -114,7 +114,6 @@
         mIcon = mView.findViewById(com.android.internal.R.id.icon);
         mHeaderText = mView.findViewById(com.android.internal.R.id.header_text);
         mExpandButton = mView.findViewById(com.android.internal.R.id.expand_button);
-        mExpandButton.setLabeledBy(mRow);
         mWorkProfileImage = mView.findViewById(com.android.internal.R.id.profile_badge);
         mColor = resolveColor(mExpandButton);
         mNotificationHeader = mView.findViewById(com.android.internal.R.id.notification_header);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
index f379a46..1f44abe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java
@@ -41,8 +41,6 @@
     private static final boolean DEBUG = false;
     private static final boolean DEBUG_COLORS = false;
 
-    public static final boolean HIGH_END = ActivityManager.isHighEndGfx();
-
     public static final int MODE_OPAQUE = 0;
     public static final int MODE_SEMI_TRANSPARENT = 1;
     public static final int MODE_TRANSLUCENT = 2;
@@ -66,9 +64,7 @@
         mTag = "BarTransitions." + view.getClass().getSimpleName();
         mView = view;
         mBarBackground = new BarBackgroundDrawable(mView.getContext(), gradientResourceId);
-        if (HIGH_END) {
-            mView.setBackground(mBarBackground);
-        }
+        mView.setBackground(mBarBackground);
     }
 
     public int getMode() {
@@ -89,7 +85,7 @@
 
     public boolean isAlwaysOpaque() {
         // Low-end devices do not support translucent modes, fallback to opaque
-        return !HIGH_END || mAlwaysOpaque;
+        return mAlwaysOpaque;
     }
 
     public void transitionTo(int mode, boolean animate) {
@@ -109,9 +105,7 @@
     }
 
     protected void onTransition(int oldMode, int newMode, boolean animate) {
-        if (HIGH_END) {
-            applyModeBackground(oldMode, newMode, animate);
-        }
+        applyModeBackground(oldMode, newMode, animate);
     }
 
     protected void applyModeBackground(int oldMode, int newMode, boolean animate) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
index 8c923cb..2c3f452 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
@@ -161,10 +161,6 @@
                 showNotificationIconArea(animate);
             }
         }
-        if (!BarTransitions.HIGH_END) {
-            int mask = DISABLE_NOTIFICATION_ICONS | DISABLE_SYSTEM_INFO;
-            getView().setVisibility((mDisabled1 & mask) == mask ? View.GONE : View.VISIBLE);
-        }
     }
 
     protected int adjustDisableFlags(int state) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java
index 316d229..00cb532 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java
@@ -85,6 +85,11 @@
     public static final int MODE_DISMISS_BOUNCER = 6;
 
     /**
+     * Mode in which fingerprint wakes and unlocks the device from a dream.
+     */
+    public static final int MODE_WAKE_AND_UNLOCK_FROM_DREAM = 7;
+
+    /**
      * How much faster we collapse the lockscreen when authenticating with fingerprint.
      */
     private static final float FINGERPRINT_COLLAPSE_SPEEDUP_FACTOR = 1.1f;
@@ -230,16 +235,19 @@
                 }
                 Trace.endSection();
                 break;
+            case MODE_WAKE_AND_UNLOCK_FROM_DREAM:
             case MODE_WAKE_AND_UNLOCK_PULSING:
             case MODE_WAKE_AND_UNLOCK:
                 if (mMode == MODE_WAKE_AND_UNLOCK_PULSING) {
                     Trace.beginSection("MODE_WAKE_AND_UNLOCK_PULSING");
                     mStatusBar.updateMediaMetaData(false /* metaDataChanged */,
                             true /* allowEnterAnimation */);
-                } else {
+                } else if (mMode == MODE_WAKE_AND_UNLOCK){
                     Trace.beginSection("MODE_WAKE_AND_UNLOCK");
-
                     mDozeScrimController.abortDoze();
+                } else {
+                    Trace.beginSection("MODE_WAKE_AND_UNLOCK_FROM_DREAM");
+                    mUpdateMonitor.awakenFromDream();
                 }
                 mStatusBarWindowManager.setStatusBarFocusable(false);
                 mKeyguardViewMediator.onWakeAndUnlocking();
@@ -299,6 +307,7 @@
 
     private int calculateMode() {
         boolean unlockingAllowed = mUpdateMonitor.isUnlockingWithFingerprintAllowed();
+        boolean deviceDreaming = mUpdateMonitor.isDreaming();
 
         if (!mUpdateMonitor.isDeviceInteractive()) {
             if (!mStatusBarKeyguardViewManager.isShowing()) {
@@ -311,6 +320,9 @@
                 return MODE_SHOW_BOUNCER;
             }
         }
+        if (unlockingAllowed && deviceDreaming) {
+            return MODE_WAKE_AND_UNLOCK_FROM_DREAM;
+        }
         if (mStatusBarKeyguardViewManager.isShowing()) {
             if (mStatusBarKeyguardViewManager.isBouncerShowing() && unlockingAllowed) {
                 return MODE_DISMISS_BOUNCER;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
index fd95cc4..165ed78 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
@@ -27,6 +27,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewTreeObserver;
+import android.view.WindowInsets;
 import android.view.accessibility.AccessibilityEvent;
 
 import com.android.internal.widget.LockPatternUtils;
@@ -247,12 +248,16 @@
         removeView();
         mHandler.removeCallbacks(mRemoveViewRunnable);
         mRoot = (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.keyguard_bouncer, null);
-        mKeyguardView = (KeyguardHostView) mRoot.findViewById(R.id.keyguard_host_view);
+        mKeyguardView = mRoot.findViewById(R.id.keyguard_host_view);
         mKeyguardView.setLockPatternUtils(mLockPatternUtils);
         mKeyguardView.setViewMediatorCallback(mCallback);
         mContainer.addView(mRoot, mContainer.getChildCount());
         mRoot.setVisibility(View.INVISIBLE);
-        mRoot.dispatchApplyWindowInsets(mRoot.getRootWindowInsets());
+
+        final WindowInsets rootInsets = mRoot.getRootWindowInsets();
+        if (rootInsets != null) {
+            mRoot.dispatchApplyWindowInsets(rootInsets);
+        }
     }
 
     protected void removeView() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarController.java
index 917a56f..533771a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarController.java
@@ -72,6 +72,7 @@
 
     private final Rect mLastFullscreenBounds = new Rect();
     private final Rect mLastDockedBounds = new Rect();
+    private boolean mQsCustomizing;
 
     public LightBarController(Context ctx) {
         mDarkModeColor = Color.valueOf(ctx.getColor(R.color.dark_mode_icon_color_single_tone));
@@ -129,7 +130,8 @@
             mHasLightNavigationBar = isLight(vis, navigationBarMode,
                     View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
             mNavigationLight = mHasLightNavigationBar
-                    && (mScrimAlphaBelowThreshold || !mInvertLightNavBarWithScrim);
+                    && (mScrimAlphaBelowThreshold || !mInvertLightNavBarWithScrim)
+                    && !mQsCustomizing;
             if (mNavigationLight != last) {
                 updateNavigation();
             }
@@ -146,6 +148,12 @@
                 mLastNavigationBarMode);
     }
 
+    public void setQsCustomizing(boolean customizing) {
+        if (mQsCustomizing == customizing) return;
+        mQsCustomizing = customizing;
+        reevaluate();
+    }
+
     public void setScrimAlpha(float alpha) {
         mScrimAlpha = alpha;
         boolean belowThresholdBefore = mScrimAlphaBelowThreshold;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarTransitionsController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarTransitionsController.java
index d3a6280..b0ac6ec 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarTransitionsController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarTransitionsController.java
@@ -127,11 +127,6 @@
     }
 
     public void setIconsDark(boolean dark, boolean animate) {
-        if (!BarTransitions.HIGH_END) {
-            setIconTintInternal(0.0f);
-            mNextDarkIntensity = 0.0f;
-            return;
-        }
         if (!animate) {
             setIconTintInternal(dark ? 1.0f : 0.0f);
             mNextDarkIntensity = dark ? 1.0f : 0.0f;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java
index 004a604..1452e0c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java
@@ -87,7 +87,8 @@
             if (mTouchingChild != null) {
                 event.offsetLocation(mTouchingChild.getWidth() / 2 - event.getX(),
                         mTouchingChild.getHeight() / 2 - event.getY());
-                return mTouchingChild.dispatchTouchEvent(event);
+                return mTouchingChild.getVisibility() == VISIBLE
+                        && mTouchingChild.dispatchTouchEvent(event);
             }
         }
         return super.onTouchEvent(event);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 0575e21..00ba1f2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -300,6 +300,7 @@
     // Should match the values in PhoneWindowManager
     public static final String SYSTEM_DIALOG_REASON_HOME_KEY = "homekey";
     public static final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps";
+    static public final String SYSTEM_DIALOG_REASON_SCREENSHOT = "screenshot";
 
     private static final String BANNER_ACTION_CANCEL =
             "com.android.systemui.statusbar.banner_action_cancel";
@@ -1124,7 +1125,7 @@
             }
         });
 
-        mLightBarController = new LightBarController(context);
+        mLightBarController = Dependency.get(LightBarController.class);
         if (mNavigationBar != null) {
             mNavigationBar.setLightBarController(mLightBarController);
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
index 70b92ad..68f8e06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
@@ -20,12 +20,8 @@
 import android.graphics.drawable.Icon;
 import android.os.Bundle;
 import android.os.UserHandle;
-import android.text.TextUtils;
 import android.util.ArraySet;
-import android.view.Gravity;
-import android.view.View;
 import android.view.ViewGroup;
-import android.widget.ImageView;
 import android.widget.LinearLayout;
 
 import com.android.internal.statusbar.StatusBarIcon;
@@ -38,6 +34,7 @@
 import com.android.systemui.statusbar.policy.ConfigurationController;
 import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
 import com.android.systemui.statusbar.policy.DarkIconDispatcher;
+import com.android.systemui.statusbar.policy.IconLogger;
 import com.android.systemui.tuner.TunerService;
 import com.android.systemui.tuner.TunerService.Tunable;
 
@@ -61,6 +58,7 @@
     private final ArrayList<IconManager> mIconGroups = new ArrayList<>();
 
     private final ArraySet<String> mIconBlacklist = new ArraySet<>();
+    private final IconLogger mIconLogger = Dependency.get(IconLogger.class);
 
     public StatusBarIconControllerImpl(Context context) {
         super(context.getResources().getStringArray(
@@ -122,6 +120,7 @@
         int viewIndex = getViewIndex(index);
         boolean blocked = mIconBlacklist.contains(slot);
 
+        mIconLogger.onIconVisibility(getSlot(index), icon.visible);
         mIconGroups.forEach(l -> l.onIconAdded(viewIndex, slot, blocked, icon));
     }
 
@@ -174,6 +173,7 @@
         if (getIcon(index) == null) {
             return;
         }
+        mIconLogger.onIconHidden(getSlot(index));
         super.removeIcon(index);
         int viewIndex = getViewIndex(index);
         mIconGroups.forEach(l -> l.onRemoveIcon(viewIndex));
@@ -196,6 +196,7 @@
 
     private void handleSet(int index, StatusBarIcon icon) {
         int viewIndex = getViewIndex(index);
+        mIconLogger.onIconVisibility(getSlot(index), icon.visible);
         mIconGroups.forEach(l -> l.onSetIcon(viewIndex, icon));
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
index 1411a54..f9c2130 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
@@ -159,6 +159,11 @@
         public void onScreenTurnedOff() {
             update(false /* updateAlways */);
         }
+
+        @Override
+        public void onKeyguardVisibilityChanged(boolean showing) {
+            update(false /* updateAlways */);
+        }
     };
 
     public boolean isTrustManaged() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
index f0af77d..4c92d01 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
@@ -24,7 +24,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.content.res.Configuration;
 import android.content.res.TypedArray;
 import android.graphics.Rect;
 import android.os.Bundle;
@@ -193,8 +192,9 @@
     }
 
     private void updateClockVisibility() {
-        int visibility = (mClockVisibleByPolicy && mClockVisibleByUser)
-                ? View.VISIBLE : View.GONE;
+        boolean visible = mClockVisibleByPolicy && mClockVisibleByUser;
+        Dependency.get(IconLogger.class).onIconVisibility("clock", visible);
+        int visibility = visible ? View.VISIBLE : View.GONE;
         setVisibility(visibility);
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/IconLogger.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/IconLogger.java
new file mode 100644
index 0000000..710e1df
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/IconLogger.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+public interface IconLogger {
+
+    void onIconShown(String tag);
+    void onIconHidden(String tag);
+
+    default void onIconVisibility(String tag, boolean visible) {
+        if (visible) {
+            onIconShown(tag);
+        } else {
+            onIconHidden(tag);
+        }
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/IconLoggerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/IconLoggerImpl.java
new file mode 100644
index 0000000..0c201c3
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/IconLoggerImpl.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_NUM_STATUS_ICONS;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_STATUS_ICONS;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.STATUS_BAR_ICONS_CHANGED;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_ACTION;
+
+import android.content.Context;
+import android.metrics.LogMaker;
+import android.os.Handler;
+import android.os.Looper;
+import android.support.annotation.VisibleForTesting;
+import android.util.ArraySet;
+
+import com.android.internal.logging.MetricsLogger;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class IconLoggerImpl implements IconLogger {
+
+    // Minimum ms between log statements.
+    // NonFinalForTesting
+    @VisibleForTesting
+    protected static long MIN_LOG_INTERVAL = 1000;
+
+    private final Context mContext;
+    private final Handler mHandler;
+    private final MetricsLogger mLogger;
+    private final ArraySet<String> mIcons = new ArraySet<>();
+    private final List<String> mIconIndex;
+    private long mLastLog = System.currentTimeMillis();
+
+    public IconLoggerImpl(Context context, Looper bgLooper, MetricsLogger logger) {
+        mContext = context;
+        mHandler = new Handler(bgLooper);
+        mLogger = logger;
+        String[] icons = mContext.getResources().getStringArray(
+                com.android.internal.R.array.config_statusBarIcons);
+        mIconIndex = Arrays.asList(icons);
+        doLog();
+    }
+
+    @Override
+    public void onIconShown(String tag) {
+        synchronized (mIcons) {
+            if (mIcons.contains(tag)) return;
+            mIcons.add(tag);
+        }
+        if (!mHandler.hasCallbacks(mLog)) {
+            mHandler.postDelayed(mLog, MIN_LOG_INTERVAL);
+        }
+    }
+
+    @Override
+    public void onIconHidden(String tag) {
+        synchronized (mIcons) {
+            if (!mIcons.contains(tag)) return;
+            mIcons.remove(tag);
+        }
+        if (!mHandler.hasCallbacks(mLog)) {
+            mHandler.postDelayed(mLog, MIN_LOG_INTERVAL);
+        }
+    }
+
+    private void doLog() {
+        long time = System.currentTimeMillis();
+        long timeSinceLastLog = time - mLastLog;
+        mLastLog = time;
+
+        ArraySet<String> icons;
+        synchronized (mIcons) {
+            icons = new ArraySet<>(mIcons);
+        }
+        mLogger.write(new LogMaker(STATUS_BAR_ICONS_CHANGED)
+                .setType(TYPE_ACTION)
+                .setLatency(timeSinceLastLog)
+                .addTaggedData(FIELD_NUM_STATUS_ICONS, icons.size())
+                .addTaggedData(FIELD_STATUS_ICONS, getBitField(icons)));
+    }
+
+    private int getBitField(ArraySet<String> icons) {
+        int iconsVisible = 0;
+        for (String icon : icons) {
+            int index = mIconIndex.indexOf(icon);
+            if (index >= 0) {
+                iconsVisible |= (1 << index);
+            }
+        }
+        return iconsVisible;
+    }
+
+    private final Runnable mLog = this::doLog;
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index 34a03bf..652f8bb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -182,6 +182,7 @@
         mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_EVDO_B, TelephonyIcons.THREE_G);
         mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_EHRPD, TelephonyIcons.THREE_G);
         mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_UMTS, TelephonyIcons.THREE_G);
+        mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_TD_SCDMA, TelephonyIcons.THREE_G);
 
         if (!mConfig.showAtLeast3G) {
             mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_UNKNOWN,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 4e592db..75532d9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -23,14 +23,12 @@
 import android.animation.TimeAnimator;
 import android.animation.ValueAnimator;
 import android.animation.ValueAnimator.AnimatorUpdateListener;
-import android.annotation.ColorInt;
 import android.annotation.FloatRange;
 import android.annotation.Nullable;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
 import android.graphics.Canvas;
-import android.graphics.Color;
 import android.graphics.Paint;
 import android.graphics.PointF;
 import android.graphics.PorterDuff;
@@ -1083,6 +1081,20 @@
 
     @Override
     public ExpandableView getChildAtPosition(float touchX, float touchY) {
+        return getChildAtPosition(touchX, touchY, true /* requireMinHeight */);
+
+    }
+
+    /**
+     * Get the child at a certain screen location.
+     *
+     * @param touchX the x coordinate
+     * @param touchY the y coordinate
+     * @param requireMinHeight Whether a minimum height is required for a child to be returned.
+     * @return the child at the given location.
+     */
+    private ExpandableView getChildAtPosition(float touchX, float touchY,
+            boolean requireMinHeight) {
         // find the view under the pointer, accounting for GONE views
         final int count = getChildCount();
         for (int childIdx = 0; childIdx < count; childIdx++) {
@@ -1101,7 +1113,7 @@
             int left = 0;
             int right = getWidth();
 
-            if (bottom - top >= mMinInteractionHeight
+            if ((bottom - top >= mMinInteractionHeight || !requireMinHeight)
                     && touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
                 if (slidingChild instanceof ExpandableNotificationRow) {
                     ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
@@ -3220,7 +3232,7 @@
             case MotionEvent.ACTION_DOWN: {
                 final int y = (int) ev.getY();
                 mScrolledToTopOnFirstDown = isScrolledToTop();
-                if (getChildAtPosition(ev.getX(), y) == null) {
+                if (getChildAtPosition(ev.getX(), y, false /* requireMinHeight */) == null) {
                     setIsBeingDragged(false);
                     recycleVelocityTracker();
                     break;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/SysuiTestCase.java b/packages/SystemUI/tests/src/com/android/systemui/SysuiTestCase.java
index 66d00dd..65d9699 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/SysuiTestCase.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/SysuiTestCase.java
@@ -54,6 +54,7 @@
     @Before
     public void SysuiSetup() throws Exception {
         System.setProperty("dexmaker.share_classloader", "true");
+        mContext.setTheme(R.style.Theme_SystemUI);
         SystemUIFactory.createFromConfig(mContext);
 
         mRealInstrumentation = InstrumentationRegistry.getInstrumentation();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileImplTest.java
index 0500a54..004ff29 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileImplTest.java
@@ -21,13 +21,19 @@
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_QS_VALUE;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_ACTION;
 
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Matchers.argThat;
+import static org.mockito.Mockito.clearInvocations;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import static java.lang.Thread.sleep;
+
 import android.content.Intent;
 import android.metrics.LogMaker;
 import android.support.test.filters.SmallTest;
@@ -66,10 +72,10 @@
         mMetricsLogger = mDependency.injectMockDependency(MetricsLogger.class);
         mHost = mock(QSTileHost.class);
         when(mHost.indexOf(spec)).thenReturn(POSITION);
-        mTestableLooper.runWithLooper(() -> {
-            mTile = new TileImpl(mHost);
-            mTile.setTileSpec(spec);
-        });
+
+        mTile = spy(new TileImpl(mHost));
+        mTile.mHandler = mTile.new H(mTestableLooper.getLooper());
+        mTile.setTileSpec(spec);
     }
 
     @Test
@@ -94,12 +100,38 @@
     public void testPopulate() {
         LogMaker maker = mock(LogMaker.class);
         when(maker.setSubtype(anyInt())).thenReturn(maker);
+        when(maker.addTaggedData(anyInt(), any())).thenReturn(maker);
         mTile.getState().value = true;
         mTile.populate(maker);
         verify(maker).addTaggedData(eq(FIELD_QS_VALUE), eq(1));
         verify(maker).addTaggedData(eq(FIELD_QS_POSITION), eq(POSITION));
     }
 
+    @Test
+    public void testStaleTimeout() throws InterruptedException {
+        when(mTile.getStaleTimeout()).thenReturn(5l);
+        clearInvocations(mTile);
+
+        mTile.handleRefreshState(null);
+        mTestableLooper.processAllMessages();
+        verify(mTile, never()).handleStale();
+
+        sleep(10);
+        mTestableLooper.processAllMessages();
+        verify(mTile).handleStale();
+    }
+
+    @Test
+    public void testStaleListening() {
+        mTile.handleStale();
+        mTestableLooper.processAllMessages();
+        verify(mTile).handleSetListening(eq(true));
+
+        mTile.handleRefreshState(null);
+        mTestableLooper.processAllMessages();
+        verify(mTile).handleSetListening(eq(false));
+    }
+
     private class TileLogMatcher implements ArgumentMatcher<LogMaker> {
 
         private final int mCategory;
@@ -164,7 +196,7 @@
         }
 
         @Override
-        protected void setListening(boolean listening) {
+        protected void handleSetListening(boolean listening) {
 
         }
 
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java
index b6827ea..88fa659 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java
@@ -121,7 +121,7 @@
         mDefaultNotificationChannel = new NotificationChannel(
                 NotificationChannel.DEFAULT_CHANNEL_ID, TEST_CHANNEL_NAME,
                 NotificationManager.IMPORTANCE_LOW);
-        mSbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME, 0, null, 0, 0,
+        mSbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME, 0, null, TEST_UID, 0,
                 new Notification(), UserHandle.CURRENT, null, 0);
     }
 
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
index 54a96cd..83a2883 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationInflaterTest.java
@@ -184,7 +184,9 @@
         countDownLatch.await();
     }
 
+    /* Cancelling requires us to be on the UI thread otherwise we might have a race */
     @Test
+    @UiThreadTest
     public void testSupersedesExistingTask() throws Exception {
         mNotificationInflater.inflateNotificationViews();
         mNotificationInflater.setIsLowPriority(true);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
new file mode 100644
index 0000000..4051220
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.statusbar.phone;
+
+import static org.mockito.Mockito.mock;
+
+import android.content.Context;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+import android.test.UiThreadTest;
+import android.view.ContextThemeWrapper;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+
+import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.ViewMediatorCallback;
+import com.android.systemui.R;
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.keyguard.DismissCallbackRegistry;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class KeyguardBouncerTest extends SysuiTestCase {
+
+    @UiThreadTest
+    @Test
+    public void inflateDetached() {
+        final ViewGroup container = new FrameLayout(getContext());
+        final KeyguardBouncer bouncer = new KeyguardBouncer(getContext(),
+                mock(ViewMediatorCallback.class), mock(LockPatternUtils.class), container, mock(
+                DismissCallbackRegistry.class));
+
+        // Detached bouncer should still be able to be inflated
+        bouncer.inflateView();
+    }
+
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
index ed1491d3..500d620 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
@@ -71,6 +71,24 @@
     }
 
     @Test
+    public void testInvisibleViews() {
+        View left = mockViewAt(0, 0, 10, 10);
+        View right = mockViewAt(20, 0, 10, 10);
+        when(left.getVisibility()).thenReturn(View.INVISIBLE);
+
+        mNearestTouchFrame.addView(left);
+        mNearestTouchFrame.addView(right);
+        mNearestTouchFrame.onMeasure(0, 0);
+
+        MotionEvent ev = MotionEvent.obtain(0, 0, 0,
+                12 /* x */, 5 /* y */, 0);
+        mNearestTouchFrame.onTouchEvent(ev);
+        verify(left, never()).onTouchEvent(eq(ev));
+        verify(right, never()).onTouchEvent(eq(ev));
+        ev.recycle();
+    }
+
+    @Test
     public void testHorizontalSelection_Left() {
         View left = mockViewAt(0, 0, 10, 10);
         View right = mockViewAt(20, 0, 10, 10);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java
index a915cb2..b22a646 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java
@@ -27,7 +27,6 @@
 import android.testing.AndroidTestingRunner;
 import android.testing.TestableLooper;
 import android.testing.TestableLooper.RunWithLooper;
-import android.util.Log;
 
 import com.android.systemui.Dependency;
 import com.android.systemui.SysuiTestCase;
@@ -145,7 +144,6 @@
     @Test
     @RunWithLooper
     public void testSortOrder() {
-        Log.d("TestTest", "Config " + mContext.getResources().getConfiguration().uiMode);
         Object def = new Object();
         Object uiMode = new Object();
         Object tuner = new Object();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/IconLoggerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/IconLoggerImplTest.java
new file mode 100644
index 0000000..ec994a1
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/IconLoggerImplTest.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_NUM_STATUS_ICONS;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_STATUS_ICONS;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent
+        .NOTIFICATION_SINCE_CREATE_MILLIS;
+
+import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.argThat;
+import static org.mockito.Mockito.clearInvocations;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import static java.lang.Thread.sleep;
+
+import android.metrics.LogMaker;
+import android.support.test.filters.SmallTest;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper;
+import android.testing.TestableLooper.MessageHandler;
+import android.testing.TestableLooper.RunWithLooper;
+import android.util.Log;
+
+import com.android.internal.logging.MetricsLogger;
+import com.android.systemui.SysuiTestCase;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentMatcher;
+
+@RunWith(AndroidTestingRunner.class)
+@RunWithLooper
+@SmallTest
+public class IconLoggerImplTest extends SysuiTestCase {
+
+    private MetricsLogger mMetricsLogger;
+    private IconLoggerImpl mIconLogger;
+    private TestableLooper mTestableLooper;
+    private MessageHandler mMessageHandler;
+
+    @Before
+    public void setup() {
+        IconLoggerImpl.MIN_LOG_INTERVAL = 5; // Low interval for testing
+        mMetricsLogger = mock(MetricsLogger.class);
+        mTestableLooper = TestableLooper.get(this);
+        mMessageHandler = mock(MessageHandler.class);
+        mTestableLooper.setMessageHandler(mMessageHandler);
+        String[] iconArray = new String[] {
+                "test_icon_1",
+                "test_icon_2",
+        };
+        mContext.getOrCreateTestableResources().addOverride(
+                com.android.internal.R.array.config_statusBarIcons, iconArray);
+        mIconLogger = new IconLoggerImpl(mContext, mTestableLooper.getLooper(), mMetricsLogger);
+        when(mMessageHandler.onMessageHandled(any())).thenReturn(true);
+        clearInvocations(mMetricsLogger);
+    }
+
+    @Test
+    public void testIconShown() throws InterruptedException {
+        // Should only get one message, for the same icon shown twice.
+        mIconLogger.onIconShown("test_icon_2");
+        mIconLogger.onIconShown("test_icon_2");
+
+        // There should be some delay before execute.
+        mTestableLooper.processAllMessages();
+        verify(mMessageHandler, never()).onMessageHandled(any());
+
+        sleep(10);
+        mTestableLooper.processAllMessages();
+        verify(mMessageHandler, times(1)).onMessageHandled(any());
+    }
+
+    @Test
+    public void testIconHidden() throws InterruptedException {
+        // Add the icon so that it can be removed.
+        mIconLogger.onIconShown("test_icon_2");
+        sleep(10);
+        mTestableLooper.processAllMessages();
+        clearInvocations(mMessageHandler);
+
+        // Should only get one message, for the same icon shown twice.
+        mIconLogger.onIconHidden("test_icon_2");
+        mIconLogger.onIconHidden("test_icon_2");
+
+        // There should be some delay before execute.
+        mTestableLooper.processAllMessages();
+        verify(mMessageHandler, never()).onMessageHandled(any());
+
+        sleep(10);
+        mTestableLooper.processAllMessages();
+        verify(mMessageHandler, times(1)).onMessageHandled(any());
+    }
+
+    @Test
+    public void testLog() throws InterruptedException {
+        mIconLogger.onIconShown("test_icon_2");
+        sleep(10);
+        mTestableLooper.processAllMessages();
+
+        verify(mMetricsLogger).write(argThat(maker -> {
+            if (IconLoggerImpl.MIN_LOG_INTERVAL >
+                    (long) maker.getTaggedData(NOTIFICATION_SINCE_CREATE_MILLIS)) {
+                Log.e("IconLoggerImplTest", "Invalid latency "
+                        + maker.getTaggedData(NOTIFICATION_SINCE_CREATE_MILLIS));
+                return false;
+            }
+            if (1 != (int) maker.getTaggedData(FIELD_NUM_STATUS_ICONS)) {
+                Log.e("IconLoggerImplTest", "Invalid icon count "
+                        + maker.getTaggedData(FIELD_NUM_STATUS_ICONS));
+                return false;
+            }
+            return true;
+        }));
+    }
+
+    @Test
+    public void testBitField() throws InterruptedException {
+        mIconLogger.onIconShown("test_icon_2");
+        sleep(10);
+        mTestableLooper.processAllMessages();
+
+        verify(mMetricsLogger).write(argThat(maker -> {
+            if ((1 << 1) != (int) maker.getTaggedData(FIELD_STATUS_ICONS)) {
+                Log.e("IconLoggerImplTest", "Invalid bitfield " + Integer.toHexString(
+                        (Integer) maker.getTaggedData(FIELD_NUM_STATUS_ICONS)));
+                return false;
+            }
+            return true;
+        }));
+
+        mIconLogger.onIconShown("test_icon_1");
+        sleep(10);
+        mTestableLooper.processAllMessages();
+
+        verify(mMetricsLogger).write(argThat(maker -> {
+            if ((1 << 1 | 1 << 0) != (int) maker.getTaggedData(FIELD_STATUS_ICONS)) {
+                Log.e("IconLoggerImplTest", "Invalid bitfield " + Integer.toHexString(
+                        (Integer) maker.getTaggedData(FIELD_NUM_STATUS_ICONS)));
+                return false;
+            }
+            return true;
+        }));
+
+        mIconLogger.onIconHidden("test_icon_2");
+        sleep(10);
+        mTestableLooper.processAllMessages();
+
+        verify(mMetricsLogger).write(argThat(maker -> {
+            if ((1 << 0) != (int) maker.getTaggedData(FIELD_STATUS_ICONS)) {
+                Log.e("IconLoggerImplTest", "Invalid bitfield " + Integer.toHexString(
+                        (Integer) maker.getTaggedData(FIELD_STATUS_ICONS)));
+                return false;
+            }
+            return true;
+        }));
+    }
+}
diff --git a/packages/overlays/SysuiDarkThemeOverlay/res/color/qs_detail_progress_track.xml b/packages/overlays/SysuiDarkThemeOverlay/res/color/qs_detail_progress_track.xml
new file mode 100644
index 0000000..c56382e
--- /dev/null
+++ b/packages/overlays/SysuiDarkThemeOverlay/res/color/qs_detail_progress_track.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <!-- I really don't want to define this, but the View that uses this asset uses both the
+         light and dark accent colors. -->
+    <item android:alpha="0.6" android:drawable="@*android:color/accent_device_default_light" />
+</selector>
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index 9fa384a..2bdd737 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -3527,6 +3527,7 @@
     NOTIFICATION_SNOOZED_CRITERIA = 832;
 
     // FIELD - The context (source) from which an action is performed
+    // For QS, this is a boolean of whether the panel is expanded
     FIELD_CONTEXT = 833;
 
     // ACTION: Settings advanced button is expanded
@@ -4287,10 +4288,34 @@
     // OS: O MR
     APPLICATIONS_STORAGE_PHOTOS = 1092;
 
+    // ACTION: Logged when the status bar icons change.
+    // OS: O MR
+    STATUS_BAR_ICONS_CHANGED = 1093;
+
+    // FIELD: Bitfield indicating which icons are shown.
+    // OS: O MR
+    FIELD_STATUS_ICONS = 1094;
+
+    // FIELD: Number of status icons currently shown.
+    // OS: O MR
+    FIELD_NUM_STATUS_ICONS = 1095;
+
     // ACTION: Logged when user tries to pair a Bluetooth device without name from Settings app
     // CATEGORY: SETTINGS
     // OS: O MR
-    ACTION_SETTINGS_BLUETOOTH_PAIR_DEVICES_WITHOUT_NAMES = 1093;
+    ACTION_SETTINGS_BLUETOOTH_PAIR_DEVICES_WITHOUT_NAMES = 1096;
+
+    // FIELD - Whether smart suggestion ranking was enabled or not
+    // Type: int encoded boolean
+    // CATEGORY: SETTINGS
+    // OS: O MR
+    FIELD_SETTINGS_SMART_SUGGESTIONS_ENABLED = 1097;
+
+    // ACTION: The device boots
+    ACTION_BOOT = 1098;
+
+    // FIELD: A string value representing some state of the platform, e.g., boot reason
+    FIELD_PLATFORM_REASON = 1099;
 
     // ---- End O-MR1 Constants, all O-MR1 constants go above this line ----
 
@@ -4370,6 +4395,11 @@
     // OS: P
     NOTIFICATION_CHANNEL_GROUP = 1157;
 
+    // OPEN: Settings > Developer options > Enable > Info dialog
+    // CATEGORY: SETTINGS
+    // OS: P
+    DIALOG_ENABLE_DEVELOPMENT_OPTIONS = 1158;
+
     // Add new aosp constants above this line.
     // END OF AOSP CONSTANTS
   }
diff --git a/services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java b/services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java
index 3a1de98..a6b81ff 100644
--- a/services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java
+++ b/services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java
@@ -47,7 +47,7 @@
     private int mUiAutomationFlags;
 
     private IBinder mUiAutomationServiceOwner;
-    private final DeathRecipient mUiAutomationSerivceOwnerDeathRecipient =
+    private final DeathRecipient mUiAutomationServiceOwnerDeathRecipient =
             new DeathRecipient() {
                 @Override
                 public void binderDied() {
@@ -85,7 +85,7 @@
         }
 
         try {
-            owner.linkToDeath(mUiAutomationSerivceOwnerDeathRecipient, 0);
+            owner.linkToDeath(mUiAutomationServiceOwnerDeathRecipient, 0);
         } catch (RemoteException re) {
             Slog.e(LOG_TAG, "Couldn't register for the death of a UiTestAutomationService!", re);
             return;
@@ -165,12 +165,14 @@
         mUiAutomationService = null;
         mUiAutomationFlags = 0;
         if (mUiAutomationServiceOwner != null) {
-            mUiAutomationServiceOwner.unlinkToDeath(mUiAutomationSerivceOwnerDeathRecipient, 0);
+            mUiAutomationServiceOwner.unlinkToDeath(mUiAutomationServiceOwnerDeathRecipient, 0);
             mUiAutomationServiceOwner = null;
         }
     }
 
     private class UiAutomationService extends AccessibilityClientConnection {
+        private final Handler mMainHandler;
+
         UiAutomationService(Context context, AccessibilityServiceInfo accessibilityServiceInfo,
                 int id, Handler mainHandler, Object lock,
                 AccessibilityManagerService.SecurityPolicy securityPolicy,
@@ -178,15 +180,26 @@
                 GlobalActionPerformer globalActionPerfomer) {
             super(context, COMPONENT_NAME, accessibilityServiceInfo, id, mainHandler, lock,
                     securityPolicy, systemSupport, windowManagerInternal, globalActionPerfomer);
+            mMainHandler = mainHandler;
         }
 
         void connectServiceUnknownThread() {
             // This needs to be done on the main thread
-            mEventDispatchHandler.post(() -> {
+            mMainHandler.post(() -> {
                 try {
-                    mService = mServiceInterface.asBinder();
-                    mService.linkToDeath(this, 0);
-                    mServiceInterface.init(this, mId, mOverlayWindowToken);
+                    final IAccessibilityServiceClient serviceInterface;
+                    final IBinder service;
+                    synchronized (mLock) {
+                        serviceInterface = mServiceInterface;
+                        mService = (serviceInterface == null) ? null : mServiceInterface.asBinder();
+                        service = mService;
+                    }
+                    // If the serviceInterface is null, the UiAutomation has been shut down on
+                    // another thread.
+                    if (serviceInterface != null) {
+                        service.linkToDeath(this, 0);
+                        serviceInterface.init(this, mId, mOverlayWindowToken);
+                    }
                 } catch (RemoteException re) {
                     Slog.w(LOG_TAG, "Error initialized connection", re);
                     destroyUiAutomationService();
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index 2b8b25e..f54731c 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -534,10 +534,10 @@
     /**
      * Updates the last fill selection when an dataset authentication was selected.
      */
-    void setDatasetAuthenticationSelected(@Nullable String selectedDataset, int sessionId,
+    void logDatasetAuthenticationSelected(@Nullable String selectedDataset, int sessionId,
             @Nullable Bundle clientState) {
         synchronized (mLock) {
-            if (isValidEventLocked("setDatasetAuthenticationSelected()", sessionId)) {
+            if (isValidEventLocked("logDatasetAuthenticationSelected()", sessionId)) {
                 mEventHistory.addEvent(
                         new Event(Event.TYPE_DATASET_AUTHENTICATION_SELECTED, selectedDataset,
                                 clientState));
@@ -548,9 +548,9 @@
     /**
      * Updates the last fill selection when an save Ui is shown.
      */
-    void setSaveShown(int sessionId, @Nullable Bundle clientState) {
+    void logSaveShown(int sessionId, @Nullable Bundle clientState) {
         synchronized (mLock) {
-            if (isValidEventLocked("setSaveShown()", sessionId)) {
+            if (isValidEventLocked("logSaveShown()", sessionId)) {
                 mEventHistory.addEvent(new Event(Event.TYPE_SAVE_SHOWN, null, clientState));
             }
         }
@@ -559,10 +559,10 @@
     /**
      * Updates the last fill response when a dataset was selected.
      */
-    void setDatasetSelected(@Nullable String selectedDataset, int sessionId,
+    void logDatasetSelected(@Nullable String selectedDataset, int sessionId,
             @Nullable Bundle clientState) {
         synchronized (mLock) {
-            if (isValidEventLocked("setDatasetSelected()", sessionId)) {
+            if (isValidEventLocked("logDatasetSelected()", sessionId)) {
                 mEventHistory.addEvent(
                         new Event(Event.TYPE_DATASET_SELECTED, selectedDataset, clientState));
             }
@@ -629,7 +629,7 @@
 
     void destroySessionsLocked() {
         if (mSessions.size() == 0) {
-            mUi.destroyAll(AutofillManager.NO_SESSION, null, null);
+            mUi.destroyAll(null, null);
             return;
         }
         while (mSessions.size() > 0) {
diff --git a/services/autofill/java/com/android/server/autofill/RemoteFillService.java b/services/autofill/java/com/android/server/autofill/RemoteFillService.java
index dd98053..f315148 100644
--- a/services/autofill/java/com/android/server/autofill/RemoteFillService.java
+++ b/services/autofill/java/com/android/server/autofill/RemoteFillService.java
@@ -387,8 +387,10 @@
                 @Override
                 public void executeMessage(Message message) {
                     if (mDestroyed) {
-                        Slog.w(LOG_TAG, "Not handling " + message + " as service for "
-                                + mComponentName + " is already destroyed");
+                        if (sVerbose) {
+                            Slog.v(LOG_TAG, "Not handling " + message + " as service for "
+                                    + mComponentName + " is already destroyed");
+                        }
                         return;
                     }
                     switch (message.what) {
@@ -574,6 +576,13 @@
 
         @Override
         public void run() {
+            synchronized (mLock) {
+                if (isCancelledLocked()) {
+                    // TODO(b/653742740): we should probably return here, but for now we're justing
+                    // logging to confirm this is the problem if it happens again.
+                    Slog.e(LOG_TAG, "run() called after canceled: " + mRequest);
+                }
+            }
             final RemoteFillService remoteService = getService();
             if (remoteService != null) {
                 try {
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 8d9f0aa2..5ca7614 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -177,6 +177,12 @@
     private PendingUi mPendingSaveUi;
 
     /**
+     * List of dataset ids selected by the user.
+     */
+    @GuardedBy("mLock")
+    private ArrayList<String> mSelectedDatasetIds;
+
+    /**
      * Receiver of assist data from the app's {@link Activity}.
      */
     private final IResultReceiver mAssistReceiver = new IResultReceiver.Stub() {
@@ -268,7 +274,7 @@
             value = state.getCurrentValue();
             if (value == null) {
                 if (sDebug) Slog.d(TAG, "getValue(): no current value for " + id);
-                value = getValueFromContexts(id);
+                value = getValueFromContextsLocked(id);
             }
         }
         if (value != null) {
@@ -276,7 +282,7 @@
                 return value.getTextValue().toString();
             }
             if (value.isList()) {
-                final CharSequence[] options = getAutofillOptionsFromContexts(id);
+                final CharSequence[] options = getAutofillOptionsFromContextsLocked(id);
                 if (options != null) {
                     final int index = value.getListValue();
                     final CharSequence option = options[index];
@@ -339,21 +345,21 @@
      * Cancels the last request sent to the {@link #mRemoteFillService}.
      */
     private void cancelCurrentRequestLocked() {
-        int canceledRequest = mRemoteFillService.cancelCurrentRequest();
+        final int canceledRequest = mRemoteFillService.cancelCurrentRequest();
 
         // Remove the FillContext as there will never be a response for the service
         if (canceledRequest != INVALID_REQUEST_ID && mContexts != null) {
-            int numContexts = mContexts.size();
+            final int numContexts = mContexts.size();
 
             // It is most likely the last context, hence search backwards
             for (int i = numContexts - 1; i >= 0; i--) {
                 if (mContexts.get(i).getRequestId() == canceledRequest) {
+                    if (sDebug) Slog.d(TAG, "cancelCurrentRequest(): id = " + canceledRequest);
                     mContexts.remove(i);
                     break;
                 }
             }
         }
-
     }
 
     /**
@@ -456,14 +462,7 @@
             }
         }
         if (response == null) {
-            if (sVerbose) Slog.v(TAG, "canceling session " + id + " when server returned null");
-            if ((requestFlags & FLAG_MANUAL_REQUEST) != 0) {
-                getUiForShowing().showError(R.string.autofill_error_cannot_autofill, this);
-            }
-            mService.resetLastResponse();
-            // Nothing to be done, but need to notify client.
-            notifyUnavailableToClient();
-            removeSelf();
+            processNullResponseLocked(requestFlags);
             return;
         }
 
@@ -586,15 +585,12 @@
     public void authenticate(int requestId, int datasetIndex, IntentSender intent, Bundle extras) {
         final Intent fillInIntent;
         synchronized (mLock) {
-            synchronized (mLock) {
-                if (mDestroyed) {
-                    Slog.w(TAG, "Call to Session#authenticate() rejected - session: "
-                            + id + " destroyed");
-                    return;
-                }
+            if (mDestroyed) {
+                Slog.w(TAG, "Call to Session#authenticate() rejected - session: "
+                        + id + " destroyed");
+                return;
             }
-            fillInIntent = createAuthFillInIntent(
-                    getFillContextByRequestIdLocked(requestId).getStructure(), extras);
+            fillInIntent = createAuthFillInIntentLocked(requestId, extras);
         }
 
         mService.setAuthenticationSelected(id, mClientState);
@@ -620,7 +616,7 @@
                 return;
             }
         }
-        mHandlerCaller.getHandler().post(() -> autoFill(requestId, datasetIndex, dataset));
+        mHandlerCaller.getHandler().post(() -> autoFill(requestId, datasetIndex, dataset, true));
     }
 
     // AutoFillUiCallback
@@ -748,16 +744,24 @@
         }
 
         final Parcelable result = data.getParcelable(AutofillManager.EXTRA_AUTHENTICATION_RESULT);
+        if (sDebug) Slog.d(TAG, "setAuthenticationResultLocked(): result=" + result);
         if (result instanceof FillResponse) {
             final FillResponse response = (FillResponse) result;
             mMetricsLogger.action(MetricsEvent.AUTOFILL_AUTHENTICATED, mPackageName);
             replaceResponseLocked(authenticatedResponse, response);
         } else if (result instanceof Dataset) {
+            // TODO: add proper metric
             if (datasetIdx != AutofillManager.AUTHENTICATION_ID_DATASET_ID_UNDEFINED) {
                 final Dataset dataset = (Dataset) result;
                 authenticatedResponse.getDatasets().set(datasetIdx, dataset);
-                autoFill(requestId, datasetIdx, dataset);
+                autoFill(requestId, datasetIdx, dataset, false);
             }
+        } else {
+            if (result != null) {
+                Slog.w(TAG, "service returned invalid auth type: " + result);
+            }
+            // TODO: add proper metric (on else)
+            processNullResponseLocked(0);
         }
     }
 
@@ -845,7 +849,7 @@
 
                 AutofillValue value = viewState.getCurrentValue();
                 if (value == null || value.isEmpty()) {
-                    final AutofillValue initialValue = getValueFromContexts(id);
+                    final AutofillValue initialValue = getValueFromContextsLocked(id);
                     if (initialValue != null) {
                         if (sDebug) {
                             Slog.d(TAG, "Value of required field " + id + " didn't change; "
@@ -899,7 +903,7 @@
                         }
                     } else {
                         // Update current values cache based on initial value
-                        final AutofillValue initialValue = getValueFromContexts(id);
+                        final AutofillValue initialValue = getValueFromContextsLocked(id);
                         if (sDebug) {
                             Slog.d(TAG, "no current value for " + id + "; initial value is "
                                     + initialValue);
@@ -970,11 +974,11 @@
                 }
 
                 if (sDebug) Slog.d(TAG, "Good news, everyone! All checks passed, show save UI!");
-                mService.setSaveShown(id, mClientState);
+                mService.logSaveShown(id, mClientState);
                 final IAutoFillManagerClient client = getClient();
-                mPendingSaveUi = new PendingUi(mActivityToken);
+                mPendingSaveUi = new PendingUi(mActivityToken, id, client);
                 getUiForShowing().showSaveUi(mService.getServiceLabel(), saveInfo,
-                        valueFinder, mPackageName, this, mPendingSaveUi, id, client);
+                        valueFinder, mPackageName, this, mPendingSaveUi);
                 if (client != null) {
                     try {
                         client.setSaveUiState(id, true);
@@ -1006,7 +1010,7 @@
      * Gets the latest non-empty value for the given id in the autofill contexts.
      */
     @Nullable
-    private AutofillValue getValueFromContexts(AutofillId id) {
+    private AutofillValue getValueFromContextsLocked(AutofillId id) {
         final int numContexts = mContexts.size();
         for (int i = numContexts - 1; i >= 0; i--) {
             final FillContext context = mContexts.get(i);
@@ -1028,7 +1032,7 @@
      * Gets the latest autofill options for the given id in the autofill contexts.
      */
     @Nullable
-    private CharSequence[] getAutofillOptionsFromContexts(AutofillId id) {
+    private CharSequence[] getAutofillOptionsFromContextsLocked(AutofillId id) {
         final int numContexts = mContexts.size();
 
         for (int i = numContexts - 1; i >= 0; i--) {
@@ -1053,6 +1057,11 @@
 
         if (sVerbose) Slog.v(TAG, "callSaveLocked(): mViewStates=" + mViewStates);
 
+        if (mContexts == null) {
+            Slog.w(TAG, "callSaveLocked(): no contexts");
+            return;
+        }
+
         final int numContexts = mContexts.size();
 
         for (int contextNum = 0; contextNum < numContexts; contextNum++) {
@@ -1098,7 +1107,8 @@
         // until the dispatch happens. The items in the list don't need to be cloned
         // since we don't hold on them anywhere else. The client state is not touched
         // by us, so no need to copy.
-        final SaveRequest saveRequest = new SaveRequest(new ArrayList<>(mContexts), mClientState);
+        final SaveRequest saveRequest = new SaveRequest(new ArrayList<>(mContexts), mClientState,
+                mSelectedDatasetIds);
         mRemoteFillService.onSaveRequest(saveRequest);
     }
 
@@ -1409,6 +1419,17 @@
         processResponseLocked(newResponse, 0);
     }
 
+    private void processNullResponseLocked(int flags) {
+        if (sVerbose) Slog.v(TAG, "canceling session " + id + " when server returned null");
+        if ((flags & FLAG_MANUAL_REQUEST) != 0) {
+            getUiForShowing().showError(R.string.autofill_error_cannot_autofill, this);
+        }
+        mService.resetLastResponse();
+        // Nothing to be done, but need to notify client.
+        notifyUnavailableToClient();
+        removeSelf();
+    }
+
     private void processResponseLocked(@NonNull FillResponse newResponse, int flags) {
         // Make sure we are hiding the UI which will be shown
         // only if handling the current response requires it.
@@ -1523,7 +1544,7 @@
         return viewState;
     }
 
-    void autoFill(int requestId, int datasetIndex, Dataset dataset) {
+    void autoFill(int requestId, int datasetIndex, Dataset dataset, boolean generateEvent) {
         synchronized (mLock) {
             if (mDestroyed) {
                 Slog.w(TAG, "Call to Session#autoFill() rejected - session: "
@@ -1532,17 +1553,18 @@
             }
             // Autofill it directly...
             if (dataset.getAuthentication() == null) {
-                mService.setDatasetSelected(dataset.getId(), id, mClientState);
+                if (generateEvent) {
+                    mService.logDatasetSelected(dataset.getId(), id, mClientState);
+                }
 
                 autoFillApp(dataset);
                 return;
             }
 
             // ...or handle authentication.
-            mService.setDatasetAuthenticationSelected(dataset.getId(), id, mClientState);
+            mService.logDatasetAuthenticationSelected(dataset.getId(), id, mClientState);
             setViewStatesLocked(null, dataset, ViewState.STATE_WAITING_DATASET_AUTH, false);
-            final Intent fillInIntent = createAuthFillInIntent(
-                    getFillContextByRequestIdLocked(requestId).getStructure(), mClientState);
+            final Intent fillInIntent = createAuthFillInIntentLocked(requestId, mClientState);
 
             final int authenticationId = AutofillManager.makeAuthenticationId(requestId,
                     datasetIndex);
@@ -1556,9 +1578,16 @@
         }
     }
 
-    private Intent createAuthFillInIntent(AssistStructure structure, Bundle extras) {
+    private Intent createAuthFillInIntentLocked(int requestId, Bundle extras) {
         final Intent fillInIntent = new Intent();
-        fillInIntent.putExtra(AutofillManager.EXTRA_ASSIST_STRUCTURE, structure);
+
+        final FillContext context = getFillContextByRequestIdLocked(requestId);
+        if (context == null) {
+            // TODO(b/653742740): this will crash system_server. We need to handle it, but we're
+            // keeping it crashing for now so we can diagnose when it happens again
+            Slog.wtf(TAG, "no FillContext for requestId" + requestId + "; mContexts= " + mContexts);
+        }
+        fillInIntent.putExtra(AutofillManager.EXTRA_ASSIST_STRUCTURE, context.getStructure());
         fillInIntent.putExtra(AutofillManager.EXTRA_CLIENT_STATE, extras);
         return fillInIntent;
     }
@@ -1626,6 +1655,7 @@
         pw.print(prefix); pw.print("mHasCallback: "); pw.println(mHasCallback);
         pw.print(prefix); pw.print("mClientState: "); pw.println(
                 Helper.bundleToString(mClientState));
+        pw.print(prefix); pw.print("mSelectedDatasetIds: "); pw.println(mSelectedDatasetIds);
         mRemoteFillService.dump(prefix, pw);
     }
 
@@ -1666,6 +1696,12 @@
                     if (sDebug) Slog.d(TAG, "autoFillApp(): the buck is on the app: " + dataset);
 
                     mClient.autofill(id, ids, values);
+                    if (dataset.getId() != null) {
+                        if (mSelectedDatasetIds == null) {
+                            mSelectedDatasetIds = new ArrayList<>();
+                        }
+                        mSelectedDatasetIds.add(dataset.getId());
+                    }
                     setViewStatesLocked(null, dataset, ViewState.STATE_AUTOFILLED, false);
                 }
             } catch (RemoteException e) {
@@ -1696,7 +1732,7 @@
         if (mDestroyed) {
             return null;
         }
-        mUi.destroyAll(id, getClient(), this);
+        mUi.destroyAll(mPendingSaveUi, this);
         mUi.clearCallback(this);
         mDestroyed = true;
         mMetricsLogger.action(MetricsEvent.AUTOFILL_SESSION_FINISHED, mPackageName);
@@ -1712,7 +1748,7 @@
 
         mPendingSaveUi = null;
         removeSelfLocked();
-        mUi.destroyAll(id, getClient(), this);
+        mUi.destroyAll(mPendingSaveUi, this);
     }
 
     /**
diff --git a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
index 7febf83..a6f6713 100644
--- a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
+++ b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
@@ -35,7 +35,6 @@
 import android.util.Slog;
 import android.view.autofill.AutofillId;
 import android.view.autofill.AutofillManager;
-import android.view.autofill.IAutoFillManagerClient;
 import android.view.autofill.IAutofillWindowPresenter;
 import android.widget.Toast;
 
@@ -247,8 +246,7 @@
      */
     public void showSaveUi(@NonNull CharSequence providerLabel, @NonNull SaveInfo info,
             @NonNull ValueFinder valueFinder, @NonNull String packageName,
-            @NonNull AutoFillUiCallback callback, @NonNull PendingUi pendingUi,
-            int sessionId, @Nullable IAutoFillManagerClient client) {
+            @NonNull AutoFillUiCallback callback, @NonNull PendingUi pendingSaveUi) {
         if (sVerbose) Slog.v(TAG, "showSaveUi() for " + packageName + ": " + info);
         int numIds = 0;
         numIds += info.getRequiredIds() == null ? 0 : info.getRequiredIds().length;
@@ -263,8 +261,8 @@
                 return;
             }
             hideAllUiThread(callback);
-            mSaveUi = new SaveUi(mContext, pendingUi, providerLabel, info, valueFinder,
-                    mOverlayControl, client, new SaveUi.OnSaveListener() {
+            mSaveUi = new SaveUi(mContext, pendingSaveUi, providerLabel, info, valueFinder,
+                    mOverlayControl, new SaveUi.OnSaveListener() {
                 @Override
                 public void onSave() {
                     log.setType(MetricsProto.MetricsEvent.TYPE_ACTION);
@@ -272,7 +270,7 @@
                     if (mCallback != null) {
                         mCallback.save();
                     }
-                    destroySaveUiUiThread(sessionId, client);
+                    destroySaveUiUiThread(pendingSaveUi);
                 }
 
                 @Override
@@ -290,7 +288,7 @@
                     if (mCallback != null) {
                         mCallback.cancelSave();
                     }
-                    destroySaveUiUiThread(sessionId, client);
+                    destroySaveUiUiThread(pendingSaveUi);
                 }
 
                 @Override
@@ -331,9 +329,9 @@
     /**
      * Destroy all UI affordances.
      */
-    public void destroyAll(int sessionId, @Nullable IAutoFillManagerClient client,
+    public void destroyAll(@Nullable PendingUi pendingSaveUi,
             @Nullable AutoFillUiCallback callback) {
-        mHandler.post(() -> destroyAllUiThread(sessionId, client, callback));
+        mHandler.post(() -> destroyAllUiThread(pendingSaveUi, callback));
     }
 
     public void dump(PrintWriter pw) {
@@ -363,18 +361,20 @@
     }
 
     @android.annotation.UiThread
-    private void hideSaveUiUiThread(@Nullable AutoFillUiCallback callback) {
+    @Nullable
+    private PendingUi hideSaveUiUiThread(@Nullable AutoFillUiCallback callback) {
         if (sVerbose) {
             Slog.v(TAG, "hideSaveUiUiThread(): mSaveUi=" + mSaveUi + ", callback=" + callback
                     + ", mCallback=" + mCallback);
         }
         if (mSaveUi != null && (callback == null || callback == mCallback)) {
-            mSaveUi.hide();
+            return mSaveUi.hide();
         }
+        return null;
     }
 
     @android.annotation.UiThread
-    private void destroySaveUiUiThread(int sessionId, @Nullable IAutoFillManagerClient client) {
+    private void destroySaveUiUiThread(@Nullable PendingUi pendingSaveUi) {
         if (mSaveUi == null) {
             // Calling destroySaveUiUiThread() twice is normal - it usually happens when the
             // first call is made after the SaveUI is hidden and the second when the session is
@@ -383,13 +383,13 @@
             return;
         }
 
-        if (sDebug) Slog.d(TAG, "destroySaveUiUiThread(): id=" + sessionId);
+        if (sDebug) Slog.d(TAG, "destroySaveUiUiThread(): " + pendingSaveUi);
         mSaveUi.destroy();
         mSaveUi = null;
-        if (client != null) {
+        if (pendingSaveUi != null) {
             try {
                 if (sDebug) Slog.d(TAG, "destroySaveUiUiThread(): notifying client");
-                client.setSaveUiState(sessionId, false);
+                pendingSaveUi.client.setSaveUiState(pendingSaveUi.id, false);
             } catch (RemoteException e) {
                 Slog.e(TAG, "Error notifying client to set save UI state to hidden: " + e);
             }
@@ -397,15 +397,22 @@
     }
 
     @android.annotation.UiThread
-    private void destroyAllUiThread(int sessionId, @Nullable IAutoFillManagerClient client,
+    private void destroyAllUiThread(@Nullable PendingUi pendingSaveUi,
             @Nullable AutoFillUiCallback callback) {
         hideFillUiUiThread(callback);
-        destroySaveUiUiThread(sessionId, client);
+        destroySaveUiUiThread(pendingSaveUi);
     }
 
     @android.annotation.UiThread
     private void hideAllUiThread(@Nullable AutoFillUiCallback callback) {
         hideFillUiUiThread(callback);
-        hideSaveUiUiThread(callback);
+        final PendingUi pendingSaveUi = hideSaveUiUiThread(callback);
+        if (pendingSaveUi != null && pendingSaveUi.getState() == PendingUi.STATE_FINISHED) {
+            if (sDebug) {
+                Slog.d(TAG, "hideAllUiThread(): "
+                        + "destroying Save UI because pending restoration is finished");
+            }
+            destroySaveUiUiThread(pendingSaveUi);
+        }
     }
 }
diff --git a/services/autofill/java/com/android/server/autofill/ui/FillUi.java b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
index 24f3b33..371e74d 100644
--- a/services/autofill/java/com/android/server/autofill/ui/FillUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
@@ -229,6 +229,13 @@
     public void setFilterText(@Nullable String filterText) {
         throwIfDestroyed();
         if (mAdapter == null) {
+            // ViewState doesn't not support filtering - typically when it's for an authenticated
+            // FillResponse.
+            if (TextUtils.isEmpty(filterText)) {
+                mCallback.requestShowFillUi(mContentWidth, mContentHeight, mWindowPresenter);
+            } else {
+                mCallback.requestHideFillUi();
+            }
             return;
         }
 
@@ -510,8 +517,9 @@
                         final ViewItem item = mAllItems.get(i);
                         final String value = item.getValue();
                         // No value, i.e. null, matches any filter
-                        if (value == null
-                                || value.toLowerCase().startsWith(constraintLowerCase)) {
+                        if ((value == null && item.mDataset.getAuthentication() == null)
+                                || (value != null
+                                        && value.toLowerCase().startsWith(constraintLowerCase))) {
                             filteredItems.add(item);
                         }
                     }
@@ -525,9 +533,11 @@
                     final boolean resultCountChanged;
                     final int oldItemCount = mFilteredItems.size();
                     mFilteredItems.clear();
-                    @SuppressWarnings("unchecked")
-                    final List<ViewItem> items = (List<ViewItem>) results.values;
-                    mFilteredItems.addAll(items);
+                    if (results.count > 0) {
+                        @SuppressWarnings("unchecked")
+                        final List<ViewItem> items = (List<ViewItem>) results.values;
+                        mFilteredItems.addAll(items);
+                    }
                     resultCountChanged = (oldItemCount != mFilteredItems.size());
                     if (resultCountChanged) {
                         announceSearchResultIfNeeded();
diff --git a/services/autofill/java/com/android/server/autofill/ui/PendingUi.java b/services/autofill/java/com/android/server/autofill/ui/PendingUi.java
index 87263ed..0851d3b 100644
--- a/services/autofill/java/com/android/server/autofill/ui/PendingUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/PendingUi.java
@@ -18,6 +18,7 @@
 import android.annotation.NonNull;
 import android.os.IBinder;
 import android.util.DebugUtils;
+import android.view.autofill.IAutoFillManagerClient;
 
 /**
  * Helper class used to handle a pending Autofill affordance such as the Save UI.
@@ -34,15 +35,19 @@
 
     private final IBinder mToken;
     private int mState;
+    public final int id;
+    public final IAutoFillManagerClient client;
 
     /**
      * Default constructor.
      *
      * @param token token used to identify this pending UI.
      */
-    public PendingUi(@NonNull IBinder token) {
+    public PendingUi(@NonNull IBinder token, int id, @NonNull IAutoFillManagerClient client) {
         mToken = token;
         mState = STATE_CREATED;
+        this.id = id;
+        this.client = client;
     }
 
     /**
@@ -76,7 +81,7 @@
 
     @Override
     public String toString() {
-        return "PendingUi: [token=" + mToken + ", state="
+        return "PendingUi: [token=" + mToken + ", id=" + id + ", state="
                 + DebugUtils.flagsToString(PendingUi.class, "STATE_", mState) + "]";
     }
 }
diff --git a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
index 67c1b8c..160c84c 100644
--- a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
@@ -123,7 +123,7 @@
     SaveUi(@NonNull Context context, @NonNull PendingUi pendingUi,
            @NonNull CharSequence providerLabel, @NonNull SaveInfo info,
            @NonNull ValueFinder valueFinder, @NonNull OverlayControl overlayControl,
-           @NonNull IAutoFillManagerClient client, @NonNull OnSaveListener listener) {
+           @NonNull OnSaveListener listener) {
         mPendingUi= pendingUi;
         mListener = new OneTimeListener(listener);
         mOverlayControl = overlayControl;
@@ -206,7 +206,7 @@
                             final IBinder token = mPendingUi.getToken();
                             intent.putExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN, token);
                             try {
-                                client.startIntentSender(pendingIntent.getIntentSender(),
+                                pendingUi.client.startIntentSender(pendingIntent.getIntentSender(),
                                         intent);
                                 mPendingUi.setState(PendingUi.STATE_PENDING);
                                 if (sDebug) {
@@ -318,13 +318,14 @@
         mOverlayControl.hideOverlays();
    }
 
-    void hide() {
+    PendingUi hide() {
         if (sVerbose) Slog.v(TAG, "Hiding save dialog.");
         try {
             mDialog.hide();
         } finally {
             mOverlayControl.showOverlays();
         }
+        return mPendingUi;
     }
 
     void destroy() {
diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java
index cab6ecf..4c08f62 100644
--- a/services/core/java/com/android/server/AlarmManagerService.java
+++ b/services/core/java/com/android/server/AlarmManagerService.java
@@ -245,8 +245,6 @@
 
         private static final long DEFAULT_LISTENER_TIMEOUT = 5 * 1000;
 
-        private static final boolean DEFAULT_BACKGROUND_RESTRICTIONS_ENABLED = false;
-
         // Minimum futurity of a new alarm
         public long MIN_FUTURITY = DEFAULT_MIN_FUTURITY;
 
@@ -266,8 +264,6 @@
         // Direct alarm listener callback timeout
         public long LISTENER_TIMEOUT = DEFAULT_LISTENER_TIMEOUT;
 
-        public boolean BACKGROUND_ALARMS_BLOCKED = DEFAULT_BACKGROUND_RESTRICTIONS_ENABLED;
-
         private ContentResolver mResolver;
         private final KeyValueListParser mParser = new KeyValueListParser(',');
         private long mLastAllowWhileIdleWhitelistDuration = -1;
@@ -326,21 +322,6 @@
                         DEFAULT_ALLOW_WHILE_IDLE_WHITELIST_DURATION);
                 LISTENER_TIMEOUT = mParser.getLong(KEY_LISTENER_TIMEOUT,
                         DEFAULT_LISTENER_TIMEOUT);
-                BACKGROUND_ALARMS_BLOCKED = mParser.getBoolean(KEY_BG_RESTRICTIONS_ENABLED,
-                        DEFAULT_BACKGROUND_RESTRICTIONS_ENABLED);
-                if (!BACKGROUND_ALARMS_BLOCKED) {
-                    // TODO: remove this code and constant when feature is turned on
-                    // deliver all blocked alarms
-                    final ArrayList<Alarm> allBlockedAlarms = new ArrayList<>();
-                    for (int i = mPendingBackgroundAlarms.size() - 1; i >=0; i--) {
-                        allBlockedAlarms.addAll(mPendingBackgroundAlarms.valueAt(i));
-                    }
-                    mPendingBackgroundAlarms = new SparseArray<>();
-                    deliverPendingBackgroundAlarmsLocked(allBlockedAlarms,
-                            SystemClock.elapsedRealtime());
-                } else if (DEBUG_BG_LIMIT) {
-                    Slog.d(TAG, "Background limiting enabled");
-                }
 
                 updateAllowWhileIdleMinTimeLocked();
                 updateAllowWhileIdleWhitelistDurationLocked();
@@ -2392,9 +2373,6 @@
     }
 
     private boolean isBackgroundRestricted(Alarm alarm) {
-        if (!mConstants.BACKGROUND_ALARMS_BLOCKED) {
-            return false;
-        }
         if (alarm.alarmClock != null) {
             // Don't block alarm clocks
             return false;
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 04b2112..e70a294 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -4343,11 +4343,13 @@
             int currentScore, NetworkMisc networkMisc) {
         enforceConnectivityInternalPermission();
 
+        LinkProperties lp = new LinkProperties(linkProperties);
+        lp.ensureDirectlyConnectedRoutes();
         // TODO: Instead of passing mDefaultRequest, provide an API to determine whether a Network
         // satisfies mDefaultRequest.
         final NetworkAgentInfo nai = new NetworkAgentInfo(messenger, new AsyncChannel(),
-                new Network(reserveNetId()), new NetworkInfo(networkInfo), new LinkProperties(
-                linkProperties), new NetworkCapabilities(networkCapabilities), currentScore,
+                new Network(reserveNetId()), new NetworkInfo(networkInfo), lp,
+                new NetworkCapabilities(networkCapabilities), currentScore,
                 mContext, mTrackerHandler, new NetworkMisc(networkMisc), mDefaultRequest, this);
         synchronized (this) {
             nai.networkMonitor.systemReady = mSystemReady;
@@ -4647,7 +4649,8 @@
             // Ignore updates for disconnected networks
             return;
         }
-
+        // newLp is already a defensive copy.
+        newLp.ensureDirectlyConnectedRoutes();
         if (VDBG) {
             log("Update of LinkProperties for " + nai.name() +
                     "; created=" + nai.created +
diff --git a/services/core/java/com/android/server/DeviceIdleController.java b/services/core/java/com/android/server/DeviceIdleController.java
index 7fdbc82..abbc89e 100644
--- a/services/core/java/com/android/server/DeviceIdleController.java
+++ b/services/core/java/com/android/server/DeviceIdleController.java
@@ -401,7 +401,9 @@
     private final BroadcastReceiver mInteractivityReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
-            updateInteractivityLocked();
+            synchronized (DeviceIdleController.this) {
+                updateInteractivityLocked();
+            }
         }
     };
 
diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java
index 966e553..340d672 100644
--- a/services/core/java/com/android/server/LocationManagerService.java
+++ b/services/core/java/com/android/server/LocationManagerService.java
@@ -1542,18 +1542,7 @@
      */
     @Override
     public List<String> getAllProviders() {
-        ArrayList<String> out;
-        synchronized (mLock) {
-            out = new ArrayList<>(mProviders.size());
-            for (LocationProviderInterface provider : mProviders) {
-                String name = provider.getName();
-                if (LocationManager.FUSED_PROVIDER.equals(name)) {
-                    continue;
-                }
-                out.add(name);
-            }
-        }
-
+        List<String> out = getProviders(null /*criteria*/, false /*enabledOnly*/);
         if (D) Log.d(TAG, "getAllProviders()=" + out);
         return out;
     }
diff --git a/services/core/java/com/android/server/RecoverySystemService.java b/services/core/java/com/android/server/RecoverySystemService.java
index 3c8c699..1517887 100644
--- a/services/core/java/com/android/server/RecoverySystemService.java
+++ b/services/core/java/com/android/server/RecoverySystemService.java
@@ -285,8 +285,9 @@
 
                 // Send the BCB commands if it's to setup BCB.
                 if (isSetup) {
-                    dos.writeInt(command.length());
-                    dos.writeBytes(command);
+                    byte[] cmdUtf8 = command.getBytes("UTF-8");
+                    dos.writeInt(cmdUtf8.length);
+                    dos.write(cmdUtf8, 0, cmdUtf8.length);
                     dos.flush();
                 }
 
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index b0528dc..8afbdc9 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -211,6 +211,9 @@
     // Disable this since it messes up long-running cryptfs operations.
     private static final boolean WATCHDOG_ENABLE = false;
 
+    /** Flag to enable ASECs */
+    private static final boolean ASEC_ENABLE = false;
+
     /**
      * Our goal is for all Android devices to be usable as development devices,
      * which includes the new Direct Boot mode added in N. For devices that
@@ -527,13 +530,13 @@
 
     class ObbState implements IBinder.DeathRecipient {
         public ObbState(String rawPath, String canonicalPath, int callingUid,
-                IObbActionListener token, int nonce) {
+                IObbActionListener token, int nonce, String volId) {
             this.rawPath = rawPath;
             this.canonicalPath = canonicalPath;
-
             this.ownerGid = UserHandle.getSharedAppGid(callingUid);
             this.token = token;
             this.nonce = nonce;
+            this.volId = volId;
         }
 
         final String rawPath;
@@ -547,6 +550,8 @@
         // Identifier to pass back to the token
         final int nonce;
 
+        String volId;
+
         public IBinder getBinder() {
             return token.asBinder();
         }
@@ -573,6 +578,7 @@
             sb.append(",ownerGid=").append(ownerGid);
             sb.append(",token=").append(token);
             sb.append(",binder=").append(getBinder());
+            sb.append(",volId=").append(volId);
             sb.append('}');
             return sb.toString();
         }
@@ -681,13 +687,19 @@
                     final IStorageShutdownObserver obs = (IStorageShutdownObserver) msg.obj;
                     boolean success = false;
                     try {
-                        success = mConnector.execute("volume", "shutdown").isClassOk();
-                    } catch (NativeDaemonConnectorException ignored) {
+                        if (ENABLE_BINDER) {
+                            mVold.shutdown();
+                            success = true;
+                        } else {
+                            success = mConnector.execute("volume", "shutdown").isClassOk();
+                        }
+                    } catch (Exception e) {
+                        Slog.wtf(TAG, e);
                     }
                     if (obs != null) {
                         try {
                             obs.onShutDownComplete(success ? 0 : -1);
-                        } catch (RemoteException ignored) {
+                        } catch (Exception ignored) {
                         }
                     }
                     break;
@@ -699,9 +711,14 @@
                         break;
                     }
                     try {
-                        mConnector.execute("volume", "mount", vol.id, vol.mountFlags,
-                                vol.mountUserId);
-                    } catch (NativeDaemonConnectorException ignored) {
+                        if (ENABLE_BINDER) {
+                            mVold.mount(vol.id, vol.mountFlags, vol.mountUserId);
+                        } else {
+                            mConnector.execute("volume", "mount", vol.id, vol.mountFlags,
+                                    vol.mountUserId);
+                        }
+                    } catch (Exception e) {
+                        Slog.wtf(TAG, e);
                     }
                     break;
                 }
@@ -761,7 +778,11 @@
                 if (Intent.ACTION_USER_ADDED.equals(action)) {
                     final UserManager um = mContext.getSystemService(UserManager.class);
                     final int userSerialNumber = um.getUserSerialNumber(userId);
-                    mConnector.execute("volume", "user_added", userId, userSerialNumber);
+                    if (ENABLE_BINDER) {
+                        mVold.onUserAdded(userId, userSerialNumber);
+                    } else {
+                        mConnector.execute("volume", "user_added", userId, userSerialNumber);
+                    }
                 } else if (Intent.ACTION_USER_REMOVED.equals(action)) {
                     synchronized (mVolumes) {
                         final int size = mVolumes.size();
@@ -773,10 +794,14 @@
                             }
                         }
                     }
-                    mConnector.execute("volume", "user_removed", userId);
+                    if (ENABLE_BINDER) {
+                        mVold.onUserRemoved(userId);
+                    } else {
+                        mConnector.execute("volume", "user_removed", userId);
+                    }
                 }
-            } catch (NativeDaemonConnectorException e) {
-                Slog.w(TAG, "Failed to send user details to vold", e);
+            } catch (Exception e) {
+                Slog.wtf(TAG, e);
             }
         }
     };
@@ -930,13 +955,21 @@
 
                 // Tell vold about all existing and started users
                 for (UserInfo user : users) {
-                    mConnector.execute("volume", "user_added", user.id, user.serialNumber);
+                    if (ENABLE_BINDER) {
+                        mVold.onUserAdded(user.id, user.serialNumber);
+                    } else {
+                        mConnector.execute("volume", "user_added", user.id, user.serialNumber);
+                    }
                 }
                 for (int userId : systemUnlockedUsers) {
-                    mConnector.execute("volume", "user_started", userId);
+                    if (ENABLE_BINDER) {
+                        mVold.onUserStarted(userId);
+                    } else {
+                        mConnector.execute("volume", "user_started", userId);
+                    }
                 }
-            } catch (RemoteException | NativeDaemonConnectorException e) {
-                Slog.w(TAG, "Failed to reset vold", e);
+            } catch (Exception e) {
+                Slog.wtf(TAG, e);
             }
         }
     }
@@ -948,8 +981,13 @@
         // staging area is ready so it's ready for zygote-forked apps to
         // bind mount against.
         try {
-            mConnector.execute("volume", "user_started", userId);
-        } catch (NativeDaemonConnectorException ignored) {
+            if (ENABLE_BINDER) {
+                mVold.onUserStarted(userId);
+            } else {
+                mConnector.execute("volume", "user_started", userId);
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
 
         // Record user as started so newly mounted volumes kick off events
@@ -973,8 +1011,13 @@
         Slog.d(TAG, "onCleanupUser " + userId);
 
         try {
-            mConnector.execute("volume", "user_stopped", userId);
-        } catch (NativeDaemonConnectorException ignored) {
+            if (ENABLE_BINDER) {
+                mVold.onUserStopped(userId);
+            } else {
+                mConnector.execute("volume", "user_stopped", userId);
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
 
         synchronized (mLock) {
@@ -1028,7 +1071,9 @@
         }
 
         // Let package manager load internal ASECs.
-        mPms.scanAvailableAsecs();
+        if (ASEC_ENABLE) {
+            mPms.scanAvailableAsecs();
+        }
 
         // Notify people waiting for ASECs to be scanned that it's done.
         mAsecsScanned.countDown();
@@ -1804,9 +1849,13 @@
             throw new SecurityException("Mounting " + volId + " restricted by policy");
         }
         try {
-            mConnector.execute("volume", "mount", vol.id, vol.mountFlags, vol.mountUserId);
-        } catch (NativeDaemonConnectorException e) {
-            throw e.rethrowAsParcelableException();
+            if (ENABLE_BINDER) {
+                mVold.mount(vol.id, vol.mountFlags, vol.mountUserId);
+            } else {
+                mConnector.execute("volume", "mount", vol.id, vol.mountFlags, vol.mountUserId);
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -1833,9 +1882,13 @@
         }
 
         try {
-            mConnector.execute("volume", "unmount", vol.id);
-        } catch (NativeDaemonConnectorException e) {
-            throw e.rethrowAsParcelableException();
+            if (ENABLE_BINDER) {
+                mVold.unmount(vol.id);
+            } else {
+                mConnector.execute("volume", "unmount", vol.id);
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -1846,9 +1899,13 @@
 
         final VolumeInfo vol = findVolumeByIdOrThrow(volId);
         try {
-            mConnector.execute("volume", "format", vol.id, "auto");
-        } catch (NativeDaemonConnectorException e) {
-            throw e.rethrowAsParcelableException();
+            if (ENABLE_BINDER) {
+                mVold.format(vol.id, "auto");
+            } else {
+                mConnector.execute("volume", "format", vol.id, "auto");
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -1859,13 +1916,16 @@
 
         try {
             // TODO: make benchmark async so we don't block other commands
-            final NativeDaemonEvent res = mConnector.execute(3 * DateUtils.MINUTE_IN_MILLIS,
-                    "volume", "benchmark", volId);
-            return Long.parseLong(res.getMessage());
-        } catch (NativeDaemonTimeoutException e) {
+            if (ENABLE_BINDER) {
+                return mVold.benchmark(volId);
+            } else {
+                final NativeDaemonEvent res = mConnector.execute(3 * DateUtils.MINUTE_IN_MILLIS,
+                        "volume", "benchmark", volId);
+                return Long.parseLong(res.getMessage());
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
             return Long.MAX_VALUE;
-        } catch (NativeDaemonConnectorException e) {
-            throw e.rethrowAsParcelableException();
         }
     }
 
@@ -1876,12 +1936,14 @@
 
         final CountDownLatch latch = findOrCreateDiskScanLatch(diskId);
         try {
-            mConnector.execute("volume", "partition", diskId, "public");
+            if (ENABLE_BINDER) {
+                mVold.partition(diskId, IVold.PARTITION_TYPE_PUBLIC, -1);
+            } else {
+                mConnector.execute("volume", "partition", diskId, "public");
+            }
             waitForLatch(latch, "partitionPublic", 3 * DateUtils.MINUTE_IN_MILLIS);
-        } catch (NativeDaemonConnectorException e) {
-            throw e.rethrowAsParcelableException();
-        } catch (TimeoutException e) {
-            throw new IllegalStateException(e);
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -1893,12 +1955,14 @@
 
         final CountDownLatch latch = findOrCreateDiskScanLatch(diskId);
         try {
-            mConnector.execute("volume", "partition", diskId, "private");
+            if (ENABLE_BINDER) {
+                mVold.partition(diskId, IVold.PARTITION_TYPE_PRIVATE, -1);
+            } else {
+                mConnector.execute("volume", "partition", diskId, "private");
+            }
             waitForLatch(latch, "partitionPrivate", 3 * DateUtils.MINUTE_IN_MILLIS);
-        } catch (NativeDaemonConnectorException e) {
-            throw e.rethrowAsParcelableException();
-        } catch (TimeoutException e) {
-            throw new IllegalStateException(e);
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -1910,12 +1974,14 @@
 
         final CountDownLatch latch = findOrCreateDiskScanLatch(diskId);
         try {
-            mConnector.execute("volume", "partition", diskId, "mixed", ratio);
+            if (ENABLE_BINDER) {
+                mVold.partition(diskId, IVold.PARTITION_TYPE_MIXED, ratio);
+            } else {
+                mConnector.execute("volume", "partition", diskId, "mixed", ratio);
+            }
             waitForLatch(latch, "partitionMixed", 3 * DateUtils.MINUTE_IN_MILLIS);
-        } catch (NativeDaemonConnectorException e) {
-            throw e.rethrowAsParcelableException();
-        } catch (TimeoutException e) {
-            throw new IllegalStateException(e);
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -1999,9 +2065,13 @@
 
     private void forgetPartition(String partGuid) {
         try {
-            mConnector.execute("volume", "forget_partition", partGuid);
-        } catch (NativeDaemonConnectorException e) {
-            Slog.w(TAG, "Failed to forget key for " + partGuid + ": " + e);
+            if (ENABLE_BINDER) {
+                mVold.forgetPartition(partGuid);
+            } else {
+                mConnector.execute("volume", "forget_partition", partGuid);
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -2021,9 +2091,13 @@
         }
 
         try {
-            mConnector.execute("fstrim", cmd);
-        } catch (NativeDaemonConnectorException e) {
-            Slog.e(TAG, "Failed to run fstrim: " + e);
+            if (ENABLE_BINDER) {
+                mVold.fstrim(flags);
+            } else {
+                mConnector.execute("fstrim", cmd);
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -2035,20 +2109,22 @@
             case Zygote.MOUNT_EXTERNAL_DEFAULT: {
                 modeName = "default";
             } break;
-
             case Zygote.MOUNT_EXTERNAL_READ: {
                 modeName = "read";
             } break;
-
             case Zygote.MOUNT_EXTERNAL_WRITE: {
                 modeName = "write";
             } break;
         }
 
         try {
-            mConnector.execute("volume", "remount_uid", uid, modeName);
-        } catch (NativeDaemonConnectorException e) {
-            Slog.w(TAG, "Failed to remount UID " + uid + " as " + modeName + ": " + e);
+            if (ENABLE_BINDER) {
+                mVold.remountUid(uid, mode);
+            } else {
+                mConnector.execute("volume", "remount_uid", uid, modeName);
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -2199,9 +2275,13 @@
         }
 
         try {
-            mConnector.execute("volume", "move_storage", from.id, to.id);
-        } catch (NativeDaemonConnectorException e) {
-            throw e.rethrowAsParcelableException();
+            if (ENABLE_BINDER) {
+                mVold.moveStorage(from.id, to.id);
+            } else {
+                mConnector.execute("volume", "move_storage", from.id, to.id);
+            }
+        } catch (Exception e) {
+            Slog.wtf(TAG, e);
         }
     }
 
@@ -2247,6 +2327,7 @@
     }
 
     public String[] getSecureContainerList() {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_ACCESS);
         waitForReady();
         warnOnNotMounted();
@@ -2261,6 +2342,7 @@
 
     public int createSecureContainer(String id, int sizeMb, String fstype, String key,
             int ownerUid, boolean external) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_CREATE);
         waitForReady();
         warnOnNotMounted();
@@ -2283,6 +2365,7 @@
 
     @Override
     public int resizeSecureContainer(String id, int sizeMb, String key) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_CREATE);
         waitForReady();
         warnOnNotMounted();
@@ -2297,6 +2380,7 @@
     }
 
     public int finalizeSecureContainer(String id) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_CREATE);
         warnOnNotMounted();
 
@@ -2314,6 +2398,7 @@
     }
 
     public int fixPermissionsSecureContainer(String id, int gid, String filename) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_CREATE);
         warnOnNotMounted();
 
@@ -2331,6 +2416,7 @@
     }
 
     public int destroySecureContainer(String id, boolean force) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_DESTROY);
         waitForReady();
         warnOnNotMounted();
@@ -2371,6 +2457,7 @@
     }
 
     public int mountSecureContainer(String id, String key, int ownerUid, boolean readOnly) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_MOUNT_UNMOUNT);
         waitForReady();
         warnOnNotMounted();
@@ -2401,6 +2488,7 @@
     }
 
     public int unmountSecureContainer(String id, boolean force) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_MOUNT_UNMOUNT);
         waitForReady();
         warnOnNotMounted();
@@ -2444,6 +2532,7 @@
     }
 
     public boolean isSecureContainerMounted(String id) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_ACCESS);
         waitForReady();
         warnOnNotMounted();
@@ -2454,6 +2543,7 @@
     }
 
     public int renameSecureContainer(String oldId, String newId) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_RENAME);
         waitForReady();
         warnOnNotMounted();
@@ -2479,6 +2569,7 @@
     }
 
     public String getSecureContainerPath(String id) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_ACCESS);
         waitForReady();
         warnOnNotMounted();
@@ -2500,6 +2591,7 @@
     }
 
     public String getSecureContainerFilesystemPath(String id) {
+        if (!ASEC_ENABLE) throw new UnsupportedOperationException();
         enforcePermission(android.Manifest.permission.ASEC_ACCESS);
         waitForReady();
         warnOnNotMounted();
@@ -2567,6 +2659,10 @@
             return null;
         }
 
+        if (ENABLE_BINDER) {
+            return findVolumeByIdOrThrow(state.volId).getPath().getAbsolutePath();
+        }
+
         final NativeDaemonEvent event;
         try {
             event = mConnector.execute("obb", "path", state.canonicalPath);
@@ -2598,7 +2694,8 @@
         Preconditions.checkNotNull(token, "token cannot be null");
 
         final int callingUid = Binder.getCallingUid();
-        final ObbState obbState = new ObbState(rawPath, canonicalPath, callingUid, token, nonce);
+        final ObbState obbState = new ObbState(rawPath, canonicalPath,
+                callingUid, token, nonce, null);
         final ObbAction action = new MountObbAction(obbState, key, callingUid);
         mObbActionHandler.sendMessage(mObbActionHandler.obtainMessage(OBB_RUN_ACTION, action));
 
@@ -2618,8 +2715,8 @@
         if (existingState != null) {
             // TODO: separate state object from request data
             final int callingUid = Binder.getCallingUid();
-            final ObbState newState = new ObbState(
-                    rawPath, existingState.canonicalPath, callingUid, token, nonce);
+            final ObbState newState = new ObbState(rawPath, existingState.canonicalPath,
+                    callingUid, token, nonce, existingState.volId);
             final ObbAction action = new UnmountObbAction(newState, force);
             mObbActionHandler.sendMessage(mObbActionHandler.obtainMessage(OBB_RUN_ACTION, action));
 
@@ -3083,20 +3180,33 @@
 
         @Override
         public ParcelFileDescriptor open() throws NativeDaemonConnectorException {
-            final NativeDaemonEvent event = StorageManagerService.this.mConnector.execute(
-                    "appfuse", "mount", uid, Process.myPid(), mountId);
-            opened = true;
-            if (event.getFileDescriptors() == null ||
-                event.getFileDescriptors().length == 0) {
-                throw new NativeDaemonConnectorException("Cannot obtain device FD");
+            if (ENABLE_BINDER) {
+                try {
+                    return new ParcelFileDescriptor(
+                            mVold.mountAppFuse(uid, Process.myPid(), mountId));
+                } catch (Exception e) {
+                    throw new NativeDaemonConnectorException("Failed to mount", e);
+                }
+            } else {
+                final NativeDaemonEvent event = mConnector.execute(
+                        "appfuse", "mount", uid, Process.myPid(), mountId);
+                opened = true;
+                if (event.getFileDescriptors() == null ||
+                    event.getFileDescriptors().length == 0) {
+                    throw new NativeDaemonConnectorException("Cannot obtain device FD");
+                }
+                return new ParcelFileDescriptor(event.getFileDescriptors()[0]);
             }
-            return new ParcelFileDescriptor(event.getFileDescriptors()[0]);
         }
 
         @Override
         public void close() throws Exception {
             if (opened) {
-                mConnector.execute("appfuse", "unmount", uid, Process.myPid(), mountId);
+                if (ENABLE_BINDER) {
+                    mVold.unmountAppFuse(uid, Process.myPid(), mountId);
+                } else {
+                    mConnector.execute("appfuse", "unmount", uid, Process.myPid(), mountId);
+                }
                 opened = false;
             }
         }
@@ -3185,10 +3295,14 @@
             }
 
             try {
-                mConnector.execute("volume", "mkdirs", appPath);
+                if (ENABLE_BINDER) {
+                    mVold.mkdirs(appPath);
+                } else {
+                    mConnector.execute("volume", "mkdirs", appPath);
+                }
                 return 0;
-            } catch (NativeDaemonConnectorException e) {
-                return e.getCode();
+            } catch (Exception e) {
+                Slog.wtf(TAG, e);
             }
         }
 
@@ -3760,8 +3874,10 @@
             }
 
             final String hashedKey;
+            final String binderKey;
             if (mKey == null) {
                 hashedKey = "none";
+                binderKey = "";
             } else {
                 try {
                     SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
@@ -3771,6 +3887,7 @@
                     SecretKey key = factory.generateSecret(ks);
                     BigInteger bi = new BigInteger(key.getEncoded());
                     hashedKey = bi.toString(16);
+                    binderKey = hashedKey;
                 } catch (NoSuchAlgorithmException e) {
                     Slog.e(TAG, "Could not load PBKDF2 algorithm", e);
                     sendNewStatusOrIgnore(OnObbStateChangeListener.ERROR_INTERNAL);
@@ -3784,13 +3901,22 @@
 
             int rc = StorageResultCode.OperationSucceeded;
             try {
-                mConnector.execute("obb", "mount", mObbState.canonicalPath, new SensitiveArg(hashedKey),
-                        mObbState.ownerGid);
+                if (ENABLE_BINDER) {
+                    mObbState.volId = mVold.createObb(mObbState.canonicalPath, binderKey,
+                            mObbState.ownerGid);
+                    mVold.mount(mObbState.volId, 0, -1);
+                } else {
+                    mConnector.execute("obb", "mount", mObbState.canonicalPath,
+                            new SensitiveArg(hashedKey), mObbState.ownerGid);
+                }
             } catch (NativeDaemonConnectorException e) {
                 int code = e.getCode();
                 if (code != VoldResponseCode.OpFailedStorageBusy) {
                     rc = StorageResultCode.OperationFailedInternalError;
                 }
+            } catch (Exception e) {
+                Slog.w(TAG, e);
+                rc = StorageResultCode.OperationFailedInternalError;
             }
 
             if (rc == StorageResultCode.OperationSucceeded) {
@@ -3856,11 +3982,17 @@
 
             int rc = StorageResultCode.OperationSucceeded;
             try {
-                final Command cmd = new Command("obb", "unmount", mObbState.canonicalPath);
-                if (mForceUnmount) {
-                    cmd.appendArg("force");
+                if (ENABLE_BINDER) {
+                    mVold.unmount(mObbState.volId);
+                    mVold.destroyObb(mObbState.volId);
+                    mObbState.volId = null;
+                } else {
+                    final Command cmd = new Command("obb", "unmount", mObbState.canonicalPath);
+                    if (mForceUnmount) {
+                        cmd.appendArg("force");
+                    }
+                    mConnector.execute(cmd);
                 }
-                mConnector.execute(cmd);
             } catch (NativeDaemonConnectorException e) {
                 int code = e.getCode();
                 if (code == VoldResponseCode.OpFailedStorageBusy) {
@@ -3871,6 +4003,9 @@
                 } else {
                     rc = StorageResultCode.OperationFailedInternalError;
                 }
+            } catch (Exception e) {
+                Slog.w(TAG, e);
+                rc = StorageResultCode.OperationFailedInternalError;
             }
 
             if (rc == StorageResultCode.OperationSucceeded) {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 4c66c45..d515326 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -13167,7 +13167,6 @@
                 return;
             }
         }
-
         // We are now ready to launch the assist activity.
         IResultReceiver sendReceiver = null;
         Bundle sendBundle = null;
@@ -13197,17 +13196,24 @@
             return;
         }
 
-        long ident = Binder.clearCallingIdentity();
+        final long ident = Binder.clearCallingIdentity();
         try {
-            pae.intent.replaceExtras(pae.extras);
-            pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
-                    | Intent.FLAG_ACTIVITY_SINGLE_TOP
-                    | Intent.FLAG_ACTIVITY_CLEAR_TOP);
-            closeSystemDialogs("assist");
-            try {
-                mContext.startActivityAsUser(pae.intent, new UserHandle(pae.userHandle));
-            } catch (ActivityNotFoundException e) {
-                Slog.w(TAG, "No activity to handle assist action.", e);
+            if (TextUtils.equals(pae.intent.getAction(),
+                    android.service.voice.VoiceInteractionService.SERVICE_INTERFACE)) {
+                pae.intent.putExtras(pae.extras);
+                mContext.startServiceAsUser(pae.intent, new UserHandle(pae.userHandle));
+            } else {
+                pae.intent.replaceExtras(pae.extras);
+                pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+                        | Intent.FLAG_ACTIVITY_SINGLE_TOP
+                        | Intent.FLAG_ACTIVITY_CLEAR_TOP);
+                closeSystemDialogs("assist");
+
+                try {
+                    mContext.startActivityAsUser(pae.intent, new UserHandle(pae.userHandle));
+                } catch (ActivityNotFoundException e) {
+                    Slog.w(TAG, "No activity to handle assist action.", e);
+                }
             }
         } finally {
             Binder.restoreCallingIdentity(ident);
diff --git a/services/core/java/com/android/server/am/ActivityMetricsLogger.java b/services/core/java/com/android/server/am/ActivityMetricsLogger.java
index aae98a6..0c8321d 100644
--- a/services/core/java/com/android/server/am/ActivityMetricsLogger.java
+++ b/services/core/java/com/android/server/am/ActivityMetricsLogger.java
@@ -6,10 +6,12 @@
 import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
 import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
 import static android.app.ActivityManagerInternal.APP_TRANSITION_TIMEOUT;
-import static android.app.WindowConfiguration.WINDOWING_MODE_DOCKED;
+import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
 import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
+import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
+import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_BIND_APPLICATION_DELAY_MS;
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_CALLING_PACKAGE_NAME;
@@ -111,31 +113,34 @@
         }
         mLastLogTimeSecs = now;
 
-        ActivityStack stack = mSupervisor.getStack(DOCKED_STACK_ID);
-        if (stack != null && stack.shouldBeVisible(null) != STACK_INVISIBLE) {
-            mWindowState = WINDOW_STATE_SIDE_BY_SIDE;
+        mWindowState = WINDOW_STATE_INVALID;
+        ActivityStack stack = mSupervisor.getFocusedStack();
+        if (stack.isActivityTypeAssistant()) {
+            mWindowState = WINDOW_STATE_ASSISTANT;
             return;
         }
-        mWindowState = WINDOW_STATE_INVALID;
-        stack = mSupervisor.getFocusedStack();
+
         int windowingMode = stack.getWindowingMode();
         if (windowingMode == WINDOWING_MODE_PINNED) {
             stack = mSupervisor.findStackBehind(stack);
             windowingMode = stack.getWindowingMode();
         }
-        if (StackId.isHomeOrRecentsStack(stack.mStackId)
-                || windowingMode == WINDOWING_MODE_FULLSCREEN) {
-            mWindowState = WINDOW_STATE_STANDARD;
-        } else if (windowingMode == WINDOWING_MODE_DOCKED) {
-            Slog.wtf(TAG, "Docked stack shouldn't be the focused stack, because it reported not"
-                    + " being visible.");
-            mWindowState = WINDOW_STATE_INVALID;
-        } else if (windowingMode == WINDOWING_MODE_FREEFORM) {
-            mWindowState = WINDOW_STATE_FREEFORM;
-        } else if (stack.mStackId == ASSISTANT_STACK_ID) {
-            mWindowState = WINDOW_STATE_ASSISTANT;
-        } else if (StackId.isStaticStack(stack.mStackId)) {
-            throw new IllegalStateException("Unknown stack=" + stack);
+        switch (windowingMode) {
+            case WINDOWING_MODE_FULLSCREEN:
+                mWindowState = WINDOW_STATE_STANDARD;
+                break;
+            case WINDOWING_MODE_SPLIT_SCREEN_PRIMARY:
+            case WINDOWING_MODE_SPLIT_SCREEN_SECONDARY:
+                mWindowState = WINDOW_STATE_SIDE_BY_SIDE;
+                break;
+            case WINDOW_STATE_FREEFORM:
+                mWindowState = WINDOW_STATE_FREEFORM;
+                break;
+            default:
+                if (windowingMode != WINDOWING_MODE_UNDEFINED) {
+                    throw new IllegalStateException("Unknown windowing mode for stack=" + stack
+                            + " windowingMode=" + windowingMode);
+                }
         }
     }
 
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 84bf18a0..8c9e399 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -482,7 +482,8 @@
     // TODO: Not needed once we are no longer using stack ids as the override config. can be passed
     // in.
     private void updateOverrideConfiguration() {
-        final int windowingMode = getWindowingModeForStackId(mStackId);
+        final int windowingMode = getWindowingModeForStackId(
+                mStackId, mStackSupervisor.getStack(DOCKED_STACK_ID) != null);
         if (windowingMode != WINDOWING_MODE_UNDEFINED) {
             setWindowingMode(windowingMode);
         }
@@ -1198,6 +1199,7 @@
      * process of going to sleep (checkReadyForSleep will be called when that process finishes).
      */
     boolean goToSleepIfPossible(boolean shuttingDown) {
+        final ActivityRecord topActivity = topActivity();
         boolean shouldSleep = true;
 
         if (mResumedActivity != null) {
@@ -1222,6 +1224,11 @@
             // Still waiting for something to pause; can't sleep yet.
             if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Sleep still waiting to pause " + mPausingActivity);
             shouldSleep = false;
+        } else if (topActivity != null && topActivity.state == ActivityState.PAUSED) {
+            // Our top activity is currently paused, we need to ensure we move it to the stopped
+            // state.
+            stopActivityLocked(topActivity);
+            shouldSleep = false;
         }
 
         if (!shuttingDown) {
@@ -2994,13 +3001,6 @@
             // Ensure the task/activity being brought forward is not the assistant
             return false;
         }
-        final boolean isFullscreen = toFrontTask != null
-                ? toFrontTask.containsOnlyFullscreenActivities()
-                : toFrontActivity.fullscreen;
-        if (!isFullscreen) {
-            // Ensure the task/activity being brought forward is fullscreen
-            return false;
-        }
         return true;
     }
 
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index e4a2273..fe28956 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -36,6 +36,8 @@
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
 import static android.content.pm.PackageManager.PERMISSION_DENIED;
 import static android.content.pm.PackageManager.PERMISSION_GRANTED;
 import static android.os.PowerManager.PARTIAL_WAKE_LOCK;
@@ -2279,15 +2281,6 @@
         return null;
     }
 
-    /**
-     * Returns if a stack should be treated as if it's docked. Returns true if the stack is
-     * the docked stack itself, or if it's side-by-side to the docked stack.
-     */
-    boolean isStackDockedInEffect(int stackId) {
-        return stackId == DOCKED_STACK_ID ||
-                (StackId.isResizeableByDockedStack(stackId) && getStack(DOCKED_STACK_ID) != null);
-    }
-
     void resizeStackLocked(int stackId, Rect bounds, Rect tempTaskBounds, Rect tempTaskInsetBounds,
             boolean preserveWindows, boolean allowResizeInDockedMode, boolean deferResume) {
         if (stackId == DOCKED_STACK_ID) {
@@ -2301,9 +2294,9 @@
             return;
         }
 
+        final boolean splitScreenActive = getStack(DOCKED_STACK_ID) != null;
         if (!allowResizeInDockedMode
-                && !stack.getWindowConfiguration().tasksAreFloating()
-                && getStack(DOCKED_STACK_ID) != null) {
+                && !stack.getWindowConfiguration().tasksAreFloating() && splitScreenActive) {
             // If the docked stack exists, don't resize non-floating stacks independently of the
             // size computed from the docked stack size (otherwise they will be out of sync)
             return;
@@ -2312,6 +2305,16 @@
         Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "am.resizeStack_" + stackId);
         mWindowManager.deferSurfaceLayout();
         try {
+            if (stack.supportSplitScreenWindowingMode()) {
+                if (bounds == null && stack.inSplitScreenWindowingMode()) {
+                    // null bounds = fullscreen windowing mode...at least for now.
+                    stack.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
+                } else if (splitScreenActive) {
+                    // If we are in split-screen mode and this stack support split-screen, then
+                    // it should be split-screen secondary mode. i.e. adjacent to the docked stack.
+                    stack.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY);
+                }
+            }
             stack.resize(bounds, tempTaskBounds, tempTaskInsetBounds);
             if (!deferResume) {
                 stack.ensureVisibleActivitiesConfigurationLocked(
@@ -2323,14 +2326,14 @@
         }
     }
 
-    void deferUpdateBounds(int stackId) {
+    private void deferUpdateBounds(int stackId) {
         final ActivityStack stack = getStack(stackId);
         if (stack != null) {
             stack.deferUpdateBounds();
         }
     }
 
-    void continueUpdateBounds(int stackId) {
+    private void continueUpdateBounds(int stackId) {
         final ActivityStack stack = getStack(stackId);
         if (stack != null) {
             stack.continueUpdateBounds();
@@ -2365,13 +2368,15 @@
                 // which is dismissing the docked stack, so resize all other stacks to
                 // fullscreen here already so we don't end up with resize trashing.
                 for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) {
-                    if (StackId.isResizeableByDockedStack(i)) {
-                        ActivityStack otherStack = getStack(i);
-                        if (otherStack != null) {
-                            resizeStackLocked(i, null, null, null, PRESERVE_WINDOWS,
-                                    true /* allowResizeInDockedMode */, DEFER_RESUME);
-                        }
+                    final ActivityStack otherStack = getStack(i);
+                    if (otherStack == null) {
+                        continue;
                     }
+                    if (!otherStack.inSplitScreenSecondaryWindowingMode()) {
+                        continue;
+                    }
+                    resizeStackLocked(i, null, null, null, PRESERVE_WINDOWS,
+                            true /* allowResizeInDockedMode */, DEFER_RESUME);
                 }
 
                 // Also disable docked stack resizing since we have manually adjusted the
@@ -2485,18 +2490,24 @@
                 // screen controls and is also the same for all stacks.
                 final Rect otherTaskRect = new Rect();
                 for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) {
-                    final ActivityStack current = getStack(i);
-                    if (current != null && StackId.isResizeableByDockedStack(i)) {
-                        current.getStackDockedModeBounds(
-                                tempOtherTaskBounds /* currentTempTaskBounds */,
-                                tempRect /* outStackBounds */,
-                                otherTaskRect /* outTempTaskBounds */, true /* ignoreVisibility */);
-
-                        resizeStackLocked(i, !tempRect.isEmpty() ? tempRect : null,
-                                !otherTaskRect.isEmpty() ? otherTaskRect : tempOtherTaskBounds,
-                                tempOtherTaskInsetBounds, preserveWindows,
-                                true /* allowResizeInDockedMode */, deferResume);
+                    if (i == DOCKED_STACK_ID) {
+                        continue;
                     }
+                    final ActivityStack current = getStack(i);
+                    if (current == null || !current.supportSplitScreenWindowingMode()) {
+                        continue;
+                    }
+                    // Need to set windowing mode here before we try to get the dock bounds.
+                    current.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY);
+                    current.getStackDockedModeBounds(
+                            tempOtherTaskBounds /* currentTempTaskBounds */,
+                            tempRect /* outStackBounds */,
+                            otherTaskRect /* outTempTaskBounds */, true /* ignoreVisibility */);
+
+                    resizeStackLocked(i, !tempRect.isEmpty() ? tempRect : null,
+                            !otherTaskRect.isEmpty() ? otherTaskRect : tempOtherTaskBounds,
+                            tempOtherTaskInsetBounds, preserveWindows,
+                            true /* allowResizeInDockedMode */, deferResume);
                 }
             }
             if (!deferResume) {
@@ -4023,7 +4034,10 @@
         final boolean isSecondaryDisplayPreferred =
                 (preferredDisplayId != DEFAULT_DISPLAY && preferredDisplayId != INVALID_DISPLAY)
                 || StackId.isDynamicStack(preferredStackId);
-        if (((!isStackDockedInEffect(actualStackId) && preferredStackId != DOCKED_STACK_ID)
+        final ActivityStack actualStack = getStack(actualStackId);
+        final boolean inSplitScreenMode = actualStack != null
+                && actualStack.inSplitScreenWindowingMode();
+        if (((!inSplitScreenMode && preferredStackId != DOCKED_STACK_ID)
                 && !isSecondaryDisplayPreferred) || task.isActivityTypeHome()) {
             return;
         }
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 33568cd..37f6a2d 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -52,6 +52,7 @@
 import com.android.internal.util.DumpUtils;
 import com.android.server.LocalServices;
 import com.android.server.power.BatterySaverPolicy.ServiceType;
+import android.util.StatsLog;
 
 import java.io.File;
 import java.io.FileDescriptor;
@@ -281,12 +282,26 @@
     void noteProcessStart(String name, int uid) {
         synchronized (mStats) {
             mStats.noteProcessStartLocked(name, uid);
+
+            // TODO: remove this once we figure out properly where and how
+            // PROCESS_EVENT = 1112
+            // EVENT SUBTYPE: START = 1
+            // KEY_NAME: 1
+            // KEY_UID: 2
+            StatsLog.writeArray(1112, 1, 1, name, 2, uid);
         }
     }
 
     void noteProcessCrash(String name, int uid) {
         synchronized (mStats) {
             mStats.noteProcessCrashLocked(name, uid);
+
+            // TODO: remove this once we figure out properly where and how
+            // PROCESS_EVENT = 1112
+            // EVENT SUBTYPE: CRASH = 2
+            // KEY_NAME: 1
+            // KEY_UID: 2
+            StatsLog.writeArray(1112, 2, 1, name, 2, uid);
         }
     }
 
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 62afcd2..0e651845 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -1016,19 +1016,6 @@
         return intent != null ? intent : affinityIntent;
     }
 
-    /**
-     * @return Whether there are only fullscreen activities in this task.
-     */
-    boolean containsOnlyFullscreenActivities() {
-        for (int i = 0; i < mActivities.size(); i++) {
-            final ActivityRecord r = mActivities.get(i);
-            if (!r.finishing && !r.fullscreen) {
-                return false;
-            }
-        }
-        return true;
-    }
-
     /** Returns the first non-finishing activity from the root. */
     ActivityRecord getRootActivity() {
         for (int i = 0; i < mActivities.size(); i++) {
diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java
index db72c5e..efc930e 100644
--- a/services/core/java/com/android/server/clipboard/ClipboardService.java
+++ b/services/core/java/com/android/server/clipboard/ClipboardService.java
@@ -20,6 +20,7 @@
 import android.app.AppGlobals;
 import android.app.AppOpsManager;
 import android.app.IActivityManager;
+import android.app.KeyguardManager;
 import android.content.ClipData;
 import android.content.ClipDescription;
 import android.content.ContentProvider;
@@ -304,7 +305,7 @@
         public ClipData getPrimaryClip(String pkg) {
             synchronized (this) {
                 if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, pkg,
-                            Binder.getCallingUid())) {
+                            Binder.getCallingUid()) || isDeviceLocked()) {
                     return null;
                 }
                 addActiveOwnerLocked(Binder.getCallingUid(), pkg);
@@ -316,7 +317,7 @@
         public ClipDescription getPrimaryClipDescription(String callingPackage) {
             synchronized (this) {
                 if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
-                            Binder.getCallingUid())) {
+                            Binder.getCallingUid()) || isDeviceLocked()) {
                     return null;
                 }
                 PerUserClipboard clipboard = getClipboard();
@@ -328,7 +329,7 @@
         public boolean hasPrimaryClip(String callingPackage) {
             synchronized (this) {
                 if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
-                            Binder.getCallingUid())) {
+                            Binder.getCallingUid()) || isDeviceLocked()) {
                     return false;
                 }
                 return getClipboard().primaryClip != null;
@@ -355,7 +356,7 @@
         public boolean hasClipboardText(String callingPackage) {
             synchronized (this) {
                 if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
-                            Binder.getCallingUid())) {
+                            Binder.getCallingUid()) || isDeviceLocked()) {
                     return false;
                 }
                 PerUserClipboard clipboard = getClipboard();
@@ -433,6 +434,12 @@
         }
     }
 
+    private boolean isDeviceLocked() {
+        final KeyguardManager keyguardManager = getContext().getSystemService(
+                    KeyguardManager.class);
+        return keyguardManager != null && keyguardManager.isDeviceLocked();
+    }
+
     private final void checkUriOwnerLocked(Uri uri, int uid) {
         if (!"content".equals(uri.getScheme())) {
             return;
diff --git a/services/core/java/com/android/server/connectivity/tethering/OffloadController.java b/services/core/java/com/android/server/connectivity/tethering/OffloadController.java
index 788867f..5eafe5f 100644
--- a/services/core/java/com/android/server/connectivity/tethering/OffloadController.java
+++ b/services/core/java/com/android/server/connectivity/tethering/OffloadController.java
@@ -30,6 +30,10 @@
 import android.net.LinkProperties;
 import android.net.NetworkStats;
 import android.net.RouteInfo;
+import android.net.netlink.ConntrackMessage;
+import android.net.netlink.NetlinkConstants;
+import android.net.netlink.NetlinkSocket;
+import android.net.util.IpUtils;
 import android.net.util.SharedLog;
 import android.os.Handler;
 import android.os.Looper;
@@ -37,10 +41,12 @@
 import android.os.RemoteException;
 import android.os.SystemClock;
 import android.provider.Settings;
+import android.system.ErrnoException;
+import android.system.OsConstants;
 import android.text.TextUtils;
-import com.android.server.connectivity.tethering.OffloadHardwareInterface.ForwardedStats;
 
 import com.android.internal.util.IndentingPrintWriter;
+import com.android.server.connectivity.tethering.OffloadHardwareInterface.ForwardedStats;
 
 import java.net.Inet4Address;
 import java.net.Inet6Address;
@@ -63,6 +69,7 @@
  */
 public class OffloadController {
     private static final String TAG = OffloadController.class.getSimpleName();
+    private static final boolean DBG = false;
     private static final String ANYIP = "0.0.0.0";
     private static final ForwardedStats EMPTY_STATS = new ForwardedStats();
 
@@ -96,6 +103,9 @@
     // includes upstream interfaces that have a quota set.
     private HashMap<String, Long> mInterfaceQuotas = new HashMap<>();
 
+    private int mNatUpdateCallbacksReceived;
+    private int mNatUpdateNetlinkErrors;
+
     public OffloadController(Handler h, OffloadHardwareInterface hwi,
             ContentResolver contentResolver, INetworkManagementService nms, SharedLog log) {
         mHandler = h;
@@ -115,12 +125,12 @@
         }
     }
 
-    public void start() {
-        if (started()) return;
+    public boolean start() {
+        if (started()) return true;
 
         if (isOffloadDisabled()) {
             mLog.i("tethering offload disabled");
-            return;
+            return false;
         }
 
         if (!mConfigInitialized) {
@@ -128,11 +138,14 @@
             if (!mConfigInitialized) {
                 mLog.i("tethering offload config not supported");
                 stop();
-                return;
+                return false;
             }
         }
 
         mControlInitialized = mHwInterface.initOffloadControl(
+                // OffloadHardwareInterface guarantees that these callback
+                // methods are called on the handler passed to it, which is the
+                // same as mHandler, as coordinated by the setup in Tethering.
                 new OffloadHardwareInterface.ControlCallback() {
                     @Override
                     public void onStarted() {
@@ -203,15 +216,20 @@
                                                    String srcAddr, int srcPort,
                                                    String dstAddr, int dstPort) {
                         if (!started()) return;
-                        mLog.log(String.format("NAT timeout update: %s (%s,%s) -> (%s,%s)",
-                                proto, srcAddr, srcPort, dstAddr, dstPort));
+                        updateNatTimeout(proto, srcAddr, srcPort, dstAddr, dstPort);
                     }
                 });
-        if (!mControlInitialized) {
+
+        final boolean isStarted = started();
+        if (!isStarted) {
             mLog.i("tethering offload control not supported");
             stop();
+        } else {
+            mLog.log("tethering offload started");
+            mNatUpdateCallbacksReceived = 0;
+            mNatUpdateNetlinkErrors = 0;
         }
-        mLog.log("tethering offload started");
+        return isStarted;
     }
 
     public void stop() {
@@ -227,6 +245,10 @@
         if (wasStarted) mLog.log("tethering offload stopped");
     }
 
+    private boolean started() {
+        return mConfigInitialized && mControlInitialized;
+    }
+
     private class OffloadTetheringStatsProvider extends ITetheringStatsProvider.Stub {
         @Override
         public NetworkStats getTetherStats(int how) {
@@ -402,10 +424,6 @@
                 mContentResolver, TETHER_OFFLOAD_DISABLED, defaultDisposition) != 0);
     }
 
-    private boolean started() {
-        return mConfigInitialized && mControlInitialized;
-    }
-
     private boolean pushUpstreamParameters(String prevUpstream) {
         final String iface = currentUpstreamInterface();
 
@@ -516,10 +534,113 @@
             pw.println("Offload disabled");
             return;
         }
-        pw.println("Offload HALs " + (started() ? "started" : "not started"));
+        final boolean isStarted = started();
+        pw.println("Offload HALs " + (isStarted ? "started" : "not started"));
         LinkProperties lp = mUpstreamLinkProperties;
         String upstream = (lp != null) ? lp.getInterfaceName() : null;
         pw.println("Current upstream: " + upstream);
         pw.println("Exempt prefixes: " + mLastLocalPrefixStrs);
+        pw.println("NAT timeout update callbacks received during the "
+                + (isStarted ? "current" : "last")
+                + " offload session: "
+                + mNatUpdateCallbacksReceived);
+        pw.println("NAT timeout update netlink errors during the "
+                + (isStarted ? "current" : "last")
+                + " offload session: "
+                + mNatUpdateNetlinkErrors);
+    }
+
+    private void updateNatTimeout(
+            int proto, String srcAddr, int srcPort, String dstAddr, int dstPort) {
+        final String protoName = protoNameFor(proto);
+        if (protoName == null) {
+            mLog.e("Unknown NAT update callback protocol: " + proto);
+            return;
+        }
+
+        final Inet4Address src = parseIPv4Address(srcAddr);
+        if (src == null) {
+            mLog.e("Failed to parse IPv4 address: " + srcAddr);
+            return;
+        }
+
+        if (!IpUtils.isValidUdpOrTcpPort(srcPort)) {
+            mLog.e("Invalid src port: " + srcPort);
+            return;
+        }
+
+        final Inet4Address dst = parseIPv4Address(dstAddr);
+        if (dst == null) {
+            mLog.e("Failed to parse IPv4 address: " + dstAddr);
+            return;
+        }
+
+        if (!IpUtils.isValidUdpOrTcpPort(dstPort)) {
+            mLog.e("Invalid dst port: " + dstPort);
+            return;
+        }
+
+        mNatUpdateCallbacksReceived++;
+        if (DBG) {
+            mLog.log(String.format("NAT timeout update: %s (%s, %s) -> (%s, %s)",
+                     protoName, srcAddr, srcPort, dstAddr, dstPort));
+        }
+
+        final int timeoutSec = connectionTimeoutUpdateSecondsFor(proto);
+        final byte[] msg = ConntrackMessage.newIPv4TimeoutUpdateRequest(
+                proto, src, srcPort, dst, dstPort, timeoutSec);
+
+        try {
+            NetlinkSocket.sendOneShotKernelMessage(OsConstants.NETLINK_NETFILTER, msg);
+        } catch (ErrnoException e) {
+            mNatUpdateNetlinkErrors++;
+            mLog.e("Error updating NAT conntrack entry: " + e
+                    + ", msg: " + NetlinkConstants.hexify(msg));
+            mLog.log("NAT timeout update callbacks received: " + mNatUpdateCallbacksReceived);
+            mLog.log("NAT timeout update netlink errors: " + mNatUpdateNetlinkErrors);
+        }
+    }
+
+    private static Inet4Address parseIPv4Address(String addrString) {
+        try {
+            final InetAddress ip = InetAddress.parseNumericAddress(addrString);
+            // TODO: Consider other sanitization steps here, including perhaps:
+            //           not eql to 0.0.0.0
+            //           not within 169.254.0.0/16
+            //           not within ::ffff:0.0.0.0/96
+            //           not within ::/96
+            // et cetera.
+            if (ip instanceof Inet4Address) {
+                return (Inet4Address) ip;
+            }
+        } catch (IllegalArgumentException iae) {}
+        return null;
+    }
+
+    private static String protoNameFor(int proto) {
+        // OsConstants values are not constant expressions; no switch statement.
+        if (proto == OsConstants.IPPROTO_UDP) {
+            return "UDP";
+        } else if (proto == OsConstants.IPPROTO_TCP) {
+            return "TCP";
+        }
+        return null;
+    }
+
+    private static int connectionTimeoutUpdateSecondsFor(int proto) {
+        // TODO: Replace this with more thoughtful work, perhaps reading from
+        // and maybe writing to any required
+        //
+        //     /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_*
+        //     /proc/sys/net/netfilter/nf_conntrack_udp_timeout{,_stream}
+        //
+        // entries.  TBD.
+        if (proto == OsConstants.IPPROTO_TCP) {
+            // Cf. /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established
+            return 432000;
+        } else {
+            // Cf. /proc/sys/net/netfilter/nf_conntrack_udp_timeout_stream
+            return 180;
+        }
     }
 }
diff --git a/services/core/java/com/android/server/connectivity/tethering/OffloadHardwareInterface.java b/services/core/java/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
index 865a989..76195c4 100644
--- a/services/core/java/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
+++ b/services/core/java/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
@@ -21,10 +21,12 @@
 import android.hardware.tetheroffload.control.V1_0.IOffloadControl;
 import android.hardware.tetheroffload.control.V1_0.ITetheringOffloadCallback;
 import android.hardware.tetheroffload.control.V1_0.NatTimeoutUpdate;
+import android.hardware.tetheroffload.control.V1_0.NetworkProtocol;
 import android.hardware.tetheroffload.control.V1_0.OffloadCallbackEvent;
 import android.os.Handler;
 import android.os.RemoteException;
 import android.net.util.SharedLog;
+import android.system.OsConstants;
 
 import java.util.ArrayList;
 
@@ -107,6 +109,10 @@
                 mLog.e("tethering offload control not supported: " + e);
                 return false;
             }
+            if (mOffloadControl == null) {
+                mLog.e("tethering IOffloadControl.getService() returned null");
+                return false;
+            }
         }
 
         final String logmsg = String.format("initOffloadControl(%s)",
@@ -327,13 +333,24 @@
         public void updateTimeout(NatTimeoutUpdate params) {
             handler.post(() -> {
                     controlCb.onNatTimeoutUpdate(
-                        params.proto,
+                        networkProtocolToOsConstant(params.proto),
                         params.src.addr, uint16(params.src.port),
                         params.dst.addr, uint16(params.dst.port));
             });
         }
     }
 
+    private static int networkProtocolToOsConstant(int proto) {
+        switch (proto) {
+            case NetworkProtocol.TCP: return OsConstants.IPPROTO_TCP;
+            case NetworkProtocol.UDP: return OsConstants.IPPROTO_UDP;
+            default:
+                // The caller checks this value and will log an error. Just make
+                // sure it won't collide with valid OsContants.IPPROTO_* values.
+                return -Math.abs(proto);
+        }
+    }
+
     private static class CbResults {
         boolean success;
         String errMsg;
diff --git a/services/core/java/com/android/server/job/JobSchedulerService.java b/services/core/java/com/android/server/job/JobSchedulerService.java
index c6998d6..ac80794 100644
--- a/services/core/java/com/android/server/job/JobSchedulerService.java
+++ b/services/core/java/com/android/server/job/JobSchedulerService.java
@@ -228,7 +228,6 @@
         private static final String KEY_MAX_WORK_RESCHEDULE_COUNT = "max_work_reschedule_count";
         private static final String KEY_MIN_LINEAR_BACKOFF_TIME = "min_linear_backoff_time";
         private static final String KEY_MIN_EXP_BACKOFF_TIME = "min_exp_backoff_time";
-        private static final String KEY_BG_JOBS_RESTRICTED = "bg_jobs_restricted";
 
         private static final int DEFAULT_MIN_IDLE_COUNT = 1;
         private static final int DEFAULT_MIN_CHARGING_COUNT = 1;
@@ -244,7 +243,6 @@
         private static final int DEFAULT_BG_MODERATE_JOB_COUNT = 4;
         private static final int DEFAULT_BG_LOW_JOB_COUNT = 1;
         private static final int DEFAULT_BG_CRITICAL_JOB_COUNT = 1;
-        private static final boolean DEFAULT_BG_JOBS_RESTRICTED = false;
         private static final int DEFAULT_MAX_STANDARD_RESCHEDULE_COUNT = Integer.MAX_VALUE;
         private static final int DEFAULT_MAX_WORK_RESCHEDULE_COUNT = Integer.MAX_VALUE;
         private static final long DEFAULT_MIN_LINEAR_BACKOFF_TIME = JobInfo.MIN_BACKOFF_MILLIS;
@@ -338,11 +336,6 @@
          */
         long MIN_EXP_BACKOFF_TIME = DEFAULT_MIN_EXP_BACKOFF_TIME;
 
-        /**
-         * Runtime switch for throttling background jobs
-         */
-        boolean BACKGROUND_JOBS_RESTRICTED = DEFAULT_BG_JOBS_RESTRICTED;
-
         private ContentResolver mResolver;
         private final KeyValueListParser mParser = new KeyValueListParser(',');
 
@@ -421,12 +414,6 @@
                         DEFAULT_MIN_LINEAR_BACKOFF_TIME);
                 MIN_EXP_BACKOFF_TIME = mParser.getLong(KEY_MIN_EXP_BACKOFF_TIME,
                         DEFAULT_MIN_EXP_BACKOFF_TIME);
-                final boolean bgJobsRestricted = mParser.getBoolean(KEY_BG_JOBS_RESTRICTED,
-                        DEFAULT_BG_JOBS_RESTRICTED);
-                if (bgJobsRestricted != BACKGROUND_JOBS_RESTRICTED) {
-                    mBackgroundJobsController.enableRestrictionsLocked(
-                            BACKGROUND_JOBS_RESTRICTED = bgJobsRestricted);
-                }
             }
         }
 
@@ -486,9 +473,6 @@
 
             pw.print("    "); pw.print(KEY_MIN_EXP_BACKOFF_TIME); pw.print("=");
             pw.print(MIN_EXP_BACKOFF_TIME); pw.println();
-
-            pw.print("    "); pw.print(KEY_BG_JOBS_RESTRICTED); pw.print("=");
-            pw.print(BACKGROUND_JOBS_RESTRICTED); pw.println();
         }
     }
 
diff --git a/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java b/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
index ec50d6d..0539c02 100644
--- a/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
+++ b/services/core/java/com/android/server/job/controllers/BackgroundJobsController.java
@@ -48,14 +48,12 @@
     private static final Object sCreationLock = new Object();
     private static volatile BackgroundJobsController sController;
 
-    /* Runtime switch to keep feature under wraps */
-    private boolean mEnableSwitch;
     private final JobSchedulerService mJobSchedulerService;
     private final IAppOpsService mAppOpsService;
     private final IDeviceIdleController mDeviceIdleController;
 
     private final SparseBooleanArray mForegroundUids;
-    private int[] mPowerWhitelistedAppIds;
+    private int[] mPowerWhitelistedUserAppIds;
     private int[] mTempWhitelistedAppIds;
     /**
      * Only tracks jobs for which source package app op RUN_ANY_IN_BACKGROUND is not ALLOWED.
@@ -81,7 +79,8 @@
                 try {
                     switch (intent.getAction()) {
                         case PowerManager.ACTION_POWER_SAVE_WHITELIST_CHANGED:
-                            mPowerWhitelistedAppIds = mDeviceIdleController.getAppIdWhitelist();
+                            mPowerWhitelistedUserAppIds =
+                                    mDeviceIdleController.getAppIdUserWhitelist();
                             break;
                         case PowerManager.ACTION_POWER_SAVE_TEMP_WHITELIST_CHANGED:
                             mTempWhitelistedAppIds = mDeviceIdleController.getAppIdTempWhitelist();
@@ -110,7 +109,7 @@
         try {
             mAppOpsService.startWatchingMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, null,
                     new AppOpsWatcher());
-            mPowerWhitelistedAppIds = mDeviceIdleController.getAppIdWhitelist();
+            mPowerWhitelistedUserAppIds = mDeviceIdleController.getAppIdUserWhitelist();
             mTempWhitelistedAppIds = mDeviceIdleController.getAppIdTempWhitelist();
         } catch (RemoteException rexc) {
             // Shouldn't happen as they are in the same process.
@@ -121,8 +120,6 @@
         powerWhitelistFilter.addAction(PowerManager.ACTION_POWER_SAVE_TEMP_WHITELIST_CHANGED);
         context.registerReceiverAsUser(mDozeWhitelistReceiver, UserHandle.ALL, powerWhitelistFilter,
                 null, null);
-
-        mEnableSwitch = false;
     }
 
     @Override
@@ -170,7 +167,6 @@
 
     @Override
     public void dumpControllerStateLocked(final PrintWriter pw, final int filterUid) {
-        pw.println("Background restrictions: global switch = " + mEnableSwitch);
         pw.print("Foreground uids: [");
         for (int i = 0; i < mForegroundUids.size(); i++) {
             if (mForegroundUids.valueAt(i)) pw.print(mForegroundUids.keyAt(i) + " ");
@@ -206,14 +202,6 @@
         });
     }
 
-    public void enableRestrictionsLocked(boolean enable) {
-        mEnableSwitch = enable;
-        Slog.d(LOG_TAG, "Background jobs restrictions switch changed to " + mEnableSwitch);
-        if (checkAllTrackedJobsLocked()) {
-            mStateChangedListener.onControllerStateChanged();
-        }
-    }
-
     void startTrackingJobLocked(JobStatus jobStatus) {
         final int uid = jobStatus.getSourceUid();
         ArraySet<JobStatus> jobsForUid = mTrackedJobs.get(uid);
@@ -255,11 +243,11 @@
 
     boolean isWhitelistedLocked(int uid) {
         return ArrayUtils.contains(mTempWhitelistedAppIds, UserHandle.getAppId(uid))
-                || ArrayUtils.contains(mPowerWhitelistedAppIds, UserHandle.getAppId(uid));
+                || ArrayUtils.contains(mPowerWhitelistedUserAppIds, UserHandle.getAppId(uid));
     }
 
     boolean canRunJobLocked(int uid) {
-        return !mEnableSwitch || mForegroundUids.get(uid) || isWhitelistedLocked(uid);
+        return mForegroundUids.get(uid) || isWhitelistedLocked(uid);
     }
 
     private final class AppOpsWatcher extends IAppOpsCallback.Stub {
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 0c9f65a..fd41346 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1460,8 +1460,18 @@
         if (channel.getImportance() == NotificationManager.IMPORTANCE_NONE) {
             // cancel
             cancelAllNotificationsInt(MY_UID, MY_PID, pkg, channel.getId(), 0, 0, true,
-                    UserHandle.getUserId(Binder.getCallingUid()), REASON_CHANNEL_BANNED,
+                    UserHandle.getUserId(uid), REASON_CHANNEL_BANNED,
                     null);
+            if (isUidSystemOrPhone(uid)) {
+                int[] profileIds = mUserProfiles.getCurrentProfileIds();
+                int N = profileIds.length;
+                for (int i = 0; i < N; i++) {
+                    int profileId = profileIds[i];
+                    cancelAllNotificationsInt(MY_UID, MY_PID, pkg, channel.getId(), 0, 0, true,
+                            profileId, REASON_CHANNEL_BANNED,
+                            null);
+                }
+            }
         }
         mRankingHelper.updateNotificationChannel(pkg, uid, channel);
 
diff --git a/services/core/java/com/android/server/notification/RankingHelper.java b/services/core/java/com/android/server/notification/RankingHelper.java
index 1736a74..fc24581 100644
--- a/services/core/java/com/android/server/notification/RankingHelper.java
+++ b/services/core/java/com/android/server/notification/RankingHelper.java
@@ -1220,7 +1220,7 @@
             changed |= oldValue != newValue;
         }
         if (changed) {
-            mRankingHandler.requestSort();
+            updateConfig();
         }
     }
 
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index 1a0b878..3194c52 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -465,6 +465,8 @@
                             + "from " + currRule.getName() + " to " + defaultRule.name);
                     // update default rule (if locale changed, name of rule will change)
                     AutomaticZenRule defaultAutoRule = createAutomaticZenRule(defaultRule);
+                    // ensure enabled state is carried over from current rule
+                    defaultAutoRule.setEnabled(currRule.isEnabled());
                     updateAutomaticZenRule(ruleId, defaultAutoRule,
                             "locale changed");
                 }
diff --git a/services/core/java/com/android/server/oemlock/OemLockService.java b/services/core/java/com/android/server/oemlock/OemLockService.java
index 5e19b13..40c6639 100644
--- a/services/core/java/com/android/server/oemlock/OemLockService.java
+++ b/services/core/java/com/android/server/oemlock/OemLockService.java
@@ -149,8 +149,12 @@
 
             final long token = Binder.clearCallingIdentity();
             try {
-                if (!canUserAllowOemUnlock()) {
-                    throw new SecurityException("User cannot allow OEM unlock");
+                if (!isOemUnlockAllowedByAdmin()) {
+                    throw new SecurityException("Admin does not allow OEM unlock");
+                }
+
+                if (!mOemLock.isOemUnlockAllowedByCarrier()) {
+                    throw new SecurityException("Carrier does not allow OEM unlock");
                 }
 
                 mOemLock.setOemUnlockAllowedByDevice(allowedByUser);
@@ -172,18 +176,6 @@
         }
 
         @Override
-        public boolean canUserAllowOemUnlock() {
-            enforceOemUnlockReadPermission();
-
-            final long token = Binder.clearCallingIdentity();
-            try {
-                return isOemUnlockAllowedByAdmin() && mOemLock.isOemUnlockAllowedByCarrier();
-            } finally {
-                Binder.restoreCallingIdentity(token);
-            }
-        }
-
-        @Override
         public boolean isOemUnlockAllowed() {
             enforceOemUnlockReadPermission();
 
diff --git a/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java b/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java
index c3957f43..db6e974 100644
--- a/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java
+++ b/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java
@@ -169,9 +169,8 @@
         }
 
         final PackageInfo targetPackage = mPackageManager.getPackageInfo(packageName, userId);
-        if (updateAllOverlaysForTarget(packageName, userId, targetPackage)) {
-            mListener.onOverlaysChanged(packageName, userId);
-        }
+        updateAllOverlaysForTarget(packageName, userId, targetPackage);
+        mListener.onOverlaysChanged(packageName, userId);
     }
 
     void onTargetPackageChanged(@NonNull final String packageName, final int userId) {
@@ -211,9 +210,7 @@
             Slog.d(TAG, "onTargetPackageRemoved packageName=" + packageName + " userId=" + userId);
         }
 
-        if (updateAllOverlaysForTarget(packageName, userId, null)) {
-            mListener.onOverlaysChanged(packageName, userId);
-        }
+        updateAllOverlaysForTarget(packageName, userId, null);
     }
 
     /**
diff --git a/services/core/java/com/android/server/pm/OtaDexoptService.java b/services/core/java/com/android/server/pm/OtaDexoptService.java
index da6e26e..6253857 100644
--- a/services/core/java/com/android/server/pm/OtaDexoptService.java
+++ b/services/core/java/com/android/server/pm/OtaDexoptService.java
@@ -53,7 +53,8 @@
     private final static boolean DEBUG_DEXOPT = true;
 
     // The synthetic library dependencies denoting "no checks."
-    private final static String[] NO_LIBRARIES = new String[] { "&" };
+    private final static String[] NO_LIBRARIES =
+            new String[] { PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK };
 
     // The amount of "available" (free - low threshold) space necessary at the start of an OTA to
     // not bulk-delete unused apps' odex files.
@@ -322,11 +323,6 @@
                 new DexoptOptions(pkg.packageName, compilationReason,
                         DexoptOptions.DEXOPT_BOOT_COMPLETE));
 
-        mPackageManagerService.getDexManager().dexoptSecondaryDex(
-                new DexoptOptions(pkg.packageName, compilationReason,
-                        DexoptOptions.DEXOPT_ONLY_SECONDARY_DEX |
-                        DexoptOptions.DEXOPT_BOOT_COMPLETE));
-
         return commands;
     }
 
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
index 698d387..0f580d8 100644
--- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java
+++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
@@ -147,8 +147,13 @@
         // Get the class loader context dependencies.
         // For each code path in the package, this array contains the class loader context that
         // needs to be passed to dexopt in order to ensure correct optimizations.
+        boolean[] pathsWithCode = new boolean[paths.size()];
+        pathsWithCode[0] = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_HAS_CODE) != 0;
+        for (int i = 1; i < paths.size(); i++) {
+            pathsWithCode[i] = (pkg.splitFlags[i - 1] & ApplicationInfo.FLAG_HAS_CODE) != 0;
+        }
         String[] classLoaderContexts = DexoptUtils.getClassLoaderContexts(
-                pkg.applicationInfo, sharedLibraries);
+                pkg.applicationInfo, sharedLibraries, pathsWithCode);
 
         // Sanity check that we do not call dexopt with inconsistent data.
         if (paths.size() != classLoaderContexts.length) {
@@ -164,10 +169,15 @@
         int result = DEX_OPT_SKIPPED;
         for (int i = 0; i < paths.size(); i++) {
             // Skip paths that have no code.
-            if ((i == 0 && (pkg.applicationInfo.flags & ApplicationInfo.FLAG_HAS_CODE) == 0) ||
-                    (i != 0 && (pkg.splitFlags[i - 1] & ApplicationInfo.FLAG_HAS_CODE) == 0)) {
+            if (!pathsWithCode[i]) {
                 continue;
             }
+            if (classLoaderContexts[i] == null) {
+                throw new IllegalStateException("Inconsistent information in the "
+                        + "package structure. A split is marked to contain code "
+                        + "but has no dependency listed. Index=" + i + " path=" + paths.get(i));
+            }
+
             // Append shared libraries with split dependencies for this split.
             String path = paths.get(i);
             if (options.getSplitName() != null) {
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java
index c3b93b4..1fa37b9 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -319,9 +319,15 @@
                 if (type == START_TAG) {
                     final String tag = in.getName();
                     if (PackageInstallerSession.TAG_SESSION.equals(tag)) {
-                        final PackageInstallerSession session = PackageInstallerSession.
-                                readFromXml(in, mInternalCallback, mContext, mPm,
-                                        mInstallThread.getLooper(), mSessionsDir);
+                        final PackageInstallerSession session;
+                        try {
+                            session = PackageInstallerSession.readFromXml(in, mInternalCallback,
+                                    mContext, mPm, mInstallThread.getLooper(), mSessionsDir);
+                        } catch (Exception e) {
+                            Slog.e(TAG, "Could not read session", e);
+                            continue;
+                        }
+
                         final long age = System.currentTimeMillis() - session.createdMillis;
 
                         final boolean valid;
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index 054ffd4..1fd5969 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -357,7 +357,17 @@
         }
 
         mPrepared = prepared;
-        mSealed = sealed;
+
+        if (sealed) {
+            synchronized (mLock) {
+                try {
+                    sealAndValidateLocked();
+                } catch (PackageManagerException | IOException e) {
+                    destroyInternal();
+                    throw new IllegalArgumentException(e);
+                }
+            }
+        }
 
         final long identity = Binder.clearCallingIdentity();
         try {
@@ -673,11 +683,6 @@
     public void commit(@NonNull IntentSender statusReceiver, boolean forTransfer) {
         Preconditions.checkNotNull(statusReceiver);
 
-        // Cache package manager data without the lock held
-        final PackageInfo installedPkgInfo = mPm.getPackageInfo(
-                params.appPackageName, PackageManager.GET_SIGNATURES
-                        | PackageManager.MATCH_STATIC_SHARED_LIBRARIES /*flags*/, userId);
-
         final boolean wasSealed;
         synchronized (mLock) {
             assertCallerIsOwnerOrRootLocked();
@@ -702,7 +707,9 @@
             wasSealed = mSealed;
             if (!mSealed) {
                 try {
-                    sealAndValidateLocked(installedPkgInfo);
+                    sealAndValidateLocked();
+                } catch (IOException e) {
+                    throw new IllegalArgumentException(e);
                 } catch (PackageManagerException e) {
                     // Do now throw an exception here to stay compatible with O and older
                     destroyInternal();
@@ -736,18 +743,33 @@
      *
      * <p>The session will be sealed after calling this method even if it failed.
      *
-     * @param pkgInfo The package info for {@link #params}.packagename
+     * @throws PackageManagerException if the session was sealed but something went wrong. If the
+     *                                 session was sealed this is the only possible exception.
      */
-    private void sealAndValidateLocked(@Nullable PackageInfo pkgInfo)
-            throws PackageManagerException {
+    private void sealAndValidateLocked() throws PackageManagerException, IOException {
         assertNoWriteFileTransfersOpenLocked();
+        assertPreparedAndNotDestroyedLocked("sealing of session");
+
+        final PackageInfo pkgInfo = mPm.getPackageInfo(
+                params.appPackageName, PackageManager.GET_SIGNATURES
+                        | PackageManager.MATCH_STATIC_SHARED_LIBRARIES /*flags*/, userId);
+
+        resolveStageDirLocked();
 
         mSealed = true;
 
         // Verify that stage looks sane with respect to existing application.
         // This currently only ensures packageName, versionCode, and certificate
         // consistency.
-        validateInstallLocked(pkgInfo);
+        try {
+            validateInstallLocked(pkgInfo);
+        } catch (PackageManagerException e) {
+            throw e;
+        } catch (Throwable e) {
+            // Convert all exceptions into package manager exceptions as only those are handled
+            // in the code above
+            throw new PackageManagerException(e);
+        }
 
         // Read transfers from the original owner stay open, but as the session's data
         // cannot be modified anymore, there is no leak of information.
@@ -768,11 +790,6 @@
                     + "the " + Manifest.permission.INSTALL_PACKAGES + " permission");
         }
 
-        // Cache package manager data without the lock held
-        final PackageInfo installedPkgInfo = mPm.getPackageInfo(
-                params.appPackageName, PackageManager.GET_SIGNATURES
-                        | PackageManager.MATCH_STATIC_SHARED_LIBRARIES /*flags*/, userId);
-
         // Only install flags that can be verified by the app the session is transferred to are
         // allowed. The parameters can be read via PackageInstaller.SessionInfo.
         if (!params.areHiddenOptionsSet()) {
@@ -784,8 +801,14 @@
             assertPreparedAndNotSealedLocked("transfer");
 
             try {
-                sealAndValidateLocked(installedPkgInfo);
+                sealAndValidateLocked();
+            } catch (IOException e) {
+                throw new IllegalStateException(e);
             } catch (PackageManagerException e) {
+                // Session is sealed but could not be verified, we need to destroy it
+                destroyInternal();
+                dispatchSessionFinished(e.error, ExceptionUtils.getCompleteMessage(e), null);
+
                 throw new IllegalArgumentException("Package is not valid", e);
             }
 
@@ -1545,6 +1568,10 @@
      */
     void write(@NonNull XmlSerializer out, @NonNull File sessionsDir) throws IOException {
         synchronized (mLock) {
+            if (mDestroyed) {
+                return;
+            }
+
             out.startTag(null, TAG_SESSION);
 
             writeIntAttribute(out, ATTR_SESSION_ID, sessionId);
diff --git a/services/core/java/com/android/server/pm/PackageManagerException.java b/services/core/java/com/android/server/pm/PackageManagerException.java
index 0e3f173..0793b09 100644
--- a/services/core/java/com/android/server/pm/PackageManagerException.java
+++ b/services/core/java/com/android/server/pm/PackageManagerException.java
@@ -40,6 +40,11 @@
         this.error = error;
     }
 
+    public PackageManagerException(Throwable e) {
+        super(e);
+        this.error = PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
+    }
+
     public static PackageManagerException from(PackageParserException e)
             throws PackageManagerException {
         throw new PackageManagerException(e.error, e.getMessage(), e.getCause());
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 79732c2..65678fc 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -2711,8 +2711,14 @@
                         // Actual deletion of code and data will be handled by later
                         // reconciliation step
                     } else {
-                        final PackageSetting disabledPs = mSettings.getDisabledSystemPkgLPr(ps.name);
-                        if (disabledPs.codePath == null || !disabledPs.codePath.exists()) {
+                        // we still have a disabled system package, but, it still might have
+                        // been removed. check the code path still exists and check there's
+                        // still a package. the latter can happen if an OTA keeps the same
+                        // code path, but, changes the package name.
+                        final PackageSetting disabledPs =
+                                mSettings.getDisabledSystemPkgLPr(ps.name);
+                        if (disabledPs.codePath == null || !disabledPs.codePath.exists()
+                                || disabledPs.pkg == null) {
                             possiblyDeletedUpdatedSystemApps.add(ps.name);
                         }
                     }
@@ -8512,7 +8518,7 @@
                         continue;
                     }
                     if (filterAppAccessLPr(ps, callingUid, userId)) {
-                        return null;
+                        continue;
                     }
                     final PackageInfo pi = generatePackageInfo(ps, flags, userId);
                     if (pi != null) {
@@ -8527,7 +8533,7 @@
                         continue;
                     }
                     if (filterAppAccessLPr(ps, callingUid, userId)) {
-                        return null;
+                        continue;
                     }
                     final PackageInfo pi = generatePackageInfo((PackageSetting)
                             p.mExtras, flags, userId);
@@ -8639,7 +8645,7 @@
                             continue;
                         }
                         if (filterAppAccessLPr(ps, callingUid, userId)) {
-                            return null;
+                            continue;
                         }
                         ai = PackageParser.generateApplicationInfo(ps.pkg, effectiveFlags,
                                 ps.readUserState(userId), userId);
@@ -8665,7 +8671,7 @@
                             continue;
                         }
                         if (filterAppAccessLPr(ps, callingUid, userId)) {
-                            return null;
+                            continue;
                         }
                         ApplicationInfo ai = PackageParser.generateApplicationInfo(p, flags,
                                 ps.readUserState(userId), userId);
@@ -11398,6 +11404,10 @@
                                     + " but expected at " + known.codePathString
                                     + "; ignoring.");
                         }
+                    } else {
+                        throw new PackageManagerException(INSTALL_FAILED_INVALID_INSTALL_LOCATION,
+                                "Application package " + pkg.packageName
+                                + " not found; ignoring.");
                     }
                 }
             }
@@ -22284,11 +22294,18 @@
             mDefaultPermissionPolicy.grantDefaultPermissions(userId);
         }
 
-        // If we did not grant default permissions, we preload from this the
-        // default permission exceptions lazily to ensure we don't hit the
-        // disk on a new user creation.
         if (grantPermissionsUserIds == EMPTY_INT_ARRAY) {
+            // If we did not grant default permissions, we preload from this the
+            // default permission exceptions lazily to ensure we don't hit the
+            // disk on a new user creation.
             mDefaultPermissionPolicy.scheduleReadDefaultPermissionExceptions();
+        } else {
+            // Since we granted default permissions above, we need an update
+            // pass to apply those changes.
+            synchronized (mPackages) {
+                updatePermissionsLPw(null, null, StorageManager.UUID_PRIVATE_INTERNAL,
+                        UPDATE_PERMISSIONS_ALL);
+            }
         }
 
         // Kick off any messages waiting for system ready
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index afa7a24..f2d527b 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -128,6 +128,7 @@
  *
  * Method naming convention:
  * <ul>
+ * <li> Methods suffixed with "LAr" should be called within the {@link #mAppRestrictionsLock} lock.
  * <li> Methods suffixed with "LP" should be called within the {@link #mPackagesLock} lock.
  * <li> Methods suffixed with "LR" should be called within the {@link #mRestrictionsLock} lock.
  * <li> Methods suffixed with "LU" should be called within the {@link #mUsersLock} lock.
@@ -232,6 +233,8 @@
     // Short-term lock for internal state, when interaction/sync with PM is not required
     private final Object mUsersLock = LockGuard.installNewLock(LockGuard.INDEX_USER);
     private final Object mRestrictionsLock = new Object();
+    // Used for serializing access to app restriction files
+    private final Object mAppRestrictionsLock = new Object();
 
     private final Handler mHandler;
 
@@ -2328,13 +2331,11 @@
     /**
      * Removes the app restrictions file for a specific package and user id, if it exists.
      */
-    private void cleanAppRestrictionsForPackage(String pkg, int userId) {
-        synchronized (mPackagesLock) {
-            File dir = Environment.getUserSystemDirectory(userId);
-            File resFile = new File(dir, packageToRestrictionsFileName(pkg));
-            if (resFile.exists()) {
-                resFile.delete();
-            }
+    private static void cleanAppRestrictionsForPackageLAr(String pkg, int userId) {
+        File dir = Environment.getUserSystemDirectory(userId);
+        File resFile = new File(dir, packageToRestrictionsFileName(pkg));
+        if (resFile.exists()) {
+            resFile.delete();
         }
     }
 
@@ -2847,9 +2848,9 @@
                 || !UserHandle.isSameApp(Binder.getCallingUid(), getUidForPackage(packageName))) {
             checkSystemOrRoot("get application restrictions for other user/app " + packageName);
         }
-        synchronized (mPackagesLock) {
+        synchronized (mAppRestrictionsLock) {
             // Read the restrictions from XML
-            return readApplicationRestrictionsLP(packageName, userId);
+            return readApplicationRestrictionsLAr(packageName, userId);
         }
     }
 
@@ -2860,12 +2861,12 @@
         if (restrictions != null) {
             restrictions.setDefusable(true);
         }
-        synchronized (mPackagesLock) {
+        synchronized (mAppRestrictionsLock) {
             if (restrictions == null || restrictions.isEmpty()) {
-                cleanAppRestrictionsForPackage(packageName, userId);
+                cleanAppRestrictionsForPackageLAr(packageName, userId);
             } else {
                 // Write the restrictions to XML
-                writeApplicationRestrictionsLP(packageName, restrictions, userId);
+                writeApplicationRestrictionsLAr(packageName, restrictions, userId);
             }
         }
 
@@ -2888,15 +2889,17 @@
         }
     }
 
-    private Bundle readApplicationRestrictionsLP(String packageName, int userId) {
+    @GuardedBy("mAppRestrictionsLock")
+    private static Bundle readApplicationRestrictionsLAr(String packageName, int userId) {
         AtomicFile restrictionsFile =
                 new AtomicFile(new File(Environment.getUserSystemDirectory(userId),
                         packageToRestrictionsFileName(packageName)));
-        return readApplicationRestrictionsLP(restrictionsFile);
+        return readApplicationRestrictionsLAr(restrictionsFile);
     }
 
     @VisibleForTesting
-    static Bundle readApplicationRestrictionsLP(AtomicFile restrictionsFile) {
+    @GuardedBy("mAppRestrictionsLock")
+    static Bundle readApplicationRestrictionsLAr(AtomicFile restrictionsFile) {
         final Bundle restrictions = new Bundle();
         final ArrayList<String> values = new ArrayList<>();
         if (!restrictionsFile.getBaseFile().exists()) {
@@ -2979,16 +2982,18 @@
         return childBundle;
     }
 
-    private void writeApplicationRestrictionsLP(String packageName,
+    @GuardedBy("mAppRestrictionsLock")
+    private static void writeApplicationRestrictionsLAr(String packageName,
             Bundle restrictions, int userId) {
         AtomicFile restrictionsFile = new AtomicFile(
                 new File(Environment.getUserSystemDirectory(userId),
                         packageToRestrictionsFileName(packageName)));
-        writeApplicationRestrictionsLP(restrictions, restrictionsFile);
+        writeApplicationRestrictionsLAr(restrictions, restrictionsFile);
     }
 
     @VisibleForTesting
-    static void writeApplicationRestrictionsLP(Bundle restrictions, AtomicFile restrictionsFile) {
+    @GuardedBy("mAppRestrictionsLock")
+    static void writeApplicationRestrictionsLAr(Bundle restrictions, AtomicFile restrictionsFile) {
         FileOutputStream fos = null;
         try {
             fos = restrictionsFile.startWrite();
@@ -3232,7 +3237,7 @@
         return -1;
     }
 
-    private String packageToRestrictionsFileName(String packageName) {
+    private static String packageToRestrictionsFileName(String packageName) {
         return RESTRICTIONS_FILE_PREFIX + packageName + XML_SUFFIX;
     }
 
diff --git a/services/core/java/com/android/server/pm/dex/DexoptUtils.java b/services/core/java/com/android/server/pm/dex/DexoptUtils.java
index 0196212..e1310a2 100644
--- a/services/core/java/com/android/server/pm/dex/DexoptUtils.java
+++ b/services/core/java/com/android/server/pm/dex/DexoptUtils.java
@@ -21,6 +21,7 @@
 import android.util.SparseArray;
 
 import com.android.internal.os.ClassLoaderFactory;
+import com.android.server.pm.PackageDexOptimizer;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -35,7 +36,9 @@
     /**
      * Creates the class loader context dependencies for each of the application code paths.
      * The returned array contains the class loader contexts that needs to be passed to dexopt in
-     * order to ensure correct optimizations.
+     * order to ensure correct optimizations. "Code" paths with no actual code, as specified by
+     * {@param pathsWithCode}, are ignored and will have null as their context in the returned array
+     * (configuration splits are an example of paths without code).
      *
      * A class loader context describes how the class loader chain should be built by dex2oat
      * in order to ensure that classes are resolved during compilation as they would be resolved
@@ -60,7 +63,8 @@
      * {@link android.app.LoadedApk#makePaths(
      * android.app.ActivityThread, boolean, ApplicationInfo, List, List)}.
      */
-    public static String[] getClassLoaderContexts(ApplicationInfo info, String[] sharedLibraries) {
+    public static String[] getClassLoaderContexts(ApplicationInfo info,
+            String[] sharedLibraries, boolean[] pathsWithCode) {
         // The base class loader context contains only the shared library.
         String sharedLibrariesClassPath = encodeClasspath(sharedLibraries);
         String baseApkContextClassLoader = encodeClassLoader(
@@ -86,7 +90,7 @@
         // Index 0 is the class loaded context for the base apk.
         // Index `i` is the class loader context encoding for split `i`.
         String[] classLoaderContexts = new String[/*base apk*/ 1 + splitRelativeCodePaths.length];
-        classLoaderContexts[0] = baseApkContextClassLoader;
+        classLoaderContexts[0] = pathsWithCode[0] ? baseApkContextClassLoader : null;
 
         if (!info.requestsIsolatedSplitLoading() || info.splitDependencies == null) {
             // If the app didn't request for the splits to be loaded in isolation or if it does not
@@ -94,7 +98,15 @@
             // apk class loader (in the order of their definition).
             String classpath = sharedLibrariesAndBaseClassPath;
             for (int i = 1; i < classLoaderContexts.length; i++) {
-                classLoaderContexts[i] = encodeClassLoader(classpath, info.classLoaderName);
+                classLoaderContexts[i] = pathsWithCode[i]
+                        ? encodeClassLoader(classpath, info.classLoaderName) : null;
+                // Note that the splits with no code are not removed from the classpath computation.
+                // i.e. split_n might get the split_n-1 in its classpath dependency even
+                // if split_n-1 has no code.
+                // The splits with no code do not matter for the runtime which ignores
+                // apks without code when doing the classpath checks. As such we could actually
+                // filter them but we don't do it in order to keep consistency with how the apps
+                // are loaded.
                 classpath = encodeClasspath(classpath, splitRelativeCodePaths[i - 1]);
             }
         } else {
@@ -116,9 +128,17 @@
             String splitDependencyOnBase = encodeClassLoader(
                     sharedLibrariesAndBaseClassPath, info.classLoaderName);
             SparseArray<int[]> splitDependencies = info.splitDependencies;
+
+            // Note that not all splits have dependencies (e.g. configuration splits)
+            // The splits without dependencies will have classLoaderContexts[config_split_index]
+            // set to null after this step.
             for (int i = 1; i < splitDependencies.size(); i++) {
-                getParentDependencies(splitDependencies.keyAt(i), splitClassLoaderEncodingCache,
-                        splitDependencies, classLoaderContexts, splitDependencyOnBase);
+                int splitIndex = splitDependencies.keyAt(i);
+                if (pathsWithCode[splitIndex]) {
+                    // Compute the class loader context only for the splits with code.
+                    getParentDependencies(splitIndex, splitClassLoaderEncodingCache,
+                            splitDependencies, classLoaderContexts, splitDependencyOnBase);
+                }
             }
 
             // At this point classLoaderContexts contains only the parent dependencies.
@@ -126,8 +146,17 @@
             // come first in the context.
             for (int i = 1; i < classLoaderContexts.length; i++) {
                 String splitClassLoader = encodeClassLoader("", info.splitClassLoaderNames[i - 1]);
-                classLoaderContexts[i] = encodeClassLoaderChain(
-                        splitClassLoader, classLoaderContexts[i]);
+                if (pathsWithCode[i]) {
+                    // If classLoaderContexts[i] is null it means that the split does not have
+                    // any dependency. In this case its context equals its declared class loader.
+                    classLoaderContexts[i] = classLoaderContexts[i] == null
+                            ? splitClassLoader
+                            : encodeClassLoaderChain(splitClassLoader, classLoaderContexts[i]);
+                } else {
+                    // This is a split without code, it has no dependency and it is not compiled.
+                    // Its context will be null.
+                    classLoaderContexts[i] = null;
+                }
             }
         }
 
@@ -210,10 +239,15 @@
     /**
      * Encodes a single class loader dependency starting from {@param path} and
      * {@param classLoaderName}.
+     * When classpath is {@link PackageDexOptimizer#SKIP_SHARED_LIBRARY_CHECK}, the method returns
+     * the same. This special property is used only during OTA.
      * NOTE: Keep this in sync with the dexopt expectations! Right now that is either "PCL[path]"
      * for a PathClassLoader or "DLC[path]" for a DelegateLastClassLoader.
      */
-    private static String encodeClassLoader(String classpath, String classLoaderName) {
+    /*package*/ static String encodeClassLoader(String classpath, String classLoaderName) {
+        if (classpath.equals(PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK)) {
+            return classpath;
+        }
         String classLoaderDexoptEncoding = classLoaderName;
         if (ClassLoaderFactory.isPathClassLoaderName(classLoaderName)) {
             classLoaderDexoptEncoding = "PCL";
@@ -227,10 +261,17 @@
 
     /**
      * Links to dependencies together in a format accepted by dexopt.
+     * For the special case when either of cl1 or cl2 equals
+     * {@link PackageDexOptimizer#SKIP_SHARED_LIBRARY_CHECK}, the method returns the same. This
+     * property is used only during OTA.
      * NOTE: Keep this in sync with the dexopt expectations! Right now that is a list of split
      * dependencies {@see encodeClassLoader} separated by ';'.
      */
-    private static String encodeClassLoaderChain(String cl1, String cl2) {
+    /*package*/ static String encodeClassLoaderChain(String cl1, String cl2) {
+        if (cl1.equals(PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK) ||
+                cl2.equals(PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK)) {
+            return PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK;
+        }
         if (cl1.isEmpty()) return cl2;
         if (cl2.isEmpty()) return cl1;
         return cl1 + ";" + cl2;
diff --git a/services/core/java/com/android/server/policy/LegacyGlobalActions.java b/services/core/java/com/android/server/policy/LegacyGlobalActions.java
index 14fabc5..8eb6d06 100644
--- a/services/core/java/com/android/server/policy/LegacyGlobalActions.java
+++ b/services/core/java/com/android/server/policy/LegacyGlobalActions.java
@@ -202,11 +202,14 @@
                 && !(mAdapter.getItem(0) instanceof LongPressAction)) {
             ((SinglePressAction) mAdapter.getItem(0)).onPress();
         } else {
-            WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes();
-            attrs.setTitle("LegacyGlobalActions");
-            mDialog.getWindow().setAttributes(attrs);
-            mDialog.show();
-            mDialog.getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_DISABLE_EXPAND);
+            if (mDialog != null) {
+                WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes();
+                attrs.setTitle("LegacyGlobalActions");
+                mDialog.getWindow().setAttributes(attrs);
+                mDialog.show();
+                mDialog.getWindow().getDecorView().setSystemUiVisibility(
+                        View.STATUS_BAR_DISABLE_EXPAND);
+            }
         }
     }
 
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 68913c3..a806af4 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -338,6 +338,7 @@
     static public final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps";
     static public final String SYSTEM_DIALOG_REASON_HOME_KEY = "homekey";
     static public final String SYSTEM_DIALOG_REASON_ASSIST = "assist";
+    static public final String SYSTEM_DIALOG_REASON_SCREENSHOT = "screenshot";
 
     /**
      * These are the system UI flags that, when changing, can cause the layout
@@ -832,6 +833,7 @@
     private static final int MSG_ACCESSIBILITY_TV = 23;
     private static final int MSG_DISPATCH_BACK_KEY_TO_AUTOFILL = 24;
     private static final int MSG_SYSTEM_KEY_PRESS = 25;
+    private static final int MSG_HANDLE_ALL_APPS = 26;
 
     private static final int MSG_REQUEST_TRANSIENT_BARS_ARG_STATUS = 0;
     private static final int MSG_REQUEST_TRANSIENT_BARS_ARG_NAVIGATION = 1;
@@ -924,6 +926,9 @@
                 case MSG_SYSTEM_KEY_PRESS:
                     sendSystemKeyToStatusBar(msg.arg1);
                     break;
+                case MSG_HANDLE_ALL_APPS:
+                    launchAllAppsAction();
+                    break;
             }
         }
     }
@@ -1804,6 +1809,17 @@
 
     private void launchAllAppsAction() {
         Intent intent = new Intent(Intent.ACTION_ALL_APPS);
+        if (mHasFeatureLeanback) {
+            final PackageManager pm = mContext.getPackageManager();
+            Intent intentLauncher = new Intent(Intent.ACTION_MAIN);
+            intentLauncher.addCategory(Intent.CATEGORY_HOME);
+            ResolveInfo resolveInfo = pm.resolveActivityAsUser(intentLauncher,
+                    PackageManager.MATCH_SYSTEM_ONLY,
+                    mCurrentUserId);
+            if (resolveInfo != null) {
+                intent.setPackage(resolveInfo.activityInfo.packageName);
+            }
+        }
         startActivityAsUser(intent, UserHandle.CURRENT);
     }
 
@@ -3623,6 +3639,14 @@
             return -1;
         } else if (mHasFeatureLeanback && interceptAccessibilityGestureTv(keyCode, down)) {
             return -1;
+        } else if (keyCode == KeyEvent.KEYCODE_ALL_APPS) {
+            if (!down) {
+                mHandler.removeMessages(MSG_HANDLE_ALL_APPS);
+                Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS);
+                msg.setAsynchronous(true);
+                msg.sendToTarget();
+            }
+            return -1;
         }
 
         // Toggle Caps Lock on META-ALT.
diff --git a/services/core/java/com/android/server/search/SearchManagerService.java b/services/core/java/com/android/server/search/SearchManagerService.java
index 8969771..c3fa823 100644
--- a/services/core/java/com/android/server/search/SearchManagerService.java
+++ b/services/core/java/com/android/server/search/SearchManagerService.java
@@ -17,7 +17,6 @@
 package com.android.server.search;
 
 import android.app.ActivityManager;
-import android.app.AppGlobals;
 import android.app.IActivityManager;
 import android.app.ISearchManager;
 import android.app.SearchManager;
@@ -26,7 +25,6 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
-import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.database.ContentObserver;
@@ -37,6 +35,7 @@
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings;
+import android.service.voice.VoiceInteractionService;
 import android.util.Log;
 import android.util.SparseArray;
 
@@ -272,24 +271,25 @@
         }
     }
 
+    // Check and return VIS component
     private ComponentName getLegacyAssistComponent(int userHandle) {
         try {
             userHandle = ActivityManager.handleIncomingUser(Binder.getCallingPid(),
-                    Binder.getCallingUid(), userHandle, true, false, "getLegacyAssistComponent", null);
-            IPackageManager pm = AppGlobals.getPackageManager();
-            Intent assistIntent = new Intent(Intent.ACTION_ASSIST);
-            ResolveInfo info =
-                    pm.resolveIntent(assistIntent,
-                            assistIntent.resolveTypeIfNeeded(mContext.getContentResolver()),
-                            PackageManager.MATCH_DEFAULT_ONLY, userHandle);
-            if (info != null) {
+                    Binder.getCallingUid(), userHandle, true, false, "getLegacyAssistComponent",
+                    null);
+            PackageManager pm = mContext.getPackageManager();
+            Intent intentAssistProbe = new Intent(VoiceInteractionService.SERVICE_INTERFACE);
+            List<ResolveInfo> infoListVis = pm.queryIntentServicesAsUser(intentAssistProbe,
+                    PackageManager.MATCH_SYSTEM_ONLY, userHandle);
+            if (infoListVis == null || infoListVis.isEmpty()) {
+                return null;
+            } else {
+                ResolveInfo rInfo = infoListVis.get(0);
                 return new ComponentName(
-                        info.activityInfo.applicationInfo.packageName,
-                        info.activityInfo.name);
+                        rInfo.serviceInfo.applicationInfo.packageName,
+                        rInfo.serviceInfo.name);
+
             }
-        } catch (RemoteException re) {
-            // Local call
-            Log.e(TAG, "RemoteException in getLegacyAssistComponent: " + re);
         } catch (Exception e) {
             Log.e(TAG, "Exception in getLegacyAssistComponent: " + e);
         }
@@ -304,9 +304,15 @@
         }
         long ident = Binder.clearCallingIdentity();
         try {
-            Intent intent = new Intent(Intent.ACTION_ASSIST);
+            Intent intent = new Intent(VoiceInteractionService.SERVICE_INTERFACE);
             intent.setComponent(comp);
+
             IActivityManager am = ActivityManager.getService();
+            if (args != null) {
+                args.putInt(Intent.EXTRA_KEY_EVENT, android.view.KeyEvent.KEYCODE_ASSIST);
+            }
+            intent.putExtras(args);
+
             return am.launchAssistIntent(intent, ActivityManager.ASSIST_CONTEXT_BASIC, hint,
                     userHandle, args);
         } catch (RemoteException e) {
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 34ac645..38dc33f 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -20,7 +20,6 @@
 import android.app.StatusBarManager;
 import android.content.ComponentName;
 import android.content.Context;
-import android.content.pm.PackageManager;
 import android.graphics.Rect;
 import android.os.Binder;
 import android.os.Bundle;
@@ -957,6 +956,10 @@
                 this, in, out, err, args, callback, resultReceiver);
     }
 
+    public String[] getStatusBarIcons() {
+        return mContext.getResources().getStringArray(R.array.config_statusBarIcons);
+    }
+
     // ================================================================================
     // Can be called from any thread
     // ================================================================================
diff --git a/services/core/java/com/android/server/statusbar/StatusBarShellCommand.java b/services/core/java/com/android/server/statusbar/StatusBarShellCommand.java
index 40bb496..4e20f01 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarShellCommand.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarShellCommand.java
@@ -25,7 +25,7 @@
 
 public class StatusBarShellCommand extends ShellCommand {
 
-    private final IStatusBarService mInterface;
+    private final StatusBarManagerService mInterface;
 
     public StatusBarShellCommand(StatusBarManagerService service) {
         mInterface = service;
@@ -54,6 +54,8 @@
                     final PrintWriter pw = getOutPrintWriter();
                     pw.println(String.valueOf(TileService.isQuickSettingsSupported()));
                     return 0;
+                case "get-status-icons":
+                    return runGetStatusIcons();
                 default:
                     return handleDefaultCommands(cmd);
             }
@@ -94,6 +96,14 @@
         return 0;
     }
 
+    private int runGetStatusIcons() {
+        final PrintWriter pw = getOutPrintWriter();
+        for (String icon : mInterface.getStatusBarIcons()) {
+            pw.println(icon);
+        }
+        return 0;
+    }
+
     @Override
     public void onHelp() {
         final PrintWriter pw = getOutPrintWriter();
@@ -122,5 +132,8 @@
         pw.println("  check-support");
         pw.println("    Check if this device supports QS + APIs");
         pw.println("");
+        pw.println("  get-status-icons");
+        pw.println("    Print the list of status bar icons and the order they appear in");
+        pw.println("");
     }
 }
diff --git a/services/core/java/com/android/server/webkit/WebViewUpdater.java b/services/core/java/com/android/server/webkit/WebViewUpdater.java
index 203bbf6..7fc907f 100644
--- a/services/core/java/com/android/server/webkit/WebViewUpdater.java
+++ b/services/core/java/com/android/server/webkit/WebViewUpdater.java
@@ -569,6 +569,7 @@
             PackageInfo systemUserPackageInfo =
                     userPackages.get(UserHandle.USER_SYSTEM).getPackageInfo();
             if (systemUserPackageInfo == null) {
+                pw.println(String.format("    %s is NOT installed.", provider.packageName));
                 continue;
             }
 
diff --git a/services/core/java/com/android/server/wm/ConfigurationContainer.java b/services/core/java/com/android/server/wm/ConfigurationContainer.java
index cbf4fc0..28ba9b3 100644
--- a/services/core/java/com/android/server/wm/ConfigurationContainer.java
+++ b/services/core/java/com/android/server/wm/ConfigurationContainer.java
@@ -21,6 +21,8 @@
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
 import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
+import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
+import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
 import static android.app.WindowConfiguration.activityTypeToString;
 
 import android.app.WindowConfiguration;
@@ -145,6 +147,33 @@
         onOverrideConfigurationChanged(mTmpConfig);
     }
 
+    /** Returns true if this container is currently in split-screen windowing mode. */
+    public boolean inSplitScreenWindowingMode() {
+        /*@WindowConfiguration.WindowingMode*/ int windowingMode =
+                mFullConfiguration.windowConfiguration.getWindowingMode();
+
+        return windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
+                || windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
+    }
+
+    /** Returns true if this container is currently in split-screen secondary windowing mode. */
+    public boolean inSplitScreenSecondaryWindowingMode() {
+        /*@WindowConfiguration.WindowingMode*/ int windowingMode =
+                mFullConfiguration.windowConfiguration.getWindowingMode();
+
+        return windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
+    }
+
+    /**
+     * Returns true if this container can be put in either
+     * {@link WindowConfiguration#WINDOWING_MODE_SPLIT_SCREEN_PRIMARY} or
+     * {@link WindowConfiguration##WINDOWING_MODE_SPLIT_SCREEN_SECONDARY} windowing modes based on
+     * its current state.
+     */
+    public boolean supportSplitScreenWindowingMode() {
+        return mFullConfiguration.windowConfiguration.supportSplitScreenWindowingMode();
+    }
+
     /** Returns the activity type associated with the the configuration container. */
     /*@WindowConfiguration.ActivityType*/
     public int getActivityType() {
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index d74e482..f0b9f17 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -1915,9 +1915,13 @@
             super.removeImmediately();
             if (DEBUG_DISPLAY) Slog.v(TAG_WM, "Removing display=" + this);
             mDimLayerController.close();
-            if (mDisplayId == DEFAULT_DISPLAY && mService.canDispatchPointerEvents()) {
-                mService.unregisterPointerEventListener(mTapDetector);
-                mService.unregisterPointerEventListener(mService.mMousePositionTracker);
+            if (mService.canDispatchPointerEvents()) {
+                if (mTapDetector != null) {
+                    mService.unregisterPointerEventListener(mTapDetector);
+                }
+                if (mDisplayId == DEFAULT_DISPLAY && mService.mMousePositionTracker != null) {
+                    mService.unregisterPointerEventListener(mService.mMousePositionTracker);
+                }
             }
         } finally {
             mRemovingDisplay = false;
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 54dd199..8a74976 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -249,13 +249,8 @@
 
             // Tap Listeners are supported for:
             // 1. All physical displays (multi-display).
-            // 2. VirtualDisplays that support virtual touch input. (Only VR for now)
-            // TODO(multi-display): Support VirtualDisplays with no virtual touch input.
-            if ((display.getType() != Display.TYPE_VIRTUAL
-                    || (display.getType() == Display.TYPE_VIRTUAL
-                        // Only VR VirtualDisplays
-                        && displayId == mService.mVr2dDisplayId))
-                    && mService.canDispatchPointerEvents()) {
+            // 2. VirtualDisplays on VR, AA (and everything else).
+            if (mService.canDispatchPointerEvents()) {
                 if (DEBUG_DISPLAY) {
                     Slog.d(TAG,
                             "Registering PointerEventListener for DisplayId: " + displayId);
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index e9f8457..55b6c91 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -421,9 +421,9 @@
 
     /** Return true if the current bound can get outputted to the rest of the system as-is. */
     private boolean useCurrentBounds() {
-        final DisplayContent displayContent = mStack.getDisplayContent();
+        final DisplayContent displayContent = getDisplayContent();
         return mFillsParent
-                || !StackId.isTaskResizeableByDockedStack(mStack.mStackId)
+                || !inSplitScreenSecondaryWindowingMode()
                 || displayContent == null
                 || displayContent.getDockedStackIgnoringVisibility() != null;
     }
diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java
index 6ec7565..4664dcb 100644
--- a/services/core/java/com/android/server/wm/TaskStack.java
+++ b/services/core/java/com/android/server/wm/TaskStack.java
@@ -289,7 +289,7 @@
     /** Return true if the current bound can get outputted to the rest of the system as-is. */
     private boolean useCurrentBounds() {
         if (mFillsParent
-                || !StackId.isResizeableByDockedStack(mStackId)
+                || !inSplitScreenSecondaryWindowingMode()
                 || mDisplayContent == null
                 || mDisplayContent.getDockedStackLocked() != null) {
             return true;
@@ -684,7 +684,7 @@
         Rect bounds = null;
         final TaskStack dockedStack = dc.getDockedStackIgnoringVisibility();
         if (mStackId == DOCKED_STACK_ID
-                || (dockedStack != null && StackId.isResizeableByDockedStack(mStackId)
+                || (dockedStack != null && inSplitScreenSecondaryWindowingMode()
                         && !dockedStack.fillsParent())) {
             // The existence of a docked stack affects the size of other static stack created since
             // the docked stack occupies a dedicated region on screen, but only if the dock stack is
@@ -756,8 +756,7 @@
             return;
         }
 
-        if ((mStackId != DOCKED_STACK_ID && !StackId.isResizeableByDockedStack(mStackId))
-                || mDisplayContent == null) {
+        if (!inSplitScreenWindowingMode() || mDisplayContent == null) {
             outStackBounds.set(mBounds);
             return;
         }
@@ -1324,8 +1323,8 @@
         return getDockSide(mBounds);
     }
 
-    int getDockSide(Rect bounds) {
-        if (mStackId != DOCKED_STACK_ID && !StackId.isResizeableByDockedStack(mStackId)) {
+    private int getDockSide(Rect bounds) {
+        if (!inSplitScreenWindowingMode()) {
             return DOCKED_INVALID;
         }
         if (mDisplayContent == null) {
diff --git a/services/core/java/com/android/server/wm/WindowLayersController.java b/services/core/java/com/android/server/wm/WindowLayersController.java
index 5d1083e..857b13d 100644
--- a/services/core/java/com/android/server/wm/WindowLayersController.java
+++ b/services/core/java/com/android/server/wm/WindowLayersController.java
@@ -101,7 +101,7 @@
             mHighestLayerInImeTargetBaseLayer = Math.max(mHighestLayerInImeTargetBaseLayer,
                     w.mWinAnimator.mAnimLayer);
         }
-        if (w.getAppToken() != null && StackId.isResizeableByDockedStack(w.getStackId())) {
+        if (w.getAppToken() != null && w.inSplitScreenSecondaryWindowingMode()) {
             mHighestDockedAffectedLayer = Math.max(mHighestDockedAffectedLayer,
                     w.mWinAnimator.mAnimLayer);
         }
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index e8e40a7..1b05566 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -1475,7 +1475,7 @@
     // TODO: Another visibility method that was added late in the release to minimize risk.
     @Override
     public boolean canAffectSystemUiFlags() {
-        final boolean shown = mWinAnimator.getShown() && mWinAnimator.mShownAlpha > 0f;
+        final boolean shown = mWinAnimator.getShown();
 
         // We only consider the app to be exiting when the animation has started. After the app
         // transition is executed the windows are marked exiting before the new windows have been
@@ -1489,7 +1489,12 @@
 
         final boolean exiting = exitingSelf || mDestroying || appExiting;
         final boolean translucent = mAttrs.alpha == 0.0f;
-        return shown && !exiting && !translucent;
+
+        // If we are entering with a dummy animation, avoid affecting SystemUI flags until the
+        // transition is starting.
+        final boolean enteringWithDummyAnimation =
+                mWinAnimator.isDummyAnimation() && mWinAnimator.mShownAlpha == 0f;
+        return shown && !exiting && !translucent && !enteringWithDummyAnimation;
     }
 
     /**
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index ddb8df2..1b7e527 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -1652,7 +1652,14 @@
                     if (mWin.mAppToken != null) {
                         mWin.mAppToken.setCanTurnScreenOn(false);
                     }
-                    mAnimator.mBulkUpdateParams |= SET_TURN_ON_SCREEN;
+
+                    // We do not add {@code SET_TURN_ON_SCREEN} when the screen is already
+                    // interactive as the value may persist until the next animation, which could
+                    // potentially occurring while turning off the screen. This would lead to the
+                    // screen incorrectly turning back on.
+                    if (!mService.mPowerManager.isInteractive()) {
+                        mAnimator.mBulkUpdateParams |= SET_TURN_ON_SCREEN;
+                    }
                 }
             }
             if (hasSurface()) {
diff --git a/services/core/jni/BroadcastRadio/NativeCallbackThread.cpp b/services/core/jni/BroadcastRadio/NativeCallbackThread.cpp
index 85ec9e0..81d46f3 100644
--- a/services/core/jni/BroadcastRadio/NativeCallbackThread.cpp
+++ b/services/core/jni/BroadcastRadio/NativeCallbackThread.cpp
@@ -48,15 +48,19 @@
         return;
     }
 
-    while (!mExiting) {
-        ALOGV("Waiting for task...");
+    while (true) {
         Task task;
         {
             unique_lock<mutex> lk(mQueueMutex);
-            mQueueCond.wait(lk);
-            if (mExiting) break;
 
-            if (mQueue.empty()) continue;
+            if (mExiting) break;
+            if (mQueue.empty()) {
+                ALOGV("Waiting for task...");
+                mQueueCond.wait(lk);
+                if (mExiting) break;
+                if (mQueue.empty()) continue;
+            }
+
             task = mQueue.front();
             mQueue.pop();
         }
@@ -74,6 +78,7 @@
     ALOGE_IF(res != JNI_OK, "Couldn't detach thread");
 
     ALOGV("Native callback thread %p finished", this);
+    ALOGD_IF(!mQueue.empty(), "Skipped execution of %zu tasks", mQueue.size());
 }
 
 void NativeCallbackThread::enqueue(const Task &task) {
@@ -84,6 +89,7 @@
         return;
     }
 
+    ALOGV("Adding task to the queue...");
     mQueue.push(task);
     mQueueCond.notify_one();
 }
diff --git a/services/core/jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp b/services/core/jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp
index f9cbd16..9a17635 100644
--- a/services/core/jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp
+++ b/services/core/jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp
@@ -113,7 +113,7 @@
     hidl_handle h1(handleFromFileDescriptor(std::move(fd1))),
                 h2(handleFromFileDescriptor(std::move(fd2)));
 
-    bool rval;
+    bool rval(false);
     hidl_string msg;
     const auto status = configInterface->setHandles(h1, h2,
             [&rval, &msg](bool success, const hidl_string& errMsg) {
@@ -123,6 +123,8 @@
     if (!status.isOk() || !rval) {
         ALOGE("IOffloadConfig::setHandles() error: '%s' / '%s'",
               status.description().c_str(), msg.c_str());
+        // If status is somehow not ok, make sure rval captures this too.
+        rval = false;
     }
 
     return rval;
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 8752932..6c859f7 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -4130,6 +4130,16 @@
 
     private boolean isActivePasswordSufficientForUserLocked(
             DevicePolicyData policy, int userHandle, boolean parent) {
+        final int requiredPasswordQuality = getPasswordQuality(null, userHandle, parent);
+        if (requiredPasswordQuality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
+            // A special case is when there is no required password quality, then we just return
+            // true since any password would be sufficient. This is for the scenario when a work
+            // profile is first created so there is no information about the current password but
+            // it should be considered sufficient as there is no password requirement either.
+            // This is useful since it short-circuits the password checkpoint for FDE device below.
+            return true;
+        }
+
         if (!mInjector.storageManagerIsFileBasedEncryptionEnabled()
                 && !policy.mPasswordStateHasBeenSetSinceBoot) {
             // Before user enters their password for the first time after a reboot, return the
@@ -4140,7 +4150,6 @@
             return policy.mPasswordValidAtLastCheckpoint;
         }
 
-        final int requiredPasswordQuality = getPasswordQuality(null, userHandle, parent);
         if (policy.mActivePasswordMetrics.quality < requiredPasswordQuality) {
             return false;
         }
diff --git a/services/net/java/android/net/ip/IpReachabilityMonitor.java b/services/net/java/android/net/ip/IpReachabilityMonitor.java
index e833f6a..714b35a 100644
--- a/services/net/java/android/net/ip/IpReachabilityMonitor.java
+++ b/services/net/java/android/net/ip/IpReachabilityMonitor.java
@@ -205,44 +205,14 @@
         final byte[] msg = RtNetlinkNeighborMessage.newNewNeighborMessage(
                 1, ip, StructNdMsg.NUD_PROBE, ifIndex, null);
 
-        int errno = -OsConstants.EPROTO;
-        try (NetlinkSocket nlSocket = new NetlinkSocket(OsConstants.NETLINK_ROUTE)) {
-            final long IO_TIMEOUT = 300L;
-            nlSocket.connectToKernel();
-            nlSocket.sendMessage(msg, 0, msg.length, IO_TIMEOUT);
-            final ByteBuffer bytes = nlSocket.recvMessage(IO_TIMEOUT);
-            // recvMessage() guaranteed to not return null if it did not throw.
-            final NetlinkMessage response = NetlinkMessage.parse(bytes);
-            if (response != null && response instanceof NetlinkErrorMessage &&
-                    (((NetlinkErrorMessage) response).getNlMsgError() != null)) {
-                errno = ((NetlinkErrorMessage) response).getNlMsgError().error;
-                if (errno != 0) {
-                    // TODO: consider ignoring EINVAL (-22), which appears to be
-                    // normal when probing a neighbor for which the kernel does
-                    // not already have / no longer has a link layer address.
-                    Log.e(TAG, "Error " + msgSnippet + ", errmsg=" + response.toString());
-                }
-            } else {
-                String errmsg;
-                if (response == null) {
-                    bytes.position(0);
-                    errmsg = "raw bytes: " + NetlinkConstants.hexify(bytes);
-                } else {
-                    errmsg = response.toString();
-                }
-                Log.e(TAG, "Error " + msgSnippet + ", errmsg=" + errmsg);
-            }
+        try {
+            NetlinkSocket.sendOneShotKernelMessage(OsConstants.NETLINK_ROUTE, msg);
         } catch (ErrnoException e) {
-            Log.e(TAG, "Error " + msgSnippet, e);
-            errno = -e.errno;
-        } catch (InterruptedIOException e) {
-            Log.e(TAG, "Error " + msgSnippet, e);
-            errno = -OsConstants.ETIMEDOUT;
-        } catch (SocketException e) {
-            Log.e(TAG, "Error " + msgSnippet, e);
-            errno = -OsConstants.EIO;
+            Log.e(TAG, "Error " + msgSnippet + ": " + e);
+            return -e.errno;
         }
-        return errno;
+
+        return 0;
     }
 
     public IpReachabilityMonitor(Context context, String ifName, SharedLog log, Callback callback) {
diff --git a/services/net/java/android/net/netlink/ConntrackMessage.java b/services/net/java/android/net/netlink/ConntrackMessage.java
new file mode 100644
index 0000000..605c46b
--- /dev/null
+++ b/services/net/java/android/net/netlink/ConntrackMessage.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.netlink;
+
+import static android.net.netlink.NetlinkConstants.alignedLengthOf;
+import static android.net.netlink.StructNlAttr.makeNestedType;
+import static android.net.netlink.StructNlAttr.NLA_HEADERLEN;
+import static android.net.netlink.StructNlMsgHdr.NLM_F_ACK;
+import static android.net.netlink.StructNlMsgHdr.NLM_F_DUMP;
+import static android.net.netlink.StructNlMsgHdr.NLM_F_REPLACE;
+import static android.net.netlink.StructNlMsgHdr.NLM_F_REQUEST;
+import static android.net.util.NetworkConstants.IPV4_ADDR_LEN;
+import static java.nio.ByteOrder.BIG_ENDIAN;
+
+import android.system.OsConstants;
+import android.util.Log;
+import libcore.io.SizeOf;
+
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+
+/**
+ * A NetlinkMessage subclass for netlink conntrack messages.
+ *
+ * see also: &lt;linux_src&gt;/include/uapi/linux/netfilter/nfnetlink_conntrack.h
+ *
+ * @hide
+ */
+public class ConntrackMessage extends NetlinkMessage {
+    public static final int STRUCT_SIZE = StructNlMsgHdr.STRUCT_SIZE + StructNfGenMsg.STRUCT_SIZE;
+
+    public static final short NFNL_SUBSYS_CTNETLINK = 1;
+    public static final short IPCTNL_MSG_CT_NEW = 0;
+
+    // enum ctattr_type
+    public static final short CTA_TUPLE_ORIG  = 1;
+    public static final short CTA_TUPLE_REPLY = 2;
+    public static final short CTA_TIMEOUT     = 7;
+
+    // enum ctattr_tuple
+    public static final short CTA_TUPLE_IP    = 1;
+    public static final short CTA_TUPLE_PROTO = 2;
+
+    // enum ctattr_ip
+    public static final short CTA_IP_V4_SRC = 1;
+    public static final short CTA_IP_V4_DST = 2;
+
+    // enum ctattr_l4proto
+    public static final short CTA_PROTO_NUM      = 1;
+    public static final short CTA_PROTO_SRC_PORT = 2;
+    public static final short CTA_PROTO_DST_PORT = 3;
+
+    public static byte[] newIPv4TimeoutUpdateRequest(
+            int proto, Inet4Address src, int sport, Inet4Address dst, int dport, int timeoutSec) {
+        // *** STYLE WARNING ***
+        //
+        // Code below this point uses extra block indentation to highlight the
+        // packing of nested tuple netlink attribute types.
+        final StructNlAttr ctaTupleOrig = new StructNlAttr(CTA_TUPLE_ORIG,
+                new StructNlAttr(CTA_TUPLE_IP,
+                        new StructNlAttr(CTA_IP_V4_SRC, src),
+                        new StructNlAttr(CTA_IP_V4_DST, dst)),
+                new StructNlAttr(CTA_TUPLE_PROTO,
+                        new StructNlAttr(CTA_PROTO_NUM, (byte) proto),
+                        new StructNlAttr(CTA_PROTO_SRC_PORT, (short) sport, BIG_ENDIAN),
+                        new StructNlAttr(CTA_PROTO_DST_PORT, (short) dport, BIG_ENDIAN)));
+
+        final StructNlAttr ctaTimeout = new StructNlAttr(CTA_TIMEOUT, timeoutSec, BIG_ENDIAN);
+
+        final int payloadLength = ctaTupleOrig.getAlignedLength() + ctaTimeout.getAlignedLength();
+        final byte[] bytes = new byte[STRUCT_SIZE + payloadLength];
+        final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
+        byteBuffer.order(ByteOrder.nativeOrder());
+
+        final ConntrackMessage ctmsg = new ConntrackMessage();
+        ctmsg.mHeader.nlmsg_len = bytes.length;
+        ctmsg.mHeader.nlmsg_type = (NFNL_SUBSYS_CTNETLINK << 8) | IPCTNL_MSG_CT_NEW;
+        ctmsg.mHeader.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_REPLACE;
+        ctmsg.mHeader.nlmsg_seq = 1;
+        ctmsg.pack(byteBuffer);
+
+        ctaTupleOrig.pack(byteBuffer);
+        ctaTimeout.pack(byteBuffer);
+
+        return bytes;
+    }
+
+    protected StructNfGenMsg mNfGenMsg;
+
+    private ConntrackMessage() {
+        super(new StructNlMsgHdr());
+        mNfGenMsg = new StructNfGenMsg((byte) OsConstants.AF_INET);
+    }
+
+    public void pack(ByteBuffer byteBuffer) {
+        mHeader.pack(byteBuffer);
+        mNfGenMsg.pack(byteBuffer);
+    }
+}
diff --git a/services/net/java/android/net/netlink/NetlinkSocket.java b/services/net/java/android/net/netlink/NetlinkSocket.java
index 657d48c..a9e0cd9 100644
--- a/services/net/java/android/net/netlink/NetlinkSocket.java
+++ b/services/net/java/android/net/netlink/NetlinkSocket.java
@@ -51,6 +51,47 @@
     private long mLastRecvTimeoutMs;
     private long mLastSendTimeoutMs;
 
+    public static void sendOneShotKernelMessage(int nlProto, byte[] msg) throws ErrnoException {
+        final String errPrefix = "Error in NetlinkSocket.sendOneShotKernelMessage";
+
+        try (NetlinkSocket nlSocket = new NetlinkSocket(nlProto)) {
+            final long IO_TIMEOUT = 300L;
+            nlSocket.connectToKernel();
+            nlSocket.sendMessage(msg, 0, msg.length, IO_TIMEOUT);
+            final ByteBuffer bytes = nlSocket.recvMessage(IO_TIMEOUT);
+            // recvMessage() guaranteed to not return null if it did not throw.
+            final NetlinkMessage response = NetlinkMessage.parse(bytes);
+            if (response != null && response instanceof NetlinkErrorMessage &&
+                    (((NetlinkErrorMessage) response).getNlMsgError() != null)) {
+                final int errno = ((NetlinkErrorMessage) response).getNlMsgError().error;
+                if (errno != 0) {
+                    // TODO: consider ignoring EINVAL (-22), which appears to be
+                    // normal when probing a neighbor for which the kernel does
+                    // not already have / no longer has a link layer address.
+                    Log.e(TAG, errPrefix + ", errmsg=" + response.toString());
+                    // Note: convert kernel errnos (negative) into userspace errnos (positive).
+                    throw new ErrnoException(response.toString(), Math.abs(errno));
+                }
+            } else {
+                final String errmsg;
+                if (response == null) {
+                    bytes.position(0);
+                    errmsg = "raw bytes: " + NetlinkConstants.hexify(bytes);
+                } else {
+                    errmsg = response.toString();
+                }
+                Log.e(TAG, errPrefix + ", errmsg=" + errmsg);
+                throw new ErrnoException(errmsg, OsConstants.EPROTO);
+            }
+        } catch (InterruptedIOException e) {
+            Log.e(TAG, errPrefix, e);
+            throw new ErrnoException(errPrefix, OsConstants.ETIMEDOUT, e);
+        } catch (SocketException e) {
+            Log.e(TAG, errPrefix, e);
+            throw new ErrnoException(errPrefix, OsConstants.EIO, e);
+        }
+    }
+
     public NetlinkSocket(int nlProto) throws ErrnoException {
         mDescriptor = Os.socket(
                 OsConstants.AF_NETLINK, OsConstants.SOCK_DGRAM, nlProto);
diff --git a/services/net/java/android/net/netlink/RtNetlinkNeighborMessage.java b/services/net/java/android/net/netlink/RtNetlinkNeighborMessage.java
index 02df131..e784fbb 100644
--- a/services/net/java/android/net/netlink/RtNetlinkNeighborMessage.java
+++ b/services/net/java/android/net/netlink/RtNetlinkNeighborMessage.java
@@ -36,7 +36,7 @@
 
 
 /**
- * A NetlinkMessage subclass for netlink error messages.
+ * A NetlinkMessage subclass for rtnetlink neighbor messages.
  *
  * see also: &lt;linux_src&gt;/include/uapi/linux/neighbour.h
  *
diff --git a/services/net/java/android/net/netlink/StructNfGenMsg.java b/services/net/java/android/net/netlink/StructNfGenMsg.java
new file mode 100644
index 0000000..99695e2
--- /dev/null
+++ b/services/net/java/android/net/netlink/StructNfGenMsg.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.netlink;
+
+import libcore.io.SizeOf;
+
+import java.nio.ByteBuffer;
+
+
+/**
+ * struct nfgenmsg
+ *
+ * see &lt;linux_src&gt;/include/uapi/linux/netfilter/nfnetlink.h
+ *
+ * @hide
+ */
+public class StructNfGenMsg {
+    public static final int STRUCT_SIZE = 2 + SizeOf.SHORT;
+
+    public static final int NFNETLINK_V0 = 0;
+
+    final public byte nfgen_family;
+    final public byte version;
+    final public short res_id;  // N.B.: this is big endian in the kernel
+
+    public StructNfGenMsg(byte family) {
+        nfgen_family = family;
+        version = (byte) NFNETLINK_V0;
+        res_id = (short) 0;
+    }
+
+    public void pack(ByteBuffer byteBuffer) {
+        byteBuffer.put(nfgen_family);
+        byteBuffer.put(version);
+        byteBuffer.putShort(res_id);
+    }
+}
diff --git a/services/net/java/android/net/netlink/StructNlAttr.java b/services/net/java/android/net/netlink/StructNlAttr.java
index 597a6aa..811bdbb 100644
--- a/services/net/java/android/net/netlink/StructNlAttr.java
+++ b/services/net/java/android/net/netlink/StructNlAttr.java
@@ -34,7 +34,12 @@
  */
 public class StructNlAttr {
     // Already aligned.
-    public static final int NLA_HEADERLEN         = 4;
+    public static final int NLA_HEADERLEN  = 4;
+    public static final int NLA_F_NESTED   = (1 << 15);
+
+    public static short makeNestedType(short type) {
+        return (short) (type | NLA_F_NESTED);
+    }
 
     // Return a (length, type) object only, without consuming any bytes in
     // |byteBuffer| and without copying or interpreting any value bytes.
@@ -46,10 +51,17 @@
         }
         final int baseOffset = byteBuffer.position();
 
-        final StructNlAttr struct = new StructNlAttr();
-        struct.nla_len = byteBuffer.getShort();
-        struct.nla_type = byteBuffer.getShort();
-        struct.mByteOrder = byteBuffer.order();
+        // Assume the byte order of the buffer is the expected byte order of the value.
+        final StructNlAttr struct = new StructNlAttr(byteBuffer.order());
+        // The byte order of nla_len and nla_type is always native.
+        final ByteOrder originalOrder = byteBuffer.order();
+        byteBuffer.order(ByteOrder.nativeOrder());
+        try {
+            struct.nla_len = byteBuffer.getShort();
+            struct.nla_type = byteBuffer.getShort();
+        } finally {
+            byteBuffer.order(originalOrder);
+        }
 
         byteBuffer.position(baseOffset);
         if (struct.nla_len < NLA_HEADERLEN) {
@@ -78,13 +90,65 @@
         return struct;
     }
 
-    public short nla_len;
+    public short nla_len = (short) NLA_HEADERLEN;
     public short nla_type;
     public byte[] nla_value;
-    public ByteOrder mByteOrder;
 
-    public StructNlAttr() {
-        mByteOrder = ByteOrder.nativeOrder();
+    // The byte order used to read/write the value member. Netlink length and
+    // type members are always read/written in native order.
+    private ByteOrder mByteOrder = ByteOrder.nativeOrder();
+
+    public StructNlAttr() {}
+
+    public StructNlAttr(ByteOrder byteOrder) {
+        mByteOrder = byteOrder;
+    }
+
+    public StructNlAttr(short type, byte value) {
+        nla_type = type;
+        setValue(new byte[1]);
+        nla_value[0] = value;
+    }
+
+    public StructNlAttr(short type, short value) {
+        this(type, value, ByteOrder.nativeOrder());
+    }
+
+    public StructNlAttr(short type, short value, ByteOrder order) {
+        this(order);
+        nla_type = type;
+        setValue(new byte[SizeOf.SHORT]);
+        getValueAsByteBuffer().putShort(value);
+    }
+
+    public StructNlAttr(short type, int value) {
+        this(type, value, ByteOrder.nativeOrder());
+    }
+
+    public StructNlAttr(short type, int value, ByteOrder order) {
+        this(order);
+        nla_type = type;
+        setValue(new byte[SizeOf.INT]);
+        getValueAsByteBuffer().putInt(value);
+    }
+
+    public StructNlAttr(short type, InetAddress ip) {
+        nla_type = type;
+        setValue(ip.getAddress());
+    }
+
+    public StructNlAttr(short type, StructNlAttr... nested) {
+        this();
+        nla_type = makeNestedType(type);
+
+        int payloadLength = 0;
+        for (StructNlAttr nla : nested) payloadLength += nla.getAlignedLength();
+        setValue(new byte[payloadLength]);
+
+        final ByteBuffer buf = getValueAsByteBuffer();
+        for (StructNlAttr nla : nested) {
+            nla.pack(buf);
+        }
     }
 
     public int getAlignedLength() {
@@ -117,13 +181,25 @@
     }
 
     public void pack(ByteBuffer byteBuffer) {
+        final ByteOrder originalOrder = byteBuffer.order();
         final int originalPosition = byteBuffer.position();
-        byteBuffer.putShort(nla_len);
-        byteBuffer.putShort(nla_type);
-        byteBuffer.put(nla_value);
+
+        byteBuffer.order(ByteOrder.nativeOrder());
+        try {
+            byteBuffer.putShort(nla_len);
+            byteBuffer.putShort(nla_type);
+            if (nla_value != null) byteBuffer.put(nla_value);
+        } finally {
+            byteBuffer.order(originalOrder);
+        }
         byteBuffer.position(originalPosition + getAlignedLength());
     }
 
+    private void setValue(byte[] value) {
+        nla_value = value;
+        nla_len = (short) (NLA_HEADERLEN + ((nla_value != null) ? nla_value.length : 0));
+    }
+
     @Override
     public String toString() {
         return "StructNlAttr{ "
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/MessageCapturingHandler.java b/services/tests/servicestests/src/com/android/server/accessibility/MessageCapturingHandler.java
index 0dba35f..e3ee47f 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/MessageCapturingHandler.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/MessageCapturingHandler.java
@@ -16,6 +16,7 @@
 
 package com.android.server.accessibility;
 
+import android.app.Notification;
 import android.os.Handler;
 import android.os.Message;
 import android.util.Pair;
@@ -49,7 +50,7 @@
     public void sendOneMessage() {
         Message message = timedMessages.remove(0).first;
         removeMessages(message.what, message.obj);
-        mCallback.handleMessage(message);
+        dispatchMessage(message);
         removeStaleMessages();
     }
 
@@ -62,7 +63,7 @@
     public void sendLastMessage() {
         Message message = timedMessages.remove(timedMessages.size() - 1).first;
         removeMessages(message.what, message.obj);
-        mCallback.handleMessage(message);
+        dispatchMessage(message);
         removeStaleMessages();
     }
 
@@ -79,4 +80,12 @@
             }
         }
     }
+
+    public void dispatchMessage(Message m) {
+        if (mCallback != null) {
+            mCallback.handleMessage(m);
+            return;
+        }
+        super.dispatchMessage(m);
+    }
 }
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java
index f63d438..6311d00 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java
@@ -19,7 +19,9 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import android.accessibilityservice.AccessibilityServiceInfo;
@@ -29,7 +31,6 @@
 import android.content.pm.ApplicationInfo;
 import android.content.pm.ResolveInfo;
 import android.content.pm.ServiceInfo;
-import android.os.Handler;
 import android.os.IBinder;
 import android.os.Looper;
 import android.view.WindowManagerInternal;
@@ -38,6 +39,7 @@
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 
@@ -49,6 +51,8 @@
 
     final UiAutomationManager mUiAutomationManager = new UiAutomationManager();
 
+    MessageCapturingHandler mMessageCapturingHandler;
+
     @Mock AccessibilityManagerService.UserState mMockUserState;
     @Mock Context mMockContext;
     @Mock AccessibilityServiceInfo mMockServiceInfo;
@@ -68,7 +72,6 @@
         }
     }
 
-
     @Before
     public void setup() {
         MockitoAnnotations.initMocks(this);
@@ -80,6 +83,8 @@
         mMockResolveInfo.serviceInfo.applicationInfo = mock(ApplicationInfo.class);
 
         when(mMockAccessibilityServiceClient.asBinder()).thenReturn(mMockServiceAsBinder);
+
+        mMessageCapturingHandler = new MessageCapturingHandler(null);
     }
 
     @Test
@@ -146,10 +151,20 @@
         assertEquals(0, mUiAutomationManager.getRequestedEventMaskLocked());
     }
 
+    @Test
+    public void uiAutomationBinderDiesBeforeConnecting_shouldNotCrash() throws Exception {
+        register(0);
+        ArgumentCaptor<IBinder.DeathRecipient> captor = ArgumentCaptor.forClass(
+                IBinder.DeathRecipient.class);
+        verify(mMockOwner).linkToDeath(captor.capture(), anyInt());
+        captor.getValue().binderDied();
+        mMessageCapturingHandler.sendAllMessages();
+    }
+
     private void register(int flags) {
         mUiAutomationManager.registerUiTestAutomationServiceLocked(mMockOwner,
                 mMockAccessibilityServiceClient, mMockContext, mMockServiceInfo, SERVICE_ID,
-                new Handler(), new Object(), mMockSecurityPolicy, mMockSystemSupport,
+                mMessageCapturingHandler, new Object(), mMockSecurityPolicy, mMockSystemSupport,
                 mMockWindowManagerInternal, mMockGlobalActionPerformer, flags);
     }
 
diff --git a/services/tests/servicestests/src/com/android/server/job/BackgroundRestrictionsTest.java b/services/tests/servicestests/src/com/android/server/job/BackgroundRestrictionsTest.java
index a1d8198..afe432b 100644
--- a/services/tests/servicestests/src/com/android/server/job/BackgroundRestrictionsTest.java
+++ b/services/tests/servicestests/src/com/android/server/job/BackgroundRestrictionsTest.java
@@ -116,7 +116,6 @@
         intentFilter.addAction(ACTION_JOB_STARTED);
         intentFilter.addAction(ACTION_JOB_STOPPED);
         mContext.registerReceiver(mJobStateChangeReceiver, intentFilter);
-        setGlobalSwitch(true);
         setAppOpsModeAllowed(true);
         setPowerWhiteListed(false);
     }
@@ -132,16 +131,6 @@
     }
 
     @Test
-    public void testGlobalSwitch() throws Exception {
-        setGlobalSwitch(false); // Job should not stop now.
-        scheduleAndAssertJobStarted();
-        setAppOpsModeAllowed(false);
-        mIActivityManager.makePackageIdle(TEST_APP_PACKAGE, UserHandle.USER_CURRENT);
-        assertFalse("Job stopped even when feature switch is off",
-                awaitJobStop(DEFAULT_WAIT_TIMEOUT));
-    }
-
-    @Test
     public void testPowerWhiteList() throws Exception {
         scheduleAndAssertJobStarted();
         setAppOpsModeAllowed(false);
@@ -163,16 +152,10 @@
         cancelJobsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         mContext.startActivity(cancelJobsIntent);
         mContext.unregisterReceiver(mJobStateChangeReceiver);
-        setGlobalSwitch(false);
         setAppOpsModeAllowed(true);
         setPowerWhiteListed(false);
     }
 
-    private void setGlobalSwitch(boolean enabled) {
-        Settings.Global.putString(mContext.getContentResolver(),
-                Settings.Global.JOB_SCHEDULER_CONSTANTS, "bg_jobs_restricted=" + enabled);
-    }
-
     private void setPowerWhiteListed(boolean whitelist) throws RemoteException {
         if (whitelist) {
             mDeviceIdleController.addPowerSaveWhitelistApp(TEST_APP_PACKAGE);
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceTest.java
index 9f77297..d136614 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceTest.java
@@ -55,11 +55,11 @@
     public void testWriteReadApplicationRestrictions() throws IOException {
         AtomicFile atomicFile = new AtomicFile(restrictionsFile);
         Bundle bundle = createBundle();
-        UserManagerService.writeApplicationRestrictionsLP(bundle, atomicFile);
+        UserManagerService.writeApplicationRestrictionsLAr(bundle, atomicFile);
         assertTrue(atomicFile.getBaseFile().exists());
         String s = FileUtils.readTextFile(restrictionsFile, 10000, "");
         System.out.println("restrictionsFile: " + s);
-        bundle = UserManagerService.readApplicationRestrictionsLP(atomicFile);
+        bundle = UserManagerService.readApplicationRestrictionsLAr(atomicFile);
         System.out.println("readApplicationRestrictionsLocked bundle: " + bundle);
         assertBundle(bundle);
     }
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java b/services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java
index 2c56a82..150f7f0 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java
@@ -16,10 +16,14 @@
 
 package com.android.server.pm.dex;
 
+import com.android.server.pm.PackageDexOptimizer;
+
+import static com.android.server.pm.PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import android.content.pm.ApplicationInfo;
 import android.support.test.filters.SmallTest;
@@ -46,22 +50,35 @@
     private static final String DELEGATE_LAST_CLASS_LOADER_NAME =
             DelegateLastClassLoader.class.getName();
 
-    private ApplicationInfo createMockApplicationInfo(String baseClassLoader, boolean addSplits,
+    private static class TestData {
+        ApplicationInfo info;
+        boolean[] pathsWithCode;
+    }
+
+    private TestData createMockApplicationInfo(String baseClassLoader, boolean addSplits,
             boolean addSplitDependencies) {
         ApplicationInfo ai = new ApplicationInfo();
         String codeDir = "/data/app/mock.android.com";
         ai.setBaseCodePath(codeDir + "/base.dex");
         ai.classLoaderName = baseClassLoader;
         ai.privateFlags = ai.privateFlags | ApplicationInfo.PRIVATE_FLAG_ISOLATED_SPLIT_LOADING;
+        boolean[] pathsWithCode;
+        if (!addSplits) {
+            pathsWithCode = new boolean[] {true};
+        } else {
+            pathsWithCode = new boolean[9];
+            Arrays.fill(pathsWithCode, true);
+            pathsWithCode[7] = false;  // config split
 
-        if (addSplits) {
             ai.setSplitCodePaths(new String[]{
                     codeDir + "/base-1.dex",
                     codeDir + "/base-2.dex",
                     codeDir + "/base-3.dex",
                     codeDir + "/base-4.dex",
                     codeDir + "/base-5.dex",
-                    codeDir + "/base-6.dex"});
+                    codeDir + "/base-6.dex",
+                    codeDir + "/config-split-7.dex",
+                    codeDir + "/feature-no-deps.dex"});
 
             ai.splitClassLoaderNames = new String[]{
                     DELEGATE_LAST_CLASS_LOADER_NAME,
@@ -69,7 +86,9 @@
                     PATH_CLASS_LOADER_NAME,
                     DEX_CLASS_LOADER_NAME,
                     PATH_CLASS_LOADER_NAME,
-                    null};  // A null class loader name should default to PathClassLoader.
+                    null,   // A null class loader name should default to PathClassLoader.
+                    null,   // The config split gets a null class loader.
+                    null};  // The feature split with no dependency and no specified class loader.
             if (addSplitDependencies) {
                 ai.splitDependencies = new SparseArray<>(ai.splitClassLoaderNames.length + 1);
                 ai.splitDependencies.put(0, new int[] {-1}); // base has no dependency
@@ -79,18 +98,24 @@
                 ai.splitDependencies.put(4, new int[] {0}); // split 4 depends on base
                 ai.splitDependencies.put(5, new int[] {0}); // split 5 depends on base
                 ai.splitDependencies.put(6, new int[] {5}); // split 6 depends on 5
+                // Do not add the config split to the dependency list.
+                // Do not add the feature split with no dependency to the dependency list.
             }
         }
-        return ai;
+        TestData data = new TestData();
+        data.info = ai;
+        data.pathsWithCode = pathsWithCode;
+        return data;
     }
 
     @Test
     public void testSplitChain() {
-        ApplicationInfo ai = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, true, true);
+        TestData data = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, true, true);
         String[] sharedLibrary = new String[] {"a.dex", "b.dex"};
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, sharedLibrary);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, sharedLibrary, data.pathsWithCode);
 
-        assertEquals(7, contexts.length);
+        assertEquals(9, contexts.length);
         assertEquals("PCL[a.dex:b.dex]", contexts[0]);
         assertEquals("DLC[];DLC[base-2.dex];PCL[base-4.dex];PCL[a.dex:b.dex:base.dex]",
                 contexts[1]);
@@ -99,15 +124,18 @@
         assertEquals("PCL[];PCL[a.dex:b.dex:base.dex]", contexts[4]);
         assertEquals("PCL[];PCL[a.dex:b.dex:base.dex]", contexts[5]);
         assertEquals("PCL[];PCL[base-5.dex];PCL[a.dex:b.dex:base.dex]", contexts[6]);
+        assertEquals(null, contexts[7]);  // config split
+        assertEquals("PCL[]", contexts[8]);  // feature split with no dependency
     }
 
     @Test
     public void testSplitChainNoSplitDependencies() {
-        ApplicationInfo ai = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, true, false);
+        TestData data = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, true, false);
         String[] sharedLibrary = new String[] {"a.dex", "b.dex"};
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, sharedLibrary);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, sharedLibrary, data.pathsWithCode);
 
-        assertEquals(7, contexts.length);
+        assertEquals(9, contexts.length);
         assertEquals("PCL[a.dex:b.dex]", contexts[0]);
         assertEquals("PCL[a.dex:b.dex:base.dex]", contexts[1]);
         assertEquals("PCL[a.dex:b.dex:base.dex:base-1.dex]", contexts[2]);
@@ -119,15 +147,21 @@
         assertEquals(
                 "PCL[a.dex:b.dex:base.dex:base-1.dex:base-2.dex:base-3.dex:base-4.dex:base-5.dex]",
                 contexts[6]);
+        assertEquals(null, contexts[7]);  // config split
+        assertEquals(
+                "PCL[a.dex:b.dex:base.dex:base-1.dex:base-2.dex:base-3.dex:base-4.dex:base-5.dex:base-6.dex:config-split-7.dex]",
+                contexts[8]);  // feature split with no dependency
     }
 
     @Test
     public void testSplitChainNoIsolationNoSharedLibrary() {
-        ApplicationInfo ai = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, true, true);
-        ai.privateFlags = ai.privateFlags & (~ApplicationInfo.PRIVATE_FLAG_ISOLATED_SPLIT_LOADING);
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, null);
+        TestData data = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, true, true);
+        data.info.privateFlags = data.info.privateFlags
+                & (~ApplicationInfo.PRIVATE_FLAG_ISOLATED_SPLIT_LOADING);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, null, data.pathsWithCode);
 
-        assertEquals(7, contexts.length);
+        assertEquals(9, contexts.length);
         assertEquals("PCL[]", contexts[0]);
         assertEquals("PCL[base.dex]", contexts[1]);
         assertEquals("PCL[base.dex:base-1.dex]", contexts[2]);
@@ -137,14 +171,20 @@
         assertEquals(
                 "PCL[base.dex:base-1.dex:base-2.dex:base-3.dex:base-4.dex:base-5.dex]",
                 contexts[6]);
+        assertEquals(null, contexts[7]);  // config split
+        assertEquals(
+                "PCL[base.dex:base-1.dex:base-2.dex:base-3.dex:base-4.dex:base-5.dex:base-6.dex:config-split-7.dex]",
+                contexts[8]);  // feature split with no dependency
     }
+
     @Test
     public void testSplitChainNoSharedLibraries() {
-        ApplicationInfo ai = createMockApplicationInfo(
+        TestData data = createMockApplicationInfo(
                 DELEGATE_LAST_CLASS_LOADER_NAME, true, true);
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, null);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, null, data.pathsWithCode);
 
-        assertEquals(7, contexts.length);
+        assertEquals(9, contexts.length);
         assertEquals("DLC[]", contexts[0]);
         assertEquals("DLC[];DLC[base-2.dex];PCL[base-4.dex];DLC[base.dex]", contexts[1]);
         assertEquals("DLC[];PCL[base-4.dex];DLC[base.dex]", contexts[2]);
@@ -152,16 +192,19 @@
         assertEquals("PCL[];DLC[base.dex]", contexts[4]);
         assertEquals("PCL[];DLC[base.dex]", contexts[5]);
         assertEquals("PCL[];PCL[base-5.dex];DLC[base.dex]", contexts[6]);
+        assertEquals(null, contexts[7]);  // config split
+        assertEquals("PCL[]", contexts[8]);  // feature split with no dependency
     }
 
     @Test
     public void testSplitChainWithNullPrimaryClassLoader() {
         // A null classLoaderName should mean PathClassLoader.
-        ApplicationInfo ai = createMockApplicationInfo(null, true, true);
+        TestData data = createMockApplicationInfo(null, true, true);
         String[] sharedLibrary = new String[] {"a.dex", "b.dex"};
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, sharedLibrary);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, sharedLibrary, data.pathsWithCode);
 
-        assertEquals(7, contexts.length);
+        assertEquals(9, contexts.length);
         assertEquals("PCL[a.dex:b.dex]", contexts[0]);
         assertEquals("DLC[];DLC[base-2.dex];PCL[base-4.dex];PCL[a.dex:b.dex:base.dex]", contexts[1]);
         assertEquals("DLC[];PCL[base-4.dex];PCL[a.dex:b.dex:base.dex]", contexts[2]);
@@ -169,13 +212,16 @@
         assertEquals("PCL[];PCL[a.dex:b.dex:base.dex]", contexts[4]);
         assertEquals("PCL[];PCL[a.dex:b.dex:base.dex]", contexts[5]);
         assertEquals("PCL[];PCL[base-5.dex];PCL[a.dex:b.dex:base.dex]", contexts[6]);
+        assertEquals(null, contexts[7]);  // config split
+        assertEquals("PCL[]", contexts[8]);  // feature split with no dependency
     }
 
     @Test
     public void tesNoSplits() {
-        ApplicationInfo ai = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, false, false);
+        TestData data = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, false, false);
         String[] sharedLibrary = new String[] {"a.dex", "b.dex"};
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, sharedLibrary);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, sharedLibrary, data.pathsWithCode);
 
         assertEquals(1, contexts.length);
         assertEquals("PCL[a.dex:b.dex]", contexts[0]);
@@ -183,9 +229,10 @@
 
     @Test
     public void tesNoSplitsNullClassLoaderName() {
-        ApplicationInfo ai = createMockApplicationInfo(null, false, false);
+        TestData data = createMockApplicationInfo(null, false, false);
         String[] sharedLibrary = new String[] {"a.dex", "b.dex"};
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, sharedLibrary);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, sharedLibrary, data.pathsWithCode);
 
         assertEquals(1, contexts.length);
         assertEquals("PCL[a.dex:b.dex]", contexts[0]);
@@ -193,10 +240,11 @@
 
     @Test
     public void tesNoSplitDelegateLast() {
-        ApplicationInfo ai = createMockApplicationInfo(
+        TestData data = createMockApplicationInfo(
                 DELEGATE_LAST_CLASS_LOADER_NAME, false, false);
         String[] sharedLibrary = new String[] {"a.dex", "b.dex"};
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, sharedLibrary);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, sharedLibrary, data.pathsWithCode);
 
         assertEquals(1, contexts.length);
         assertEquals("DLC[a.dex:b.dex]", contexts[0]);
@@ -204,8 +252,9 @@
 
     @Test
     public void tesNoSplitsNoSharedLibraries() {
-        ApplicationInfo ai = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, false, false);
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, null);
+        TestData data = createMockApplicationInfo(PATH_CLASS_LOADER_NAME, false, false);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, null, data.pathsWithCode);
 
         assertEquals(1, contexts.length);
         assertEquals("PCL[]", contexts[0]);
@@ -213,15 +262,55 @@
 
     @Test
     public void tesNoSplitDelegateLastNoSharedLibraries() {
-        ApplicationInfo ai = createMockApplicationInfo(
+        TestData data = createMockApplicationInfo(
                 DELEGATE_LAST_CLASS_LOADER_NAME, false, false);
-        String[] contexts = DexoptUtils.getClassLoaderContexts(ai, null);
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, null, data.pathsWithCode);
 
         assertEquals(1, contexts.length);
         assertEquals("DLC[]", contexts[0]);
     }
 
     @Test
+    public void testContextWithNoCode() {
+        TestData data = createMockApplicationInfo(null, true, false);
+        Arrays.fill(data.pathsWithCode, false);
+
+        String[] sharedLibrary = new String[] {"a.dex", "b.dex"};
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, sharedLibrary, data.pathsWithCode);
+
+        assertEquals(9, contexts.length);
+        assertEquals(null, contexts[0]);
+        assertEquals(null, contexts[1]);
+        assertEquals(null, contexts[2]);
+        assertEquals(null, contexts[3]);
+        assertEquals(null, contexts[4]);
+        assertEquals(null, contexts[5]);
+        assertEquals(null, contexts[6]);
+        assertEquals(null, contexts[7]);
+    }
+
+    @Test
+    public void testContextBaseNoCode() {
+        TestData data = createMockApplicationInfo(null, true, true);
+        data.pathsWithCode[0] = false;
+        String[] sharedLibrary = new String[] {"a.dex", "b.dex"};
+        String[] contexts = DexoptUtils.getClassLoaderContexts(
+                data.info, sharedLibrary, data.pathsWithCode);
+
+        assertEquals(9, contexts.length);
+        assertEquals(null, contexts[0]);
+        assertEquals("DLC[];DLC[base-2.dex];PCL[base-4.dex];PCL[a.dex:b.dex:base.dex]", contexts[1]);
+        assertEquals("DLC[];PCL[base-4.dex];PCL[a.dex:b.dex:base.dex]", contexts[2]);
+        assertEquals("PCL[];PCL[base-4.dex];PCL[a.dex:b.dex:base.dex]", contexts[3]);
+        assertEquals("PCL[];PCL[a.dex:b.dex:base.dex]", contexts[4]);
+        assertEquals("PCL[];PCL[a.dex:b.dex:base.dex]", contexts[5]);
+        assertEquals("PCL[];PCL[base-5.dex];PCL[a.dex:b.dex:base.dex]", contexts[6]);
+        assertEquals(null, contexts[7]);
+    }
+
+    @Test
     public void testProcessContextForDexLoad() {
         List<String> classLoaders = Arrays.asList(
                 DELEGATE_LAST_CLASS_LOADER_NAME,
@@ -284,4 +373,49 @@
         }
         assertTrue(gotException);
     }
+
+    @Test
+    public void testEncodeClassLoader() {
+        assertEquals(SKIP_SHARED_LIBRARY_CHECK, DexoptUtils.encodeClassLoader(
+                SKIP_SHARED_LIBRARY_CHECK, "dalvik.system.PathClassLoader"));
+        assertEquals(SKIP_SHARED_LIBRARY_CHECK, DexoptUtils.encodeClassLoader(
+                SKIP_SHARED_LIBRARY_CHECK, "dalvik.system.DexClassLoader"));
+        assertEquals(SKIP_SHARED_LIBRARY_CHECK, DexoptUtils.encodeClassLoader(
+                SKIP_SHARED_LIBRARY_CHECK, "dalvik.system.DelegateLastClassLoader"));
+        assertEquals("PCL[xyz]", DexoptUtils.encodeClassLoader("xyz",
+                "dalvik.system.PathClassLoader"));
+        assertEquals("PCL[xyz]", DexoptUtils.encodeClassLoader("xyz",
+                "dalvik.system.DexClassLoader"));
+        assertEquals("DLC[xyz]", DexoptUtils.encodeClassLoader("xyz",
+                "dalvik.system.DelegateLastClassLoader"));
+        assertEquals("PCL[xyz]", DexoptUtils.encodeClassLoader("xyz", null));
+        assertEquals("abc[xyz]", DexoptUtils.encodeClassLoader("xyz", "abc"));
+
+        try {
+            DexoptUtils.encodeClassLoader(null, "abc");
+            fail(); // Exception should be caught.
+        } catch (NullPointerException expected) {}
+    }
+
+    @Test
+    public void testEncodeClassLoaderChain() {
+        assertEquals(SKIP_SHARED_LIBRARY_CHECK, DexoptUtils.encodeClassLoaderChain(
+                SKIP_SHARED_LIBRARY_CHECK, "PCL[a]"));
+        assertEquals(SKIP_SHARED_LIBRARY_CHECK, DexoptUtils.encodeClassLoaderChain("PCL[a]",
+                SKIP_SHARED_LIBRARY_CHECK));
+        assertEquals("PCL[a];DLC[b]", DexoptUtils.encodeClassLoaderChain("PCL[a]",
+                "DLC[b]"));
+        assertEquals(SKIP_SHARED_LIBRARY_CHECK, DexoptUtils.encodeClassLoaderChain("PCL[a]",
+                SKIP_SHARED_LIBRARY_CHECK));
+
+        try {
+            DexoptUtils.encodeClassLoaderChain("a", null);
+            fail(); // exception is expected
+        } catch (NullPointerException expected) {}
+
+        try {
+            DexoptUtils.encodeClassLoaderChain(null, "b");
+            fail(); // exception is expected
+        } catch (NullPointerException expected) {}
+    }
 }
diff --git a/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java b/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
index c37b0d8..192e156 100644
--- a/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/ConfigurationContainerTests.java
@@ -240,6 +240,9 @@
         }
         assertTrue("Can't change activity type once set.", gotException);
 
+        // TODO: Commenting out for now until we figure-out a good way to test these rules that
+        // should only apply to system process.
+        /*
         gotException = false;
         try {
             // Parent can't change child's activity type once set.
@@ -261,6 +264,7 @@
             gotException = true;
         }
         assertTrue("Can't re-parent to a different activity type.", gotException);
+        */
 
     }
 
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
index 5f1c011..29bbe6e 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
@@ -54,7 +54,7 @@
         super.setUp();
         final Configuration overrideConfig = new Configuration();
         overrideConfig.windowConfiguration.setWindowingMode(
-                getWindowingModeForStackId(PINNED_STACK_ID));
+                getWindowingModeForStackId(PINNED_STACK_ID, false /* inSplitScreenMode */));
         mPinnedStack = new StackWindowController(PINNED_STACK_ID, null,
                 mDisplayContent.getDisplayId(), true /* onTop */, new Rect(), sWm).mContainer;
         mPinnedStack.onOverrideConfigurationChanged(overrideConfig);
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
index 3f75b41..31aad79 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
@@ -125,14 +125,9 @@
         config.setActivityType(ACTIVITY_TYPE_HOME);
         assertEquals(ACTIVITY_TYPE_HOME, config.getActivityType());
 
-        boolean gotException = false;
-        try {
-            // Can't change activity type once set.
-            config.setActivityType(ACTIVITY_TYPE_STANDARD);
-        } catch (IllegalStateException e) {
-            gotException = true;
-        }
-        assertTrue("Can't change activity type once set.", gotException);
+        // Allowed to change from app process.
+        config.setActivityType(ACTIVITY_TYPE_STANDARD);
+        assertEquals(ACTIVITY_TYPE_STANDARD, config.getActivityType());
     }
 
     /** Ensures the configuration app bounds at the root level match the app dimensions. */
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java
index 817f2b4..3df13ab 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowTestsBase.java
@@ -240,7 +240,7 @@
     StackWindowController createStackControllerOnStackOnDisplay(int stackId, DisplayContent dc) {
         final Configuration overrideConfig = new Configuration();
         overrideConfig.windowConfiguration.setWindowingMode(
-                getWindowingModeForStackId(stackId));
+                getWindowingModeForStackId(stackId, false /* inSplitScreenMode */));
         final StackWindowController controller = new StackWindowController(stackId, null,
                 dc.getDisplayId(), true /* onTop */, new Rect(), sWm);
         controller.onOverrideConfigurationChanged(overrideConfig);
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 0572b49..689ce95 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -1565,6 +1565,14 @@
     public static final String KEY_CONVERT_CDMA_CALLER_ID_MMI_CODES_WHILE_ROAMING_ON_3GPP_BOOL =
             "convert_cdma_caller_id_mmi_codes_while_roaming_on_3gpp_bool";
 
+    /**
+     * Flag specifying whether IMS registration state menu is shown in Status Info setting,
+     * default to false.
+     * @hide
+     */
+    public static final String KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL =
+            "show_ims_registration_status_bool";
+
     /** The default value for every variable. */
     private final static PersistableBundle sDefaults;
 
@@ -1760,7 +1768,11 @@
 
         // Carrier Signalling Receivers
         sDefaults.putString(KEY_CARRIER_SETUP_APP_STRING, "");
-        sDefaults.putStringArray(KEY_CARRIER_APP_WAKE_SIGNAL_CONFIG_STRING_ARRAY, null);
+        sDefaults.putStringArray(KEY_CARRIER_APP_WAKE_SIGNAL_CONFIG_STRING_ARRAY,
+                new String[]{
+                        "com.android.carrierdefaultapp/.CarrierDefaultBroadcastReceiver:"
+                                + "com.android.internal.telephony.CARRIER_SIGNAL_RESET"
+                });
         sDefaults.putStringArray(KEY_CARRIER_APP_NO_WAKE_SIGNAL_CONFIG_STRING_ARRAY, null);
 
 
@@ -1827,6 +1839,7 @@
                 false);
         sDefaults.putStringArray(KEY_NON_ROAMING_OPERATOR_STRING_ARRAY, null);
         sDefaults.putStringArray(KEY_ROAMING_OPERATOR_STRING_ARRAY, null);
+        sDefaults.putBoolean(KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, false);
     }
 
     /**
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index 8705446..d5ff1ad 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -2540,11 +2540,11 @@
     }
 
     // Split a phone number like "+20(123)-456#" using spaces, ignoring anything that is not
-    // a digit, to produce a result like "20 123 456".
+    // a digit or the characters * and #, to produce a result like "20 123 456#".
     private static String splitAtNonNumerics(CharSequence number) {
         StringBuilder sb = new StringBuilder(number.length());
         for (int i = 0; i < number.length(); i++) {
-            sb.append(PhoneNumberUtils.isISODigit(number.charAt(i))
+            sb.append(PhoneNumberUtils.is12Key(number.charAt(i))
                     ? number.charAt(i)
                     : " ");
         }
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index eaabaad..cde0bdf 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -1679,6 +1679,10 @@
         }
     }
 
+    /*
+     * When adding a network type to the list below, make sure to add the correct icon to
+     * MobileSignalController.mapIconSets().
+     */
     /** Network type is unknown */
     public static final int NETWORK_TYPE_UNKNOWN = 0;
     /** Current network is GPRS */
@@ -5831,6 +5835,25 @@
    }
 
     /**
+     * Returns the IMS Registration Status for a particular Subscription ID
+     *
+     * @param subId Subscription ID
+     * @return true if IMS status is registered, false if the IMS status is not registered or a
+     * RemoteException occurred.
+     *
+     * @hide
+     */
+    public boolean isImsRegistered(int subId) {
+       try {
+           return getITelephony().isImsRegisteredForSubscriber(subId);
+       } catch (RemoteException ex) {
+           return false;
+       } catch (NullPointerException ex) {
+           return false;
+       }
+    }
+
+    /**
      * Returns the Status of Volte
      * @hide
      */
@@ -6814,7 +6837,6 @@
      * Get the most recent SignalStrength information reported by the modem. Due
      * to power saving this information may not always be current.
      * @return the most recent cached signal strength info from the modem
-     * @hide
      */
     @Nullable
     public SignalStrength getSignalStrength() {
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 9262ec5..2ac11b5 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -1089,6 +1089,15 @@
     boolean isImsRegistered();
 
     /**
+     * Get IMS Registration Status on a particular subid.
+     *
+     * @param subId user preferred subId.
+     *
+     * @return {@code true} if the IMS status is registered.
+     */
+    boolean isImsRegisteredForSubscriber(int subId);
+
+    /**
      * Returns the Status of Wi-Fi Calling
      */
     boolean isWifiCallingAvailable();
diff --git a/tests/net/java/android/net/netlink/ConntrackMessageTest.java b/tests/net/java/android/net/netlink/ConntrackMessageTest.java
new file mode 100644
index 0000000..3aab942
--- /dev/null
+++ b/tests/net/java/android/net/netlink/ConntrackMessageTest.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.netlink;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assume.assumeTrue;
+
+import android.system.OsConstants;
+import libcore.util.HexEncoding;
+
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+import java.net.Inet4Address;
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.Arrays;
+
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class ConntrackMessageTest {
+    private static final boolean USING_LE = (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN);
+
+    // Example 1: TCP (192.168.43.209, 44333) -> (23.211.13.26, 443)
+    public static final String CT_V4UPDATE_TCP_HEX =
+            // struct nlmsghdr
+            "50000000" +      // length = 80
+            "0001" +          // type = (1 << 8) | 0
+            "0501" +          // flags
+            "01000000" +      // seqno = 1
+            "00000000" +      // pid = 0
+            // struct nfgenmsg
+            "02" +            // nfgen_family  = AF_INET
+            "00" +            // version = NFNETLINK_V0
+            "0000" +          // res_id
+            // struct nlattr
+            "3400" +          // nla_len = 52
+            "0180" +          // nla_type = nested CTA_TUPLE_ORIG
+                // struct nlattr
+                "1400" +      // nla_len = 20
+                "0180" +      // nla_type = nested CTA_TUPLE_IP
+                    "0800 0100 C0A82BD1" +  // nla_type=CTA_IP_V4_SRC, ip=192.168.43.209
+                    "0800 0200 17D30D1A" +  // nla_type=CTA_IP_V4_DST, ip=23.211.13.26
+                // struct nlattr
+                "1C00" +      // nla_len = 28
+                "0280" +      // nla_type = nested CTA_TUPLE_PROTO
+                    "0500 0100 06 000000" +  // nla_type=CTA_PROTO_NUM, proto=6
+                    "0600 0200 AD2D 0000" +  // nla_type=CTA_PROTO_SRC_PORT, port=44333 (big endian)
+                    "0600 0300 01BB 0000" +  // nla_type=CTA_PROTO_DST_PORT, port=443 (big endian)
+            // struct nlattr
+            "0800" +          // nla_len = 8
+            "0700" +          // nla_type = CTA_TIMEOUT
+            "00069780";       // nla_value = 432000 (big endian)
+    public static final byte[] CT_V4UPDATE_TCP_BYTES =
+            HexEncoding.decode(CT_V4UPDATE_TCP_HEX.replaceAll(" ", "").toCharArray(), false);
+
+    // Example 2: UDP (100.96.167.146, 37069) -> (216.58.197.10, 443)
+    public static final String CT_V4UPDATE_UDP_HEX =
+            // struct nlmsghdr
+            "50000000" +      // length = 80
+            "0001" +          // type = (1 << 8) | 0
+            "0501" +          // flags
+            "01000000" +      // seqno = 1
+            "00000000" +      // pid = 0
+            // struct nfgenmsg
+            "02" +            // nfgen_family  = AF_INET
+            "00" +            // version = NFNETLINK_V0
+            "0000" +          // res_id
+            // struct nlattr
+            "3400" +          // nla_len = 52
+            "0180" +          // nla_type = nested CTA_TUPLE_ORIG
+                // struct nlattr
+                "1400" +      // nla_len = 20
+                "0180" +      // nla_type = nested CTA_TUPLE_IP
+                    "0800 0100 6460A792" +  // nla_type=CTA_IP_V4_SRC, ip=100.96.167.146
+                    "0800 0200 D83AC50A" +  // nla_type=CTA_IP_V4_DST, ip=216.58.197.10
+                // struct nlattr
+                "1C00" +      // nla_len = 28
+                "0280" +      // nla_type = nested CTA_TUPLE_PROTO
+                    "0500 0100 11 000000" +  // nla_type=CTA_PROTO_NUM, proto=17
+                    "0600 0200 90CD 0000" +  // nla_type=CTA_PROTO_SRC_PORT, port=37069 (big endian)
+                    "0600 0300 01BB 0000" +  // nla_type=CTA_PROTO_DST_PORT, port=443 (big endian)
+            // struct nlattr
+            "0800" +          // nla_len = 8
+            "0700" +          // nla_type = CTA_TIMEOUT
+            "000000B4";       // nla_value = 180 (big endian)
+    public static final byte[] CT_V4UPDATE_UDP_BYTES =
+            HexEncoding.decode(CT_V4UPDATE_UDP_HEX.replaceAll(" ", "").toCharArray(), false);
+
+    @Test
+    public void testConntrackIPv4TcpTimeoutUpdate() throws Exception {
+        assumeTrue(USING_LE);
+
+        final byte[] tcp = ConntrackMessage.newIPv4TimeoutUpdateRequest(
+                OsConstants.IPPROTO_TCP,
+                (Inet4Address) InetAddress.getByName("192.168.43.209"), 44333,
+                (Inet4Address) InetAddress.getByName("23.211.13.26"), 443,
+                432000);
+        assertArrayEquals(CT_V4UPDATE_TCP_BYTES, tcp);
+    }
+
+    @Test
+    public void testConntrackIPv4UdpTimeoutUpdate() throws Exception {
+        assumeTrue(USING_LE);
+
+        final byte[] udp = ConntrackMessage.newIPv4TimeoutUpdateRequest(
+                OsConstants.IPPROTO_UDP,
+                (Inet4Address) InetAddress.getByName("100.96.167.146"), 37069,
+                (Inet4Address) InetAddress.getByName("216.58.197.10"), 443,
+                180);
+        assertArrayEquals(CT_V4UPDATE_UDP_BYTES, udp);
+    }
+}
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index f6481cf..8816d43 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -64,6 +64,7 @@
 import android.net.NetworkMisc;
 import android.net.NetworkRequest;
 import android.net.NetworkSpecifier;
+import android.net.NetworkUtils;
 import android.net.RouteInfo;
 import android.net.StringNetworkSpecifier;
 import android.net.metrics.IpConnectivityLog;
@@ -88,6 +89,7 @@
 import android.test.mock.MockContentResolver;
 import android.test.suitebuilder.annotation.SmallTest;
 import android.text.TextUtils;
+import android.util.ArraySet;
 import android.util.Log;
 import android.util.LogPrinter;
 
@@ -109,7 +111,10 @@
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
 import java.util.Objects;
+import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
@@ -304,6 +309,10 @@
         private String mRedirectUrl;
 
         MockNetworkAgent(int transport) {
+            this(transport, new LinkProperties());
+        }
+
+        MockNetworkAgent(int transport, LinkProperties linkProperties) {
             final int type = transportToLegacyType(transport);
             final String typeName = ConnectivityManager.getNetworkTypeName(type);
             mNetworkInfo = new NetworkInfo(type, 0, typeName, "Mock");
@@ -329,7 +338,7 @@
             mHandlerThread.start();
             mNetworkAgent = new NetworkAgent(mHandlerThread.getLooper(), mServiceContext,
                     "Mock-" + typeName, mNetworkInfo, mNetworkCapabilities,
-                    new LinkProperties(), mScore, new NetworkMisc()) {
+                    linkProperties, mScore, new NetworkMisc()) {
                 @Override
                 public void unwanted() { mDisconnected.open(); }
 
@@ -3338,6 +3347,68 @@
         assertException(() -> { mCm.requestRouteToHostAddress(TYPE_NONE, null); }, unsupported);
     }
 
+    @SmallTest
+    public void testLinkPropertiesEnsuresDirectlyConnectedRoutes() {
+        final NetworkRequest networkRequest = new NetworkRequest.Builder()
+                .addTransportType(TRANSPORT_WIFI).build();
+        final TestNetworkCallback networkCallback = new TestNetworkCallback();
+        mCm.registerNetworkCallback(networkRequest, networkCallback);
+
+        LinkProperties lp = new LinkProperties();
+        lp.setInterfaceName("wlan0");
+        LinkAddress myIpv4Address = new LinkAddress("192.168.12.3/24");
+        RouteInfo myIpv4DefaultRoute = new RouteInfo((IpPrefix) null,
+                NetworkUtils.numericToInetAddress("192.168.12.1"), lp.getInterfaceName());
+        lp.addLinkAddress(myIpv4Address);
+        lp.addRoute(myIpv4DefaultRoute);
+
+        // Verify direct routes are added when network agent is first registered in
+        // ConnectivityService.
+        MockNetworkAgent networkAgent = new MockNetworkAgent(TRANSPORT_WIFI, lp);
+        networkAgent.connect(true);
+        networkCallback.expectCallback(CallbackState.AVAILABLE, networkAgent);
+        networkCallback.expectCallback(CallbackState.NETWORK_CAPABILITIES, networkAgent);
+        CallbackInfo cbi = networkCallback.expectCallback(CallbackState.LINK_PROPERTIES,
+                networkAgent);
+        networkCallback.expectCapabilitiesWith(NET_CAPABILITY_VALIDATED, networkAgent);
+        networkCallback.assertNoCallback();
+        checkDirectlyConnectedRoutes(cbi.arg, Arrays.asList(myIpv4Address),
+                Arrays.asList(myIpv4DefaultRoute));
+        checkDirectlyConnectedRoutes(mCm.getLinkProperties(networkAgent.getNetwork()),
+                Arrays.asList(myIpv4Address), Arrays.asList(myIpv4DefaultRoute));
+
+        // Verify direct routes are added during subsequent link properties updates.
+        LinkProperties newLp = new LinkProperties(lp);
+        LinkAddress myIpv6Address1 = new LinkAddress("fe80::cafe/64");
+        LinkAddress myIpv6Address2 = new LinkAddress("2001:db8::2/64");
+        newLp.addLinkAddress(myIpv6Address1);
+        newLp.addLinkAddress(myIpv6Address2);
+        networkAgent.sendLinkProperties(newLp);
+        cbi = networkCallback.expectCallback(CallbackState.LINK_PROPERTIES, networkAgent);
+        networkCallback.assertNoCallback();
+        checkDirectlyConnectedRoutes(cbi.arg,
+                Arrays.asList(myIpv4Address, myIpv6Address1, myIpv6Address2),
+                Arrays.asList(myIpv4DefaultRoute));
+        mCm.unregisterNetworkCallback(networkCallback);
+    }
+
+    private void checkDirectlyConnectedRoutes(Object callbackObj,
+            Collection<LinkAddress> linkAddresses, Collection<RouteInfo> otherRoutes) {
+        assertTrue(callbackObj instanceof LinkProperties);
+        LinkProperties lp = (LinkProperties) callbackObj;
+
+        Set<RouteInfo> expectedRoutes = new ArraySet<>();
+        expectedRoutes.addAll(otherRoutes);
+        for (LinkAddress address : linkAddresses) {
+            RouteInfo localRoute = new RouteInfo(address, null, lp.getInterfaceName());
+            // Duplicates in linkAddresses are considered failures
+            assertTrue(expectedRoutes.add(localRoute));
+        }
+        List<RouteInfo> observedRoutes = lp.getRoutes();
+        assertEquals(expectedRoutes.size(), observedRoutes.size());
+        assertTrue(observedRoutes.containsAll(expectedRoutes));
+    }
+
     private static <T> void assertEmpty(T[] ts) {
         int length = ts.length;
         assertEquals("expected empty array, but length was " + length, 0, length);
diff --git a/tools/aapt/Android.bp b/tools/aapt/Android.bp
new file mode 100644
index 0000000..e26c9c3
--- /dev/null
+++ b/tools/aapt/Android.bp
@@ -0,0 +1,115 @@
+//
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// ==========================================================
+// Setup some common variables for the different build
+// targets here.
+// ==========================================================
+
+cc_defaults {
+    name: "aapt_defaults",
+
+    static_libs: [
+        "libandroidfw",
+        "libpng",
+        "libutils",
+        "liblog",
+        "libcutils",
+        "libexpat",
+        "libziparchive",
+        "libbase",
+        "libz",
+    ],
+    group_static_libs: true,
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+
+    target: {
+        windows: {
+            enabled: true,
+        },
+    },
+
+    // This tool is prebuilt if we're doing an app-only build.
+    product_variables: {
+        pdk: {
+            enabled: false,
+        },
+        unbundled_build: {
+            enabled: false,
+        },
+    },
+}
+
+// ==========================================================
+// Build the host static library: libaapt
+// ==========================================================
+cc_library_host_static {
+    name: "libaapt",
+    defaults: ["aapt_defaults"],
+    target: {
+        darwin: {
+            cflags: ["-D_DARWIN_UNLIMITED_STREAMS"],
+        },
+    },
+    cflags: [
+        "-Wno-format-y2k",
+        "-DSTATIC_ANDROIDFW_FOR_TOOLS",
+    ],
+
+    srcs: [
+        "AaptAssets.cpp",
+        "AaptConfig.cpp",
+        "AaptUtil.cpp",
+        "AaptXml.cpp",
+        "ApkBuilder.cpp",
+        "Command.cpp",
+        "CrunchCache.cpp",
+        "FileFinder.cpp",
+        "Images.cpp",
+        "Package.cpp",
+        "pseudolocalize.cpp",
+        "Resource.cpp",
+        "ResourceFilter.cpp",
+        "ResourceIdCache.cpp",
+        "ResourceTable.cpp",
+        "SourcePos.cpp",
+        "StringPool.cpp",
+        "WorkQueue.cpp",
+        "XMLNode.cpp",
+        "ZipEntry.cpp",
+        "ZipFile.cpp",
+    ],
+}
+
+// ==========================================================
+// Build the host tests: libaapt_tests
+// ==========================================================
+cc_test_host {
+    name: "libaapt_tests",
+    defaults: ["aapt_defaults"],
+    srcs: [
+        "tests/AaptConfig_test.cpp",
+        "tests/AaptGroupEntry_test.cpp",
+        "tests/Pseudolocales_test.cpp",
+        "tests/ResourceFilter_test.cpp",
+        "tests/ResourceTable_test.cpp",
+    ],
+    static_libs: ["libaapt"],
+}
diff --git a/tools/aapt/Android.mk b/tools/aapt/Android.mk
index 04f46d9..7bcf631 100644
--- a/tools/aapt/Android.mk
+++ b/tools/aapt/Android.mk
@@ -14,7 +14,6 @@
 # limitations under the License.
 #
 
-# This tool is prebuilt if we're doing an app-only build.
 ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
 
 # ==========================================================
@@ -23,37 +22,6 @@
 # ==========================================================
 LOCAL_PATH:= $(call my-dir)
 
-aaptMain := Main.cpp
-aaptSources := \
-    AaptAssets.cpp \
-    AaptConfig.cpp \
-    AaptUtil.cpp \
-    AaptXml.cpp \
-    ApkBuilder.cpp \
-    Command.cpp \
-    CrunchCache.cpp \
-    FileFinder.cpp \
-    Images.cpp \
-    Package.cpp \
-    pseudolocalize.cpp \
-    Resource.cpp \
-    ResourceFilter.cpp \
-    ResourceIdCache.cpp \
-    ResourceTable.cpp \
-    SourcePos.cpp \
-    StringPool.cpp \
-    WorkQueue.cpp \
-    XMLNode.cpp \
-    ZipEntry.cpp \
-    ZipFile.cpp
-
-aaptTests := \
-    tests/AaptConfig_test.cpp \
-    tests/AaptGroupEntry_test.cpp \
-    tests/Pseudolocales_test.cpp \
-    tests/ResourceFilter_test.cpp \
-    tests/ResourceTable_test.cpp
-
 aaptHostStaticLibs := \
     libandroidfw \
     libpng \
@@ -62,35 +30,10 @@
     libcutils \
     libexpat \
     libziparchive \
-    libbase
+    libbase \
+    libz
 
-aaptCFlags := -DAAPT_VERSION=\"$(BUILD_NUMBER_FROM_FILE)\"
-aaptCFlags += -Wall -Werror
-
-aaptHostLdLibs_linux := -lrt -ldl -lpthread
-
-# Statically link libz for MinGW (Win SDK under Linux),
-# and dynamically link for all others.
-aaptHostStaticLibs_windows := libz
-aaptHostLdLibs_linux += -lz
-aaptHostLdLibs_darwin := -lz
-
-
-# ==========================================================
-# Build the host static library: libaapt
-# ==========================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libaapt
-LOCAL_MODULE_HOST_OS := darwin linux windows
-LOCAL_CFLAGS := -Wno-format-y2k -DSTATIC_ANDROIDFW_FOR_TOOLS $(aaptCFlags)
-LOCAL_CPPFLAGS := $(aaptCppFlags)
-LOCAL_CFLAGS_darwin := -D_DARWIN_UNLIMITED_STREAMS
-LOCAL_SRC_FILES := $(aaptSources)
-LOCAL_STATIC_LIBRARIES := $(aaptHostStaticLibs)
-LOCAL_STATIC_LIBRARIES_windows := $(aaptHostStaticLibs_windows)
-
-include $(BUILD_HOST_STATIC_LIBRARY)
+aaptCFlags := -Wall -Werror
 
 # ==========================================================
 # Build the host executable: aapt
@@ -99,33 +42,10 @@
 
 LOCAL_MODULE := aapt
 LOCAL_MODULE_HOST_OS := darwin linux windows
-LOCAL_CFLAGS := $(aaptCFlags)
-LOCAL_CPPFLAGS := $(aaptCppFlags)
-LOCAL_LDLIBS_darwin := $(aaptHostLdLibs_darwin)
-LOCAL_LDLIBS_linux := $(aaptHostLdLibs_linux)
-LOCAL_SRC_FILES := $(aaptMain)
+LOCAL_CFLAGS := -DAAPT_VERSION=\"$(BUILD_NUMBER_FROM_FILE)\" $(aaptCFlags)
+LOCAL_SRC_FILES := Main.cpp
 LOCAL_STATIC_LIBRARIES := libaapt $(aaptHostStaticLibs)
-LOCAL_STATIC_LIBRARIES_windows := $(aaptHostStaticLibs_windows)
 
 include $(BUILD_HOST_EXECUTABLE)
 
-
-# ==========================================================
-# Build the host tests: libaapt_tests
-# ==========================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libaapt_tests
-LOCAL_CFLAGS := $(aaptCFlags)
-LOCAL_CPPFLAGS := $(aaptCppFlags)
-LOCAL_LDLIBS_darwin := $(aaptHostLdLibs_darwin)
-LOCAL_LDLIBS_linux := $(aaptHostLdLibs_linux)
-LOCAL_SRC_FILES := $(aaptTests)
-LOCAL_C_INCLUDES := $(LOCAL_PATH)
-LOCAL_STATIC_LIBRARIES := libaapt $(aaptHostStaticLibs)
-LOCAL_STATIC_LIBRARIES_windows := $(aaptHostStaticLibs_windows)
-
-include $(BUILD_HOST_NATIVE_TEST)
-
-
 endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index ba73180..5e85802 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -29,24 +29,6 @@
 
 using namespace android;
 
-#ifndef AAPT_VERSION
-    #define AAPT_VERSION ""
-#endif
-
-/*
- * Show version info.  All the cool kids do it.
- */
-int doVersion(Bundle* bundle)
-{
-    if (bundle->getFileSpecCount() != 0) {
-        printf("(ignoring extra arguments)\n");
-    }
-    printf("Android Asset Packaging Tool, v0.2-" AAPT_VERSION "\n");
-
-    return 0;
-}
-
-
 /*
  * Open the file read only.  The call fails if the file doesn't exist.
  *
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index 417b7ae..d714687 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -20,6 +20,23 @@
 
 static const char* gProgName = "aapt";
 
+#ifndef AAPT_VERSION
+    #define AAPT_VERSION ""
+#endif
+
+/*
+ * Show version info.  All the cool kids do it.
+ */
+int doVersion(Bundle* bundle)
+{
+    if (bundle->getFileSpecCount() != 0) {
+        printf("(ignoring extra arguments)\n");
+    }
+    printf("Android Asset Packaging Tool, v0.2-" AAPT_VERSION "\n");
+
+    return 0;
+}
+
 /*
  * When running under Cygwin on Windows, this will convert slash-based
  * paths into back-slash-based ones. Otherwise the ApptAssets file comparisons
diff --git a/tools/aapt2/Android.bp b/tools/aapt2/Android.bp
index 24aa6eb..43918da 100644
--- a/tools/aapt2/Android.bp
+++ b/tools/aapt2/Android.bp
@@ -24,7 +24,7 @@
 ]
 
 cc_defaults {
-    name: "aapt_defaults",
+    name: "aapt2_defaults",
     cflags: [
         "-Wall",
         "-Werror",
@@ -39,14 +39,9 @@
         windows: {
             enabled: true,
             cflags: ["-Wno-maybe-uninitialized"],
-            static_libs: ["libz"],
         },
         darwin: {
             cflags: ["-D_DARWIN_UNLIMITED_STREAMS"],
-            host_ldlibs: ["-lz"],
-        },
-        linux: {
-            host_ldlibs: ["-lz"],
         },
     },
     static_libs: [
@@ -59,6 +54,7 @@
         "libpng",
         "libbase",
         "libprotobuf-cpp-lite",
+        "libz",
     ],
     group_static_libs: true,
 }
@@ -149,7 +145,7 @@
     proto: {
         export_proto_headers: true,
     },
-    defaults: ["aapt_defaults"],
+    defaults: ["aapt2_defaults"],
 }
 
 // ==========================================================
@@ -159,7 +155,7 @@
     name: "libaapt2_jni",
     srcs: toolSources + ["jni/aapt2_jni.cpp"],
     static_libs: ["libaapt2"],
-    defaults: ["aapt_defaults"],
+    defaults: ["aapt2_defaults"],
 }
 
 // ==========================================================
@@ -176,7 +172,7 @@
         "libaapt2",
         "libgmock",
     ],
-    defaults: ["aapt_defaults"],
+    defaults: ["aapt2_defaults"],
 }
 
 // ==========================================================
@@ -186,5 +182,5 @@
     name: "aapt2",
     srcs: ["Main.cpp"] + toolSources,
     static_libs: ["libaapt2"],
-    defaults: ["aapt_defaults"],
+    defaults: ["aapt2_defaults"],
 }
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index 47549f0..4cc60a8 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -392,6 +392,7 @@
       {"declare-styleable", std::mem_fn(&ResourceParser::ParseDeclareStyleable)},
       {"integer-array", std::mem_fn(&ResourceParser::ParseIntegerArray)},
       {"java-symbol", std::mem_fn(&ResourceParser::ParseSymbol)},
+      {"overlayable", std::mem_fn(&ResourceParser::ParseOverlayable)},
       {"plurals", std::mem_fn(&ResourceParser::ParsePlural)},
       {"public", std::mem_fn(&ResourceParser::ParsePublic)},
       {"public-group", std::mem_fn(&ResourceParser::ParsePublicGroup)},
@@ -498,7 +499,7 @@
     const auto bag_iter = elToBagMap.find(resource_type);
     if (bag_iter != elToBagMap.end()) {
       // Ensure we have a name (unless this is a <public-group>).
-      if (resource_type != "public-group") {
+      if (resource_type != "public-group" && resource_type != "overlayable") {
         if (!maybe_name) {
           diag_->Error(DiagMessage(out_resource->source)
                        << "<" << parser->element_name() << "> missing 'name' attribute");
@@ -690,6 +691,11 @@
 
 bool ResourceParser::ParsePublic(xml::XmlPullParser* parser,
                                  ParsedResource* out_resource) {
+  if (out_resource->config != ConfigDescription::DefaultConfig()) {
+    diag_->Warn(DiagMessage(out_resource->source)
+                << "ignoring configuration '" << out_resource->config << "' for <public> tag");
+  }
+
   Maybe<StringPiece> maybe_type = xml::FindNonEmptyAttribute(parser, "type");
   if (!maybe_type) {
     diag_->Error(DiagMessage(out_resource->source)
@@ -726,8 +732,13 @@
   return true;
 }
 
-bool ResourceParser::ParsePublicGroup(xml::XmlPullParser* parser,
-                                      ParsedResource* out_resource) {
+bool ResourceParser::ParsePublicGroup(xml::XmlPullParser* parser, ParsedResource* out_resource) {
+  if (out_resource->config != ConfigDescription::DefaultConfig()) {
+    diag_->Warn(DiagMessage(out_resource->source)
+                << "ignoring configuration '" << out_resource->config
+                << "' for <public-group> tag");
+  }
+
   Maybe<StringPiece> maybe_type = xml::FindNonEmptyAttribute(parser, "type");
   if (!maybe_type) {
     diag_->Error(DiagMessage(out_resource->source)
@@ -842,13 +853,83 @@
   return true;
 }
 
-bool ResourceParser::ParseSymbol(xml::XmlPullParser* parser,
-                                 ParsedResource* out_resource) {
-  if (ParseSymbolImpl(parser, out_resource)) {
-    out_resource->symbol_state = SymbolState::kPrivate;
-    return true;
+bool ResourceParser::ParseSymbol(xml::XmlPullParser* parser, ParsedResource* out_resource) {
+  if (out_resource->config != ConfigDescription::DefaultConfig()) {
+    diag_->Warn(DiagMessage(out_resource->source)
+                << "ignoring configuration '" << out_resource->config << "' for <"
+                << parser->element_name() << "> tag");
   }
-  return false;
+
+  if (!ParseSymbolImpl(parser, out_resource)) {
+    return false;
+  }
+
+  out_resource->symbol_state = SymbolState::kPrivate;
+  return true;
+}
+
+bool ResourceParser::ParseOverlayable(xml::XmlPullParser* parser, ParsedResource* out_resource) {
+  if (out_resource->config != ConfigDescription::DefaultConfig()) {
+    diag_->Warn(DiagMessage(out_resource->source)
+                << "ignoring configuration '" << out_resource->config << "' for <overlayable> tag");
+  }
+
+  if (Maybe<StringPiece> maybe_policy = xml::FindNonEmptyAttribute(parser, "policy")) {
+    const StringPiece& policy = maybe_policy.value();
+    if (policy != "system") {
+      diag_->Error(DiagMessage(out_resource->source)
+                   << "<overlayable> has invalid policy '" << policy << "'");
+      return false;
+    }
+  }
+
+  bool error = false;
+  const size_t depth = parser->depth();
+  while (xml::XmlPullParser::NextChildNode(parser, depth)) {
+    if (parser->event() != xml::XmlPullParser::Event::kStartElement) {
+      // Skip text/comments.
+      continue;
+    }
+
+    const Source item_source = source_.WithLine(parser->line_number());
+    const std::string& element_namespace = parser->element_namespace();
+    const std::string& element_name = parser->element_name();
+    if (element_namespace.empty() && element_name == "item") {
+      Maybe<StringPiece> maybe_name = xml::FindNonEmptyAttribute(parser, "name");
+      if (!maybe_name) {
+        diag_->Error(DiagMessage(item_source)
+                     << "<item> within an <overlayable> tag must have a 'name' attribute");
+        error = true;
+        continue;
+      }
+
+      Maybe<StringPiece> maybe_type = xml::FindNonEmptyAttribute(parser, "type");
+      if (!maybe_type) {
+        diag_->Error(DiagMessage(item_source)
+                     << "<item> within an <overlayable> tag must have a 'type' attribute");
+        error = true;
+        continue;
+      }
+
+      const ResourceType* type = ParseResourceType(maybe_type.value());
+      if (type == nullptr) {
+        diag_->Error(DiagMessage(out_resource->source)
+                     << "invalid resource type '" << maybe_type.value()
+                     << "' in <item> within an <overlayable>");
+        error = true;
+        continue;
+      }
+
+      // TODO(b/64980941): Mark the symbol as overlayable and allow marking which entity can overlay
+      // the resource (system/app).
+
+      xml::XmlPullParser::SkipCurrentElement(parser);
+    } else if (!ShouldIgnoreElement(element_namespace, element_name)) {
+      diag_->Error(DiagMessage(item_source) << ":" << element_name << ">");
+      error = true;
+    }
+  }
+  return !error;
 }
 
 bool ResourceParser::ParseAddResource(xml::XmlPullParser* parser,
diff --git a/tools/aapt2/ResourceParser.h b/tools/aapt2/ResourceParser.h
index 5631dc2..fb9dbd0 100644
--- a/tools/aapt2/ResourceParser.h
+++ b/tools/aapt2/ResourceParser.h
@@ -91,6 +91,7 @@
   bool ParsePublicGroup(xml::XmlPullParser* parser, ParsedResource* out_resource);
   bool ParseSymbolImpl(xml::XmlPullParser* parser, ParsedResource* out_resource);
   bool ParseSymbol(xml::XmlPullParser* parser, ParsedResource* out_resource);
+  bool ParseOverlayable(xml::XmlPullParser* parser, ParsedResource* out_resource);
   bool ParseAddResource(xml::XmlPullParser* parser, ParsedResource* out_resource);
   bool ParseAttr(xml::XmlPullParser* parser, ParsedResource* out_resource);
   bool ParseAttrImpl(xml::XmlPullParser* parser, ParsedResource* out_resource, bool weak);
diff --git a/tools/aapt2/ResourceParser_test.cpp b/tools/aapt2/ResourceParser_test.cpp
index 144ebd2..f08b03e 100644
--- a/tools/aapt2/ResourceParser_test.cpp
+++ b/tools/aapt2/ResourceParser_test.cpp
@@ -790,4 +790,49 @@
   ASSERT_TRUE(TestParse(R"(<string name="foo">%1$s %n %2$s</string>)"));
 }
 
+TEST_F(ResourceParserTest, ParseOverlayableTagWithSystemPolicy) {
+  std::string input = R"(
+      <overlayable policy="illegal_policy">
+        <item type="string" name="foo" />
+      </overlayable>)";
+  EXPECT_FALSE(TestParse(input));
+
+  input = R"(
+      <overlayable policy="system">
+        <item name="foo" />
+      </overlayable>)";
+  EXPECT_FALSE(TestParse(input));
+
+  input = R"(
+      <overlayable policy="system">
+        <item type="attr" />
+      </overlayable>)";
+  EXPECT_FALSE(TestParse(input));
+
+  input = R"(
+      <overlayable policy="system">
+        <item type="bad_type" name="foo" />
+      </overlayable>)";
+  EXPECT_FALSE(TestParse(input));
+
+  input = R"(<overlayable policy="system" />)";
+  EXPECT_TRUE(TestParse(input));
+
+  input = R"(<overlayable />)";
+  EXPECT_TRUE(TestParse(input));
+
+  input = R"(
+      <overlayable policy="system">
+        <item type="string" name="foo" />
+        <item type="dimen" name="foo" />
+      </overlayable>)";
+  ASSERT_TRUE(TestParse(input));
+
+  input = R"(
+      <overlayable>
+        <item type="string" name="bar" />
+      </overlayable>)";
+  ASSERT_TRUE(TestParse(input));
+}
+
 }  // namespace aapt
diff --git a/tools/aapt2/xml/XmlDom.cpp b/tools/aapt2/xml/XmlDom.cpp
index 19de3af..32ec7bc 100644
--- a/tools/aapt2/xml/XmlDom.cpp
+++ b/tools/aapt2/xml/XmlDom.cpp
@@ -236,16 +236,22 @@
         attr.name = util::Utf16ToUtf8(StringPiece16(str16, len));
       }
 
+      uint32_t res_id = parser->getAttributeNameResID(i);
+      if (res_id > 0) {
+        attr.compiled_attribute = AaptAttribute(::aapt::Attribute(), {res_id});
+      }
+
       str16 = parser->getAttributeStringValue(i, &len);
       if (str16) {
         attr.value = util::Utf16ToUtf8(StringPiece16(str16, len));
+      } else {
+        android::Res_value res_value;
+        if (parser->getAttributeValue(i, &res_value) > 0) {
+          attr.compiled_value = ResourceUtils::ParseBinaryResValue(
+              ResourceType::kAnim, {}, parser->getStrings(), res_value, out_pool);
+        }
       }
 
-      android::Res_value res_value;
-      if (parser->getAttributeValue(i, &res_value) > 0) {
-        attr.compiled_value = ResourceUtils::ParseBinaryResValue(
-            ResourceType::kAnim, {}, parser->getStrings(), res_value, out_pool);
-      }
 
       el->attributes.push_back(std::move(attr));
     }
diff --git a/tools/bit/Android.bp b/tools/bit/Android.bp
new file mode 100644
index 0000000..258e9b5
--- /dev/null
+++ b/tools/bit/Android.bp
@@ -0,0 +1,40 @@
+//
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// ==========================================================
+// Build the host executable: bit
+// ==========================================================
+cc_binary_host {
+    name: "bit",
+
+    srcs: [
+        "aapt.cpp",
+        "adb.cpp",
+        "command.cpp",
+        "main.cpp",
+        "make.cpp",
+        "print.cpp",
+        "util.cpp",
+    ],
+
+    static_libs: [
+        "libexpat",
+        "libinstrumentation",
+        "libjsoncpp",
+    ],
+
+    shared_libs: ["libprotobuf-cpp-full"],
+}
diff --git a/tools/bit/Android.mk b/tools/bit/Android.mk
deleted file mode 100644
index 57f46d4..0000000
--- a/tools/bit/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH:= $(call my-dir)
-
-# ==========================================================
-# Build the host executable: protoc-gen-javastream
-# ==========================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := bit
-
-LOCAL_MODULE_HOST_OS := linux darwin
-
-LOCAL_SRC_FILES := \
-    aapt.cpp \
-    adb.cpp \
-    command.cpp \
-    main.cpp \
-    make.cpp \
-    print.cpp \
-    util.cpp
-
-LOCAL_STATIC_LIBRARIES := \
-    libexpat \
-    libinstrumentation \
-    libjsoncpp
-
-LOCAL_SHARED_LIBRARIES := \
-    libprotobuf-cpp-full
-
-include $(BUILD_HOST_EXECUTABLE)
diff --git a/tools/bit/adb.h b/tools/bit/adb.h
index dca80c8..f0774db 100644
--- a/tools/bit/adb.h
+++ b/tools/bit/adb.h
@@ -17,7 +17,7 @@
 #ifndef ADB_H
 #define ADB_H
 
-#include "instrumentation_data.pb.h"
+#include "proto/instrumentation_data.pb.h"
 
 #include <string>
 
diff --git a/tools/incident_report/Android.bp b/tools/incident_report/Android.bp
new file mode 100644
index 0000000..ab55dbd
--- /dev/null
+++ b/tools/incident_report/Android.bp
@@ -0,0 +1,35 @@
+//
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// ==========================================================
+// Build the host executable: incident_report
+// ==========================================================
+cc_binary_host {
+    name: "incident_report",
+
+    srcs: [
+        "generic_message.cpp",
+        "main.cpp",
+        "printer.cpp",
+    ],
+
+    shared_libs: [
+        "libplatformprotos",
+        "libprotobuf-cpp-full",
+    ],
+
+    cflags: ["-Wno-unused-parameter"],
+}
diff --git a/tools/incident_report/Android.mk b/tools/incident_report/Android.mk
deleted file mode 100644
index 9e56e3d..0000000
--- a/tools/incident_report/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH:= $(call my-dir)
-
-# ==========================================================
-# Build the host executable: protoc-gen-javastream
-# ==========================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := incident_report
-
-LOCAL_C_INCLUDES := \
-    external/protobuf/src
-
-LOCAL_SRC_FILES := \
-    generic_message.cpp \
-    main.cpp \
-    printer.cpp
-
-LOCAL_SHARED_LIBRARIES := \
-    libplatformprotos \
-    libprotobuf-cpp-full
-
-LOCAL_C_FLAGS := \
-    -Wno-unused-parameter
-include $(BUILD_HOST_EXECUTABLE)
-
-
diff --git a/tools/incident_section_gen/Android.bp b/tools/incident_section_gen/Android.bp
new file mode 100644
index 0000000..1756e06
--- /dev/null
+++ b/tools/incident_section_gen/Android.bp
@@ -0,0 +1,31 @@
+//
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// ==========================================================
+// Build the host executable: incident-section-gen
+// ==========================================================
+cc_binary_host {
+    name: "incident-section-gen",
+    cflags: [
+        "-g",
+        "-O0",
+    ],
+    srcs: ["main.cpp"],
+    shared_libs: [
+        "libplatformprotos",
+        "libprotobuf-cpp-full",
+    ],
+}
diff --git a/tools/incident_section_gen/Android.mk b/tools/incident_section_gen/Android.mk
deleted file mode 100644
index acf3f83..0000000
--- a/tools/incident_section_gen/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH:= $(call my-dir)
-
-# ==========================================================
-# Build the host executable: protoc-gen-javastream
-# ==========================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := incident-section-gen
-LOCAL_CFLAGS += -g -O0
-LOCAL_C_INCLUDES := \
-    external/protobuf/src
-LOCAL_SRC_FILES := \
-    main.cpp
-LOCAL_LDFLAGS := -ldl
-LOCAL_SHARED_LIBRARIES := \
-    libplatformprotos \
-    libprotobuf-cpp-full
-
-include $(BUILD_HOST_EXECUTABLE)
-
diff --git a/tools/incident_section_gen/main.cpp b/tools/incident_section_gen/main.cpp
index 23aafb2..7966d88 100644
--- a/tools/incident_section_gen/main.cpp
+++ b/tools/incident_section_gen/main.cpp
@@ -135,27 +135,24 @@
                 if (generatePrivacyFlags(field->message_type(), field_name, msgNames) &&
                     isDefaultDest(field)) break;
 
-                printf("static Privacy %s = { %d, %d, %d, NULL, %s_LIST };\n", field_name, field->number(),
-                        (int) field->type(), p.dest(), field_name);
+                printf("Privacy %s(%d, %s_LIST);\n", field_name, field->number(), field_name);
                 hasDefaultFlags[i] = false;
                 break;
             case FieldDescriptor::TYPE_STRING:
                 if (isDefaultDest(field) && p.patterns_size() == 0) break;
 
-                printf("static const char* %s_patterns[] = {\n", field_name);
+                printf("const char* %s_patterns[] = {\n", field_name);
                 for (int i=0; i<p.patterns_size(); i++) {
                     // the generated string need to escape backslash as well, need to dup it here
                     printf("    \"%s\",\n", replaceAll(p.patterns(i), '\\', "\\\\").c_str());
                 }
                 printf("    NULL };\n");
-                printf("static Privacy %s = { %d, %d, %d, %s_patterns };\n", field_name, field->number(),
-                        (int) field->type(), p.dest(), field_name);
+                printf("Privacy %s(%d, %d, %s_patterns);\n", field_name, field->number(), p.dest(), field_name);
                 hasDefaultFlags[i] = false;
                 break;
             default:
                 if (isDefaultDest(field)) break;
-                printf("static Privacy %s = { %d, %d, %d };\n", field_name, field->number(),
-                        (int) field->type(), p.dest());
+                printf("Privacy %s(%d, %d, %d);\n", field_name, field->number(), (int) field->type(), p.dest());
                 hasDefaultFlags[i] = false;
         }
         // add the field name to message map, true means it has default flags
@@ -213,20 +210,6 @@
     printf("    NULL };\n");
     emptyline();
 
-    // generates DESTINATION enum values
-    EnumDescriptor const* destination = Destination_descriptor();
-    for (int i=0; i<destination->value_count(); i++) {
-        EnumValueDescriptor const* val = destination->value(i);
-        printf("const uint8_t %s = %d;\n", val->name().c_str(), val->number());
-    }
-    emptyline();
-    printf("const uint8_t DEST_DEFAULT_VALUE = %d;\n", PrivacyFlags::default_instance().dest());
-    emptyline();
-    // populates string type and message type values
-    printf("const uint8_t TYPE_STRING = %d;\n", (int) FieldDescriptor::TYPE_STRING);
-    printf("const uint8_t TYPE_MESSAGE = %d;\n", (int) FieldDescriptor::TYPE_MESSAGE);
-    emptyline();
-
     // generates PRIVACY_POLICY
     map<string, bool> messageNames;
     if (generatePrivacyFlags(descriptor, "PRIVACY_POLICY", messageNames)) {
diff --git a/tools/obbtool/Android.bp b/tools/obbtool/Android.bp
new file mode 100644
index 0000000..f879658
--- /dev/null
+++ b/tools/obbtool/Android.bp
@@ -0,0 +1,51 @@
+//
+// Copyright 2010 The Android Open Source Project
+//
+// Opaque Binary Blob (OBB) Tool
+//
+
+cc_binary_host {
+    name: "obbtool",
+
+    srcs: ["Main.cpp"],
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-mismatched-tags",
+    ],
+
+    static_libs: [
+        "libandroidfw",
+        "libutils",
+        "libcutils",
+        "liblog",
+    ],
+
+    // This tool is prebuilt if we're doing an app-only build.
+    product_variables: {
+        unbundled_build: {
+            enabled: false,
+        },
+    },
+}
+
+//####################################################
+cc_binary_host {
+    name: "pbkdf2gen",
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-mismatched-tags",
+    ],
+    srcs: ["pbkdf2gen.cpp"],
+    static_libs: ["libcrypto"],
+
+    // This tool is prebuilt if we're doing an app-only build.
+    product_variables: {
+        unbundled_build: {
+            enabled: false,
+        },
+    },
+}
diff --git a/tools/obbtool/Android.mk b/tools/obbtool/Android.mk
deleted file mode 100644
index 6dc306e..0000000
--- a/tools/obbtool/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright 2010 The Android Open Source Project
-#
-# Opaque Binary Blob (OBB) Tool
-#
-
-# This tool is prebuilt if we're doing an app-only build.
-ifeq ($(TARGET_BUILD_APPS),)
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-	Main.cpp
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-mismatched-tags
-
-#LOCAL_C_INCLUDES +=
-
-LOCAL_STATIC_LIBRARIES := \
-	libandroidfw \
-	libutils \
-	libcutils \
-	liblog
-
-ifeq ($(HOST_OS),linux)
-LOCAL_LDLIBS += -ldl -lpthread
-endif
-
-LOCAL_MODULE := obbtool
-
-include $(BUILD_HOST_EXECUTABLE)
-
-#####################################################
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := pbkdf2gen
-LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS := -Wall -Werror -Wno-mismatched-tags
-LOCAL_SRC_FILES := pbkdf2gen.cpp
-LOCAL_LDLIBS += -ldl
-LOCAL_STATIC_LIBRARIES := libcrypto
-
-include $(BUILD_HOST_EXECUTABLE)
-
-#######################################################
-endif # TARGET_BUILD_APPS
diff --git a/tools/split-select/Android.bp b/tools/split-select/Android.bp
new file mode 100644
index 0000000..ee822b7
--- /dev/null
+++ b/tools/split-select/Android.bp
@@ -0,0 +1,108 @@
+//
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// ==========================================================
+// Setup some common variables for the different build
+// targets here.
+// ==========================================================
+
+cc_defaults {
+    name: "split-select_defaults",
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    include_dirs: ["frameworks/base/tools"],
+    static_libs: [
+        "libaapt",
+        "libandroidfw",
+        "libpng",
+        "libutils",
+        "liblog",
+        "libcutils",
+        "libexpat",
+        "libziparchive",
+        "libbase",
+        "libz",
+    ],
+    group_static_libs: true,
+
+    target: {
+        windows: {
+            enabled: true,
+        },
+    },
+
+    // This tool is prebuilt if we're doing an app-only build.
+    product_variables: {
+        pdk: {
+            enabled: false,
+        },
+        unbundled_build: {
+            enabled: false,
+        },
+    },
+}
+
+// ==========================================================
+// Build the host static library: libsplit-select
+// ==========================================================
+cc_library_host_static {
+    name: "libsplit-select",
+    defaults: ["split-select_defaults"],
+
+    srcs: [
+        "Abi.cpp",
+        "Grouper.cpp",
+        "Rule.cpp",
+        "RuleGenerator.cpp",
+        "SplitDescription.cpp",
+        "SplitSelector.cpp",
+    ],
+    cflags: ["-D_DARWIN_UNLIMITED_STREAMS"],
+
+}
+
+// ==========================================================
+// Build the host tests: libsplit-select_tests
+// ==========================================================
+cc_test_host {
+    name: "libsplit-select_tests",
+    defaults: ["split-select_defaults"],
+
+    srcs: [
+        "Grouper_test.cpp",
+        "Rule_test.cpp",
+        "RuleGenerator_test.cpp",
+        "SplitSelector_test.cpp",
+        "TestRules.cpp",
+    ],
+
+    static_libs: ["libsplit-select"],
+
+}
+
+// ==========================================================
+// Build the host executable: split-select
+// ==========================================================
+cc_binary_host {
+    name: "split-select",
+    defaults: ["split-select_defaults"],
+    srcs: ["Main.cpp"],
+
+    static_libs: ["libsplit-select"],
+}
diff --git a/tools/split-select/Android.mk b/tools/split-select/Android.mk
deleted file mode 100644
index 4a1511e..0000000
--- a/tools/split-select/Android.mk
+++ /dev/null
@@ -1,119 +0,0 @@
-#
-# Copyright (C) 2014 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# This tool is prebuilt if we're doing an app-only build.
-ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
-
-# ==========================================================
-# Setup some common variables for the different build
-# targets here.
-# ==========================================================
-LOCAL_PATH:= $(call my-dir)
-
-main := Main.cpp
-sources := \
-    Abi.cpp \
-    Grouper.cpp \
-    Rule.cpp \
-    RuleGenerator.cpp \
-    SplitDescription.cpp \
-    SplitSelector.cpp
-
-testSources := \
-    Grouper_test.cpp \
-    Rule_test.cpp \
-    RuleGenerator_test.cpp \
-    SplitSelector_test.cpp \
-    TestRules.cpp
-
-cIncludes := \
-    external/zlib \
-    frameworks/base/tools
-
-hostStaticLibs := \
-    libaapt \
-    libandroidfw \
-    libpng \
-    libutils \
-    liblog \
-    libcutils \
-    libexpat \
-    libziparchive \
-    libbase
-
-cFlags := -Wall -Werror
-
-hostLdLibs_linux := -lrt -ldl -lpthread
-
-# Statically link libz for MinGW (Win SDK under Linux),
-# and dynamically link for all others.
-hostStaticLibs_windows := libz
-hostLdLibs_darwin := -lz
-hostLdLibs_linux += -lz
-
-
-# ==========================================================
-# Build the host static library: libsplit-select
-# ==========================================================
-include $(CLEAR_VARS)
-LOCAL_MODULE := libsplit-select
-LOCAL_MODULE_HOST_OS := darwin linux windows
-
-LOCAL_SRC_FILES := $(sources)
-LOCAL_STATIC_LIBRARIES := $(hostStaticLibs)
-LOCAL_C_INCLUDES := $(cIncludes)
-LOCAL_CFLAGS := $(cFlags) -D_DARWIN_UNLIMITED_STREAMS
-
-include $(BUILD_HOST_STATIC_LIBRARY)
-
-
-# ==========================================================
-# Build the host tests: libsplit-select_tests
-# ==========================================================
-include $(CLEAR_VARS)
-LOCAL_MODULE := libsplit-select_tests
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_SRC_FILES := $(testSources)
-
-LOCAL_C_INCLUDES := $(cIncludes)
-LOCAL_STATIC_LIBRARIES := libsplit-select $(hostStaticLibs)
-LOCAL_STATIC_LIBRARIES_windows := $(hostStaticLibs_windows)
-LOCAL_LDLIBS_darwin := $(hostLdLibs_darwin)
-LOCAL_LDLIBS_linux := $(hostLdLibs_linux)
-LOCAL_CFLAGS := $(cFlags)
-
-include $(BUILD_HOST_NATIVE_TEST)
-
-# ==========================================================
-# Build the host executable: split-select
-# ==========================================================
-include $(CLEAR_VARS)
-LOCAL_MODULE := split-select
-LOCAL_MODULE_HOST_OS := darwin linux windows
-
-LOCAL_SRC_FILES := $(main)
-
-LOCAL_C_INCLUDES := $(cIncludes)
-LOCAL_STATIC_LIBRARIES := libsplit-select $(hostStaticLibs)
-LOCAL_STATIC_LIBRARIES_windows := $(hostStaticLibs_windows)
-LOCAL_LDLIBS_darwin := $(hostLdLibs_darwin)
-LOCAL_LDLIBS_linux := $(hostLdLibs_linux)
-LOCAL_CFLAGS := $(cFlags)
-
-include $(BUILD_HOST_EXECUTABLE)
-
-endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK
diff --git a/tools/streaming_proto/Android.bp b/tools/streaming_proto/Android.bp
new file mode 100644
index 0000000..24068e9
--- /dev/null
+++ b/tools/streaming_proto/Android.bp
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// ==========================================================
+// Build the host executable: protoc-gen-javastream
+// ==========================================================
+cc_binary_host {
+    name: "protoc-gen-javastream",
+    srcs: [
+        "Errors.cpp",
+        "string_utils.cpp",
+        "main.cpp",
+    ],
+
+    shared_libs: ["libprotoc"],
+}
diff --git a/tools/streaming_proto/Android.mk b/tools/streaming_proto/Android.mk
index 5a54fd1..ebb77a1 100644
--- a/tools/streaming_proto/Android.mk
+++ b/tools/streaming_proto/Android.mk
@@ -16,19 +16,6 @@
 LOCAL_PATH:= $(call my-dir)
 
 # ==========================================================
-# Build the host executable: protoc-gen-javastream
-# ==========================================================
-include $(CLEAR_VARS)
-LOCAL_MODULE := protoc-gen-javastream
-LOCAL_SRC_FILES := \
-    Errors.cpp \
-    string_utils.cpp \
-    main.cpp
-LOCAL_SHARED_LIBRARIES := \
-    libprotoc
-include $(BUILD_HOST_EXECUTABLE)
-
-# ==========================================================
 # Build the java test
 # ==========================================================
 include $(CLEAR_VARS)
diff --git a/tools/validatekeymaps/Android.bp b/tools/validatekeymaps/Android.bp
new file mode 100644
index 0000000..6fb278c
--- /dev/null
+++ b/tools/validatekeymaps/Android.bp
@@ -0,0 +1,30 @@
+//
+// Copyright 2010 The Android Open Source Project
+//
+// Keymap validation tool.
+//
+
+cc_binary_host {
+    name: "validatekeymaps",
+
+    srcs: ["Main.cpp"],
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+
+    static_libs: [
+        "libinput",
+        "libutils",
+        "libcutils",
+        "liblog",
+    ],
+
+    // This tool is prebuilt if we're doing an app-only build.
+    product_variables: {
+        unbundled_build: {
+          enabled: false,
+        },
+    },
+}
diff --git a/tools/validatekeymaps/Android.mk b/tools/validatekeymaps/Android.mk
deleted file mode 100644
index 9af721d..0000000
--- a/tools/validatekeymaps/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright 2010 The Android Open Source Project
-#
-# Keymap validation tool.
-#
-
-# This tool is prebuilt if we're doing an app-only build.
-ifeq ($(TARGET_BUILD_APPS),)
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-	Main.cpp
-
-LOCAL_CFLAGS := -Wall -Werror
-
-LOCAL_STATIC_LIBRARIES := \
-	libinput \
-	libutils \
-	libcutils \
-	liblog
-
-ifeq ($(HOST_OS),linux)
-LOCAL_LDLIBS += -ldl -lpthread
-endif
-
-LOCAL_MODULE := validatekeymaps
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
-endif # TARGET_BUILD_APPS