Merge changes Ie17eedfd,Icb80843a,If1619c10,Iee23682a
* changes:
AOD: Add wakelock for charging text while dozing
AOD: Show charging status on AOD1
AOD: Fix default for always-on setting
Revert "Revert "AOD: Refactor always on configuration""
diff --git a/api/current.txt b/api/current.txt
index 6a62fde..d837786 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -48766,6 +48766,7 @@
field public static final int ERROR_TIMEOUT = -8; // 0xfffffff8
field public static final int ERROR_TOO_MANY_REQUESTS = -15; // 0xfffffff1
field public static final int ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int ERROR_UNSAFE_RESOURCE = -16; // 0xfffffff0
field public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = -3; // 0xfffffffd
field public static final int ERROR_UNSUPPORTED_SCHEME = -10; // 0xfffffff6
}
diff --git a/api/system-current.txt b/api/system-current.txt
index 339f40b..b95f27a8 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -26957,7 +26957,6 @@
method public android.metrics.LogMaker clearPackageName();
method public android.metrics.LogMaker clearSubtype();
method public android.metrics.LogMaker clearTaggedData(int);
- method public android.metrics.LogMaker clearTimestamp();
method public android.metrics.LogMaker clearType();
method public void deserialize(java.lang.Object[]);
method public int getCategory();
@@ -26965,6 +26964,7 @@
method public java.lang.String getCounterName();
method public int getCounterValue();
method public java.lang.String getPackageName();
+ method public int getProcessId();
method public int getSubtype();
method public java.lang.Object getTaggedData(int);
method public long getTimestamp();
@@ -26974,13 +26974,8 @@
method public boolean isValidValue(java.lang.Object);
method public java.lang.Object[] serialize();
method public android.metrics.LogMaker setCategory(int);
- method public android.metrics.LogMaker setCounterBucket(int);
- method public android.metrics.LogMaker setCounterBucket(long);
- method public android.metrics.LogMaker setCounterName(java.lang.String);
- method public android.metrics.LogMaker setCounterValue(int);
method public android.metrics.LogMaker setPackageName(java.lang.String);
method public android.metrics.LogMaker setSubtype(int);
- method public android.metrics.LogMaker setTimestamp(long);
method public android.metrics.LogMaker setType(int);
}
@@ -52356,6 +52351,7 @@
field public static final int ERROR_TIMEOUT = -8; // 0xfffffff8
field public static final int ERROR_TOO_MANY_REQUESTS = -15; // 0xfffffff1
field public static final int ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int ERROR_UNSAFE_RESOURCE = -16; // 0xfffffff0
field public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = -3; // 0xfffffffd
field public static final int ERROR_UNSUPPORTED_SCHEME = -10; // 0xfffffff6
}
diff --git a/api/test-current.txt b/api/test-current.txt
index fc96532..51ff912 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -49135,6 +49135,7 @@
field public static final int ERROR_TIMEOUT = -8; // 0xfffffff8
field public static final int ERROR_TOO_MANY_REQUESTS = -15; // 0xfffffff1
field public static final int ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int ERROR_UNSAFE_RESOURCE = -16; // 0xfffffff0
field public static final int ERROR_UNSUPPORTED_AUTH_SCHEME = -3; // 0xfffffffd
field public static final int ERROR_UNSUPPORTED_SCHEME = -10; // 0xfffffff6
}
diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl
index dad2061..152d514 100644
--- a/core/java/android/app/IActivityManager.aidl
+++ b/core/java/android/app/IActivityManager.aidl
@@ -475,7 +475,7 @@
void reportSizeConfigurations(in IBinder token, in int[] horizontalSizeConfiguration,
in int[] verticalSizeConfigurations, in int[] smallestWidthConfigurations);
boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
- in Rect initialBounds, boolean moveHomeStackFront);
+ in Rect initialBounds);
void suppressResizeConfigChanges(boolean suppress);
void moveTasksToFullscreenStack(int fromStackId, boolean onTop);
boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds);
diff --git a/core/java/android/metrics/LogMaker.java b/core/java/android/metrics/LogMaker.java
index 612b135..60b27b4 100644
--- a/core/java/android/metrics/LogMaker.java
+++ b/core/java/android/metrics/LogMaker.java
@@ -46,8 +46,9 @@
private SparseArray<Object> entries = new SparseArray();
- public LogMaker(int mainCategory) {
- setCategory(mainCategory);
+ /** @param category for the new LogMaker. */
+ public LogMaker(int category) {
+ setCategory(category);
}
/* Deserialize from the eventlog */
@@ -55,71 +56,133 @@
deserialize(items);
}
+ /** @param category to replace the existing setting. */
public LogMaker setCategory(int category) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_CATEGORY, category);
return this;
}
+ /** Set the category to unknown. */
public LogMaker clearCategory() {
entries.remove(MetricsEvent.RESERVED_FOR_LOGBUILDER_CATEGORY);
return this;
}
+ /** @param type to replace the existing setting. */
public LogMaker setType(int type) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_TYPE, type);
return this;
}
+ /** Set the type to unknown. */
public LogMaker clearType() {
entries.remove(MetricsEvent.RESERVED_FOR_LOGBUILDER_TYPE);
return this;
}
+ /** @param subtype to replace the existing setting. */
public LogMaker setSubtype(int subtype) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_SUBTYPE, subtype);
return this;
}
+ /** Set the subtype to 0. */
public LogMaker clearSubtype() {
entries.remove(MetricsEvent.RESERVED_FOR_LOGBUILDER_SUBTYPE);
return this;
}
+ /**
+ * This will be set by the system when the log is persisted.
+ * Client-supplied values will be ignored.
+ *
+ * @param timestamp to replace the existing settings.
+ * @hide
+ */
public LogMaker setTimestamp(long timestamp) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_TIMESTAMP, timestamp);
return this;
}
+ /** Remove the timestamp property.
+ * @hide
+ */
public LogMaker clearTimestamp() {
entries.remove(MetricsEvent.RESERVED_FOR_LOGBUILDER_TIMESTAMP);
return this;
}
+ /** @param packageName to replace the existing setting. */
public LogMaker setPackageName(String packageName) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_PACKAGENAME, packageName);
return this;
}
+ /** Remove the package name property. */
public LogMaker clearPackageName() {
entries.remove(MetricsEvent.RESERVED_FOR_LOGBUILDER_PACKAGENAME);
return this;
}
+ /**
+ * This will be set by the system when the log is persisted.
+ * Client-supplied values will be ignored.
+ *
+ * @param pid to replace the existing setting.
+ * @hide
+ */
+ public LogMaker setProcessId(int pid) {
+ entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_PID, pid);
+ return this;
+ }
+
+ /** Remove the process ID property.
+ * @hide
+ */
+ public LogMaker clearProcessId() {
+ entries.remove(MetricsEvent.RESERVED_FOR_LOGBUILDER_PID);
+ return this;
+ }
+
+ /**
+ * The name of the counter or histogram.
+ * Only useful for counter or histogram category objects.
+ * @param name to replace the existing setting.
+ * @hide
+ */
public LogMaker setCounterName(String name) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_NAME, name);
return this;
}
+ /**
+ * The bucket label, expressed as an integer.
+ * Only useful for histogram category objects.
+ * @param bucket to replace the existing setting.
+ * @hide
+ */
public LogMaker setCounterBucket(int bucket) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_BUCKET, bucket);
return this;
}
+ /**
+ * The bucket label, expressed as a long integer.
+ * Only useful for histogram category objects.
+ * @param bucket to replace the existing setting.
+ * @hide
+ */
public LogMaker setCounterBucket(long bucket) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_BUCKET, bucket);
return this;
}
+ /**
+ * The value to increment the counter or bucket by.
+ * Only useful for counter and histogram category objects.
+ * @param value to replace the existing setting.
+ * @hide
+ */
public LogMaker setCounterValue(int value) {
entries.put(MetricsEvent.RESERVED_FOR_LOGBUILDER_VALUE, value);
return this;
@@ -171,6 +234,7 @@
return entries.get(tag);
}
+ /** @return the category of the log, or unknown. */
public int getCategory() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_CATEGORY);
if (obj instanceof Integer) {
@@ -180,6 +244,7 @@
}
}
+ /** @return the type of the log, or unknwon. */
public int getType() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_TYPE);
if (obj instanceof Integer) {
@@ -189,6 +254,7 @@
}
}
+ /** @return the subtype of the log, or 0. */
public int getSubtype() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_SUBTYPE);
if (obj instanceof Integer) {
@@ -198,6 +264,7 @@
}
}
+ /** @return the timestamp of the log.or 0 */
public long getTimestamp() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_TIMESTAMP);
if (obj instanceof Long) {
@@ -207,6 +274,7 @@
}
}
+ /** @return the package name of the log, or null. */
public String getPackageName() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_PACKAGENAME);
if (obj instanceof String) {
@@ -216,6 +284,17 @@
}
}
+ /** @return the process ID of the log, or -1. */
+ public int getProcessId() {
+ Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_PID);
+ if (obj instanceof Integer) {
+ return (Integer) obj;
+ } else {
+ return -1;
+ }
+ }
+
+ /** @return the name of the counter, or null. */
public String getCounterName() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_NAME);
if (obj instanceof String) {
@@ -225,6 +304,7 @@
}
}
+ /** @return the bucket label of the histogram\, or 0. */
public long getCounterBucket() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_BUCKET);
if (obj instanceof Number) {
@@ -234,11 +314,13 @@
}
}
+ /** @return true if the bucket label was specified as a long integer. */
public boolean isLongCounterBucket() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_BUCKET);
return obj instanceof Long;
}
+ /** @return the increment value of the counter, or 0. */
public int getCounterValue() {
Object obj = entries.get(MetricsEvent.RESERVED_FOR_LOGBUILDER_VALUE);
if (obj instanceof Integer) {
@@ -249,7 +331,7 @@
}
/**
- * Assemble logs into structure suitable for EventLog.
+ * @return a representation of the log suitable for EventLog.
*/
public Object[] serialize() {
Object[] out = new Object[entries.size() * 2];
diff --git a/core/java/android/metrics/MetricsReader.java b/core/java/android/metrics/MetricsReader.java
index dd8a74d..181e87f 100644
--- a/core/java/android/metrics/MetricsReader.java
+++ b/core/java/android/metrics/MetricsReader.java
@@ -77,7 +77,8 @@
objects[0] = data;
}
mEventQueue.add(new LogMaker(objects)
- .setTimestamp(eventTimestampMs));
+ .setTimestamp(eventTimestampMs)
+ .setProcessId(event.getProcessId()));
mLastEventMs = eventTimestampMs;
}
}
diff --git a/core/java/android/view/FocusFinder.java b/core/java/android/view/FocusFinder.java
index ad06141..61c9201 100644
--- a/core/java/android/view/FocusFinder.java
+++ b/core/java/android/view/FocusFinder.java
@@ -732,17 +732,27 @@
getRect(first, mFirstRect);
getRect(second, mSecondRect);
- boolean overlapsVertically = (mFirstRect.top < mSecondRect.top
- && mFirstRect.bottom > mSecondRect.top)
- || (mFirstRect.top > mSecondRect.top
- && mFirstRect.top < mSecondRect.bottom);
- boolean alignedVertically = (mFirstRect.left > mSecondRect.left)
- == (mFirstRect.right < mSecondRect.right);
- if (overlapsVertically && !alignedVertically) {
- int rtl = mIsLayoutRtl ? -1 : 1;
- return rtl * (mFirstRect.left - mSecondRect.left);
+ if (mFirstRect.top < mSecondRect.top) {
+ return -1;
+ } else if (mFirstRect.top > mSecondRect.top) {
+ return 1;
+ } else if (mFirstRect.left < mSecondRect.left) {
+ return mIsLayoutRtl ? 1 : -1;
+ } else if (mFirstRect.left > mSecondRect.left) {
+ return mIsLayoutRtl ? -1 : 1;
+ } else if (mFirstRect.bottom < mSecondRect.bottom) {
+ return -1;
+ } else if (mFirstRect.bottom > mSecondRect.bottom) {
+ return 1;
+ } else if (mFirstRect.right < mSecondRect.right) {
+ return mIsLayoutRtl ? 1 : -1;
+ } else if (mFirstRect.right > mSecondRect.right) {
+ return mIsLayoutRtl ? -1 : 1;
} else {
- return mFirstRect.top - mSecondRect.top;
+ // The view are distinct but completely coincident so we consider
+ // them equal for our purposes. Since the sort is stable, this
+ // means that the views will retain their layout order relative to one another.
+ return 0;
}
}
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index 0a73e17d..788908a 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -234,6 +234,8 @@
public static final int ERROR_FILE_NOT_FOUND = -14;
/** Too many requests during this load */
public static final int ERROR_TOO_MANY_REQUESTS = -15;
+ /** Resource load was cancelled by Safe Browsing */
+ public static final int ERROR_UNSAFE_RESOURCE = -16;
/**
* Report an error to the host application. These errors are unrecoverable
diff --git a/core/java/com/android/internal/logging/MetricsLogger.java b/core/java/com/android/internal/logging/MetricsLogger.java
index 949e7ac..a482929 100644
--- a/core/java/com/android/internal/logging/MetricsLogger.java
+++ b/core/java/com/android/internal/logging/MetricsLogger.java
@@ -31,109 +31,188 @@
// define metric categories in frameworks/base/proto/src/metrics_constants.proto.
// mirror changes in native version at system/core/libmetricslogger/metrics_logger.cpp
+ private static MetricsLogger sMetricsLogger;
+
+ private static MetricsLogger getLogger() {
+ if (sMetricsLogger == null) {
+ sMetricsLogger = new MetricsLogger();
+ }
+ return sMetricsLogger;
+ }
+
+ protected void saveLog(Object[] rep) {
+ EventLogTags.writeSysuiMultiAction(rep);
+ }
+
public static final int VIEW_UNKNOWN = MetricsEvent.VIEW_UNKNOWN;
public static final int LOGTAG = EventLogTags.SYSUI_MULTI_ACTION;
- public static void visible(Context context, int category) throws IllegalArgumentException {
+ public void write(LogMaker content) {
+ if (content.getType() == MetricsEvent.TYPE_UNKNOWN) {
+ content.setType(MetricsEvent.TYPE_ACTION);
+ }
+ saveLog(content.serialize());
+ }
+
+ public void visible(int category) throws IllegalArgumentException {
if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
throw new IllegalArgumentException("Must define metric category");
}
EventLogTags.writeSysuiViewVisibility(category, 100);
- EventLogTags.writeSysuiMultiAction(
- new LogMaker(category)
+ saveLog(new LogMaker(category)
.setType(MetricsEvent.TYPE_OPEN)
.serialize());
}
- public static void hidden(Context context, int category) throws IllegalArgumentException {
+ public void hidden(int category) throws IllegalArgumentException {
if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
throw new IllegalArgumentException("Must define metric category");
}
EventLogTags.writeSysuiViewVisibility(category, 0);
- EventLogTags.writeSysuiMultiAction(
- new LogMaker(category)
+ saveLog(new LogMaker(category)
.setType(MetricsEvent.TYPE_CLOSE)
.serialize());
}
- public static void visibility(Context context, int category, boolean visibile)
+ public void visibility(int category, boolean visibile)
throws IllegalArgumentException {
if (visibile) {
- visible(context, category);
+ visible(category);
} else {
- hidden(context, category);
+ hidden(category);
}
}
- public static void visibility(Context context, int category, int vis)
+ public void visibility(int category, int vis)
throws IllegalArgumentException {
- visibility(context, category, vis == View.VISIBLE);
+ visibility(category, vis == View.VISIBLE);
}
- public static void action(Context context, int category) {
+ public void action(int category) {
EventLogTags.writeSysuiAction(category, "");
- EventLogTags.writeSysuiMultiAction(
- new LogMaker(category)
+ saveLog(new LogMaker(category)
.setType(MetricsEvent.TYPE_ACTION)
.serialize());
}
- public static void action(Context context, int category, int value) {
+ public void action(int category, int value) {
EventLogTags.writeSysuiAction(category, Integer.toString(value));
- EventLogTags.writeSysuiMultiAction(
- new LogMaker(category)
+ saveLog(new LogMaker(category)
.setType(MetricsEvent.TYPE_ACTION)
.setSubtype(value)
.serialize());
}
- public static void action(Context context, int category, boolean value) {
+ public void action(int category, boolean value) {
EventLogTags.writeSysuiAction(category, Boolean.toString(value));
- EventLogTags.writeSysuiMultiAction(
- new LogMaker(category)
+ saveLog(new LogMaker(category)
.setType(MetricsEvent.TYPE_ACTION)
.setSubtype(value ? 1 : 0)
.serialize());
}
- public static void action(LogMaker content) {
- if (content.getType() == MetricsEvent.TYPE_UNKNOWN) {
- content.setType(MetricsEvent.TYPE_ACTION);
- }
- EventLogTags.writeSysuiMultiAction(content.serialize());
- }
-
-
- public static void action(Context context, int category, String pkg) {
+ public void action(int category, String pkg) {
if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
throw new IllegalArgumentException("Must define metric category");
}
EventLogTags.writeSysuiAction(category, pkg);
- EventLogTags.writeSysuiMultiAction(new LogMaker(category)
+ saveLog(new LogMaker(category)
.setType(MetricsEvent.TYPE_ACTION)
.setPackageName(pkg)
.serialize());
}
/** Add an integer value to the monotonically increasing counter with the given name. */
- public static void count(Context context, String name, int value) {
+ public void count(String name, int value) {
EventLogTags.writeSysuiCount(name, value);
- EventLogTags.writeSysuiMultiAction(
- new LogMaker(MetricsEvent.RESERVED_FOR_LOGBUILDER_COUNTER)
+ saveLog(new LogMaker(MetricsEvent.RESERVED_FOR_LOGBUILDER_COUNTER)
.setCounterName(name)
.setCounterValue(value)
.serialize());
}
/** Increment the bucket with the integer label on the histogram with the given name. */
- public static void histogram(Context context, String name, int bucket) {
+ public void histogram(String name, int bucket) {
// see LogHistogram in system/core/libmetricslogger/metrics_logger.cpp
EventLogTags.writeSysuiHistogram(name, bucket);
- EventLogTags.writeSysuiMultiAction(
- new LogMaker(MetricsEvent.RESERVED_FOR_LOGBUILDER_HISTOGRAM)
+ saveLog(new LogMaker(MetricsEvent.RESERVED_FOR_LOGBUILDER_HISTOGRAM)
.setCounterName(name)
.setCounterBucket(bucket)
.setCounterValue(1)
.serialize());
}
+
+ /** @deprecated use {@link #visible(int)} */
+ @Deprecated
+ public static void visible(Context context, int category) throws IllegalArgumentException {
+ getLogger().visible(category);
+ }
+
+ /** @deprecated use {@link #hidden(int)} */
+ @Deprecated
+ public static void hidden(Context context, int category) throws IllegalArgumentException {
+ getLogger().hidden(category);
+ }
+
+ /** @deprecated use {@link #visibility(int, boolean)} */
+ @Deprecated
+ public static void visibility(Context context, int category, boolean visibile)
+ throws IllegalArgumentException {
+ getLogger().visibility(category, visibile);
+ }
+
+ /** @deprecated use {@link #visibility(int, int)} */
+ @Deprecated
+ public static void visibility(Context context, int category, int vis)
+ throws IllegalArgumentException {
+ visibility(context, category, vis == View.VISIBLE);
+ }
+
+ /** @deprecated use {@link #action(int)} */
+ @Deprecated
+ public static void action(Context context, int category) {
+ getLogger().action(category);
+ }
+
+ /** @deprecated use {@link #action(int, int)} */
+ @Deprecated
+ public static void action(Context context, int category, int value) {
+ getLogger().action(category, value);
+ }
+
+ /** @deprecated use {@link #action(int, boolean)} */
+ @Deprecated
+ public static void action(Context context, int category, boolean value) {
+ getLogger().action(category, value);
+ }
+
+ /** @deprecated use {@link #write(LogMaker)} */
+ @Deprecated
+ public static void action(LogMaker content) {
+ getLogger().write(content);
+ }
+
+ /** @deprecated use {@link #action(int, String)} */
+ @Deprecated
+ public static void action(Context context, int category, String pkg) {
+ getLogger().action(category, pkg);
+ }
+
+ /**
+ * Add an integer value to the monotonically increasing counter with the given name.
+ * @deprecated use {@link #count(String, int)}
+ */
+ @Deprecated
+ public static void count(Context context, String name, int value) {
+ getLogger().count(name, value);
+ }
+
+ /**
+ * Increment the bucket with the integer label on the histogram with the given name.
+ * @deprecated use {@link #histogram(String, int)}
+ */
+ @Deprecated
+ public static void histogram(Context context, String name, int bucket) {
+ getLogger().histogram(name, bucket);
+ }
}
diff --git a/core/java/com/android/internal/logging/testing/FakeMetricsLogger.java b/core/java/com/android/internal/logging/testing/FakeMetricsLogger.java
new file mode 100644
index 0000000..fbaf87a
--- /dev/null
+++ b/core/java/com/android/internal/logging/testing/FakeMetricsLogger.java
@@ -0,0 +1,30 @@
+package com.android.internal.logging.testing;
+
+import android.metrics.LogMaker;
+
+import com.android.internal.logging.MetricsLogger;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
+/**
+ * Fake logger that queues up logged events for inspection.
+ *
+ * @hide.
+ */
+public class FakeMetricsLogger extends MetricsLogger {
+ private Queue<LogMaker> logs = new LinkedList<>();
+
+ @Override
+ protected void saveLog(Object[] rep) {
+ logs.offer(new LogMaker(rep));
+ }
+
+ public Queue<LogMaker> getLogs() {
+ return logs;
+ }
+
+ public void reset() {
+ logs.clear();
+ }
+}
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index fa71a62..e065843 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -100,6 +100,8 @@
int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose,
int[] fdsToIgnore, String instructionSet, String appDataDir) {
VM_HOOKS.preFork();
+ // Resets nice priority for zygote process.
+ resetNicePriority();
int pid = nativeForkAndSpecialize(
uid, gid, gids, debugFlags, rlimits, mountExternal, seInfo, niceName, fdsToClose,
fdsToIgnore, instructionSet, appDataDir);
@@ -144,6 +146,8 @@
public static int forkSystemServer(int uid, int gid, int[] gids, int debugFlags,
int[][] rlimits, long permittedCapabilities, long effectiveCapabilities) {
VM_HOOKS.preFork();
+ // Resets nice priority for zygote process.
+ resetNicePriority();
int pid = nativeForkSystemServer(
uid, gid, gids, debugFlags, rlimits, permittedCapabilities, effectiveCapabilities);
// Enable tracing as soon as we enter the system_server.
@@ -174,9 +178,13 @@
}
/**
- * Resets this process' priority to the default value (0).
+ * Resets the calling thread priority to the default value (Thread.NORM_PRIORITY
+ * or nice value 0). This updates both the priority value in java.lang.Thread and
+ * the nice value (setpriority).
*/
- native static void nativeResetNicePriority();
+ static void resetNicePriority() {
+ Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
+ }
/**
* Executes "/system/bin/sh -c <command>" using the exec() system call.
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 310cbc7..a7e900a 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -715,7 +715,7 @@
SystemClock.uptimeMillis());
bootTimingsTraceLog.traceEnd(); // ZygotePreload
} else {
- Zygote.nativeResetNicePriority();
+ Zygote.resetNicePriority();
}
// Finish profiling the zygote initialization.
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index c3f0e9d..0ab27f2 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -155,24 +155,6 @@
}
}
-// Resets nice priority for zygote process. Zygote priority can be set
-// to high value during boot phase to speed it up. We want to ensure
-// zygote is running at normal priority before childs are forked from it.
-//
-// This ends up being called repeatedly before each fork(), but there's
-// no real harm in that.
-static void ResetNicePriority(JNIEnv* env) {
- errno = 0;
- int prio = getpriority(PRIO_PROCESS, 0);
- if (prio == -1 && errno != 0) {
- ALOGW("getpriority failed: %s\n", strerror(errno));
- }
- if (prio != 0 && setpriority(PRIO_PROCESS, 0, 0) != 0) {
- ALOGE("setpriority(%d, 0, 0) failed: %s", PRIO_PROCESS, strerror(errno));
- RuntimeAbort(env, __LINE__, "setpriority failed");
- }
-}
-
// Sets the SIGCHLD handler back to default behavior in zygote children.
static void UnsetSigChldHandler() {
struct sigaction sa;
@@ -526,8 +508,6 @@
RuntimeAbort(env, __LINE__, "Unable to restat file descriptor table.");
}
- ResetNicePriority(env);
-
pid_t pid = fork();
if (pid == 0) {
@@ -806,10 +786,6 @@
UnmountTree("/storage");
}
-static void com_android_internal_os_Zygote_nativeResetNicePriority(JNIEnv* env, jclass) {
- ResetNicePriority(env);
-}
-
static const JNINativeMethod gMethods[] = {
{ "nativeForkAndSpecialize",
"(II[II[[IILjava/lang/String;Ljava/lang/String;[I[ILjava/lang/String;Ljava/lang/String;)I",
@@ -819,9 +795,7 @@
{ "nativeAllowFileAcrossFork", "(Ljava/lang/String;)V",
(void *) com_android_internal_os_Zygote_nativeAllowFileAcrossFork },
{ "nativeUnmountStorageOnInit", "()V",
- (void *) com_android_internal_os_Zygote_nativeUnmountStorageOnInit },
- { "nativeResetNicePriority", "()V",
- (void *) com_android_internal_os_Zygote_nativeResetNicePriority }
+ (void *) com_android_internal_os_Zygote_nativeUnmountStorageOnInit }
};
int register_com_android_internal_os_Zygote(JNIEnv* env) {
diff --git a/core/tests/coretests/src/android/metrics/LogMakerTest.java b/core/tests/coretests/src/android/metrics/LogMakerTest.java
index ece44be..bab9f63 100644
--- a/core/tests/coretests/src/android/metrics/LogMakerTest.java
+++ b/core/tests/coretests/src/android/metrics/LogMakerTest.java
@@ -171,6 +171,14 @@
assertEquals(null, builder.getPackageName());
}
+ public void testSetAndClearPid() {
+ LogMaker builder = new LogMaker(0);
+ builder.setProcessId(1);
+ assertEquals(1, builder.getProcessId());
+ builder.clearProcessId();
+ assertEquals(-1, builder.getProcessId());
+ }
+
public void testGiantLogOmitted() {
LogMaker badBuilder = new LogMaker(0);
StringBuilder b = new StringBuilder();
diff --git a/data/sounds/AudioTv.mk b/data/sounds/AudioTv.mk
new file mode 100644
index 0000000..ee37cb9
--- /dev/null
+++ b/data/sounds/AudioTv.mk
@@ -0,0 +1,125 @@
+# Copyright 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.
+
+LOCAL_PATH := frameworks/base/data/sounds
+
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/Alarm_Beep_01.ogg:system/media/audio/alarms/Alarm_Beep_01.ogg \
+ $(LOCAL_PATH)/Alarm_Beep_02.ogg:system/media/audio/alarms/Alarm_Beep_02.ogg \
+ $(LOCAL_PATH)/Alarm_Beep_03.ogg:system/media/audio/alarms/Alarm_Beep_03.ogg \
+ $(LOCAL_PATH)/Alarm_Buzzer.ogg:system/media/audio/alarms/Alarm_Buzzer.ogg \
+ $(LOCAL_PATH)/Alarm_Classic.ogg:system/media/audio/alarms/Alarm_Classic.ogg \
+ $(LOCAL_PATH)/Alarm_Rooster_02.ogg:system/media/audio/alarms/Alarm_Rooster_02.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Argon.ogg:system/media/audio/alarms/Argon.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Barium.ogg:system/media/audio/alarms/Barium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Carbon.ogg:system/media/audio/alarms/Carbon.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Cesium.ogg:system/media/audio/alarms/Cesium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Fermium.ogg:system/media/audio/alarms/Fermium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Hassium.ogg:system/media/audio/alarms/Hassium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Helium.ogg:system/media/audio/alarms/Helium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Krypton.ogg:system/media/audio/alarms/Krypton.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Neon.ogg:system/media/audio/alarms/Neon.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Neptunium.ogg:system/media/audio/alarms/Neptunium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Nobelium.ogg:system/media/audio/alarms/Nobelium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Osmium.ogg:system/media/audio/alarms/Osmium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Oxygen.ogg:system/media/audio/alarms/Oxygen.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Platinum.ogg:system/media/audio/alarms/Platinum.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Plutonium.ogg:system/media/audio/alarms/Plutonium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Promethium.ogg:system/media/audio/alarms/Promethium.ogg \
+ $(LOCAL_PATH)/alarms/ogg/Scandium.ogg:system/media/audio/alarms/Scandium.ogg \
+ $(LOCAL_PATH)/effects/ogg/camera_click_48k.ogg:system/media/audio/ui/camera_click.ogg \
+ $(LOCAL_PATH)/effects/ogg/camera_focus.ogg:system/media/audio/ui/camera_focus.ogg \
+ $(LOCAL_PATH)/effects/ogg/Dock.ogg:system/media/audio/ui/Dock.ogg \
+ $(LOCAL_PATH)/effects/ogg/Effect_Tick_48k.ogg:system/media/audio/ui/Effect_Tick.ogg \
+ $(LOCAL_PATH)/effects/ogg/KeypressDelete_120_48k.ogg:system/media/audio/ui/KeypressDelete.ogg \
+ $(LOCAL_PATH)/effects/ogg/KeypressInvalid_120_48k.ogg:system/media/audio/ui/KeypressInvalid.ogg \
+ $(LOCAL_PATH)/effects/ogg/KeypressReturn_120_48k.ogg:system/media/audio/ui/KeypressReturn.ogg \
+ $(LOCAL_PATH)/effects/ogg/KeypressSpacebar_120_48k.ogg:system/media/audio/ui/KeypressSpacebar.ogg \
+ $(LOCAL_PATH)/effects/ogg/KeypressStandard_120_48k.ogg:system/media/audio/ui/KeypressStandard.ogg \
+ $(LOCAL_PATH)/effects/ogg/Lock.ogg:system/media/audio/ui/Lock.ogg \
+ $(LOCAL_PATH)/effects/ogg/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg \
+ $(LOCAL_PATH)/effects/ogg/Trusted_48k.ogg:system/media/audio/ui/Trusted.ogg \
+ $(LOCAL_PATH)/effects/ogg/Undock.ogg:system/media/audio/ui/Undock.ogg \
+ $(LOCAL_PATH)/effects/ogg/Unlock.ogg:system/media/audio/ui/Unlock.ogg \
+ $(LOCAL_PATH)/effects/ogg/VideoRecord_48k.ogg:system/media/audio/ui/VideoRecord.ogg \
+ $(LOCAL_PATH)/effects/ogg/VideoStop_48k.ogg:system/media/audio/ui/VideoStop.ogg \
+ $(LOCAL_PATH)/effects/ogg/WirelessChargingStarted.ogg:system/media/audio/ui/WirelessChargingStarted.ogg \
+ $(LOCAL_PATH)/F1_MissedCall.ogg:system/media/audio/notifications/F1_MissedCall.ogg \
+ $(LOCAL_PATH)/F1_New_MMS.ogg:system/media/audio/notifications/F1_New_MMS.ogg \
+ $(LOCAL_PATH)/F1_New_SMS.ogg:system/media/audio/notifications/F1_New_SMS.ogg \
+ $(LOCAL_PATH)/notifications/Aldebaran.ogg:system/media/audio/notifications/Aldebaran.ogg \
+ $(LOCAL_PATH)/notifications/Altair.ogg:system/media/audio/notifications/Altair.ogg \
+ $(LOCAL_PATH)/notifications/Antares.ogg:system/media/audio/notifications/Antares.ogg \
+ $(LOCAL_PATH)/notifications/arcturus.ogg:system/media/audio/notifications/arcturus.ogg \
+ $(LOCAL_PATH)/notifications/Beat_Box_Android.ogg:system/media/audio/notifications/Beat_Box_Android.ogg \
+ $(LOCAL_PATH)/notifications/Betelgeuse.ogg:system/media/audio/notifications/Betelgeuse.ogg \
+ $(LOCAL_PATH)/notifications/Canopus.ogg:system/media/audio/notifications/Canopus.ogg \
+ $(LOCAL_PATH)/notifications/Castor.ogg:system/media/audio/notifications/Castor.ogg \
+ $(LOCAL_PATH)/notifications/Cricket.ogg:system/media/audio/notifications/Cricket.ogg \
+ $(LOCAL_PATH)/notifications/Deneb.ogg:system/media/audio/notifications/Deneb.ogg \
+ $(LOCAL_PATH)/notifications/Doink.ogg:system/media/audio/notifications/Doink.ogg \
+ $(LOCAL_PATH)/notifications/Drip.ogg:system/media/audio/notifications/Drip.ogg \
+ $(LOCAL_PATH)/notifications/Electra.ogg:system/media/audio/notifications/Electra.ogg \
+ $(LOCAL_PATH)/notifications/Fomalhaut.ogg:system/media/audio/notifications/Fomalhaut.ogg \
+ $(LOCAL_PATH)/notifications/Heaven.ogg:system/media/audio/notifications/Heaven.ogg \
+ $(LOCAL_PATH)/notifications/Merope.ogg:system/media/audio/notifications/Merope.ogg \
+ $(LOCAL_PATH)/notifications/moonbeam.ogg:system/media/audio/notifications/moonbeam.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Adara.ogg:system/media/audio/notifications/Adara.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Alya.ogg:system/media/audio/notifications/Alya.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Antimony.ogg:system/media/audio/notifications/Antimony.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Arcturus.ogg:system/media/audio/notifications/Arcturus.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Argon.ogg:system/media/audio/notifications/Argon.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Bellatrix.ogg:system/media/audio/notifications/Bellatrix.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Beryllium.ogg:system/media/audio/notifications/Beryllium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Capella.ogg:system/media/audio/notifications/Capella.ogg \
+ $(LOCAL_PATH)/notifications/ogg/CetiAlpha.ogg:system/media/audio/notifications/CetiAlpha.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Cobalt.ogg:system/media/audio/notifications/Cobalt.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Fluorine.ogg:system/media/audio/notifications/Fluorine.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Gallium.ogg:system/media/audio/notifications/Gallium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Helium.ogg:system/media/audio/notifications/Helium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Hojus.ogg:system/media/audio/notifications/Hojus.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Iridium.ogg:system/media/audio/notifications/Iridium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Krypton.ogg:system/media/audio/notifications/Krypton.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Lalande.ogg:system/media/audio/notifications/Lalande.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Mira.ogg:system/media/audio/notifications/Mira.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Palladium.ogg:system/media/audio/notifications/Palladium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Polaris.ogg:system/media/audio/notifications/Polaris.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Pollux.ogg:system/media/audio/notifications/Pollux.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Procyon.ogg:system/media/audio/notifications/Procyon.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Proxima.ogg:system/media/audio/notifications/Proxima.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Radon.ogg:system/media/audio/notifications/Radon.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Rubidium.ogg:system/media/audio/notifications/Rubidium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Selenium.ogg:system/media/audio/notifications/Selenium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Shaula.ogg:system/media/audio/notifications/Shaula.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Spica.ogg:system/media/audio/notifications/Spica.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Strontium.ogg:system/media/audio/notifications/Strontium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Syrma.ogg:system/media/audio/notifications/Syrma.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Talitha.ogg:system/media/audio/notifications/Talitha.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Tejat.ogg:system/media/audio/notifications/Tejat.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Thallium.ogg:system/media/audio/notifications/Thallium.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Upsilon.ogg:system/media/audio/notifications/Upsilon.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Vega.ogg:system/media/audio/notifications/Vega.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Xenon.ogg:system/media/audio/notifications/Xenon.ogg \
+ $(LOCAL_PATH)/notifications/ogg/Zirconium.ogg:system/media/audio/notifications/Zirconium.ogg \
+ $(LOCAL_PATH)/notifications/pixiedust.ogg:system/media/audio/notifications/pixiedust.ogg \
+ $(LOCAL_PATH)/notifications/pizzicato.ogg:system/media/audio/notifications/pizzicato.ogg \
+ $(LOCAL_PATH)/notifications/Plastic_Pipe.ogg:system/media/audio/notifications/Plastic_Pipe.ogg \
+ $(LOCAL_PATH)/notifications/regulus.ogg:system/media/audio/notifications/regulus.ogg \
+ $(LOCAL_PATH)/notifications/sirius.ogg:system/media/audio/notifications/sirius.ogg \
+ $(LOCAL_PATH)/notifications/Sirrah.ogg:system/media/audio/notifications/Sirrah.ogg \
+ $(LOCAL_PATH)/notifications/SpaceSeed.ogg:system/media/audio/notifications/SpaceSeed.ogg \
+ $(LOCAL_PATH)/notifications/TaDa.ogg:system/media/audio/notifications/TaDa.ogg \
+ $(LOCAL_PATH)/notifications/Tinkerbell.ogg:system/media/audio/notifications/Tinkerbell.ogg \
+ $(LOCAL_PATH)/notifications/tweeters.ogg:system/media/audio/notifications/tweeters.ogg \
+ $(LOCAL_PATH)/notifications/vega.ogg:system/media/audio/notifications/vega.ogg
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index 51a7d00..812e4d8 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -512,15 +512,7 @@
void SkiaCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
if (CC_UNLIKELY(paint.nothingToDraw())) return;
- SkRect rect;
- SkRRect roundRect;
- if (path.isOval(&rect)) {
- mCanvas->drawOval(rect, paint);
- } else if (path.isRRect(&roundRect)) {
- mCanvas->drawRRect(roundRect, paint);
- } else {
- mCanvas->drawPath(path, paint);
- }
+ mCanvas->drawPath(path, paint);
}
void SkiaCanvas::drawVertices(SkCanvas::VertexMode vertexMode, int vertexCount,
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index 31f9ba4..12332fb 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -519,7 +519,7 @@
try {
return mIam.moveTaskToDockedStack(taskId, createMode, true /* onTop */,
- false /* animate */, initialBounds, true /* moveHomeStackFront */ );
+ false /* animate */, initialBounds);
} catch (RemoteException e) {
e.printStackTrace();
}
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 005b701..6c729dc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -487,6 +487,8 @@
private ScreenPinningRequest mScreenPinningRequest;
+ MetricsLogger mMetricsLogger = new MetricsLogger();
+
// ensure quick settings is disabled until the current user makes it through the setup wizard
private boolean mUserSetup = false;
private DeviceProvisionedListener mUserSetupObserver = new DeviceProvisionedListener() {
@@ -1360,7 +1362,7 @@
mDismissView.setOnButtonClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- MetricsLogger.action(mContext, MetricsEvent.ACTION_DISMISS_ALL_NOTES);
+ mMetricsLogger.action(MetricsEvent.ACTION_DISMISS_ALL_NOTES);
clearAllNotifications();
}
});
@@ -1539,7 +1541,7 @@
} else {
EventBus.getDefault().send(new UndockingTaskEvent());
if (metricsUndockAction != -1) {
- MetricsLogger.action(mContext, metricsUndockAction);
+ mMetricsLogger.action(metricsUndockAction);
}
}
}
@@ -1597,7 +1599,7 @@
notification.getKey());
notification.getNotification().fullScreenIntent.send();
shadeEntry.notifyFullScreenIntentLaunched();
- MetricsLogger.count(mContext, "note_fullscreen", 1);
+ mMetricsLogger.count("note_fullscreen", 1);
} catch (PendingIntent.CanceledException e) {
}
}
@@ -2801,16 +2803,16 @@
if (!mUserSetup) return;
if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_UP == key) {
- MetricsLogger.action(mContext, MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_UP);
+ mMetricsLogger.action(MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_UP);
mNotificationPanel.collapse(false /* delayed */, 1.0f /* speedUpFactor */);
} else if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_DOWN == key) {
- MetricsLogger.action(mContext, MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_DOWN);
+ mMetricsLogger.action(MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_DOWN);
if (mNotificationPanel.isFullyCollapsed()) {
mNotificationPanel.expand(true /* animate */);
- MetricsLogger.count(mContext, NotificationPanelView.COUNTER_PANEL_OPEN, 1);
+ mMetricsLogger.count(NotificationPanelView.COUNTER_PANEL_OPEN, 1);
} else if (!mNotificationPanel.isInSettings() && !mNotificationPanel.isExpanding()){
mNotificationPanel.flingSettings(0 /* velocity */, true /* expand */);
- MetricsLogger.count(mContext, NotificationPanelView.COUNTER_PANEL_OPEN_QS, 1);
+ mMetricsLogger.count(NotificationPanelView.COUNTER_PANEL_OPEN_QS, 1);
}
}
@@ -3689,7 +3691,7 @@
if (pinnedHeadsUp && isPanelFullyCollapsed()) {
notificationLoad = 1;
} else {
- MetricsLogger.histogram(mContext, "note_load", notificationLoad);
+ mMetricsLogger.histogram("note_load", notificationLoad);
}
mBarService.onPanelRevealed(clearNotificationEffects, notificationLoad);
} else {
@@ -3772,7 +3774,7 @@
if (mStatusBarStateLog == null) {
mStatusBarStateLog = new LogMaker(MetricsEvent.VIEW_UNKNOWN);
}
- MetricsLogger.action(mStatusBarStateLog
+ mMetricsLogger.write(mStatusBarStateLog
.setCategory(isBouncerShowing ? MetricsEvent.BOUNCER : MetricsEvent.LOCKSCREEN)
.setType(isShowing ? MetricsEvent.TYPE_OPEN : MetricsEvent.TYPE_CLOSE)
.setSubtype(isSecure ? 1 : 0));
@@ -5776,7 +5778,7 @@
NotificationInfo info = (NotificationInfo) item.gutsContent;
final NotificationInfo.OnSettingsClickListener onSettingsClick = (View v,
int appUid) -> {
- MetricsLogger.action(mContext, MetricsEvent.ACTION_NOTE_INFO);
+ mMetricsLogger.action(MetricsEvent.ACTION_NOTE_INFO);
guts.resetFalsingCheck();
startAppNotificationSettingsActivity(pkg, appUid, channel.getId());
};
@@ -5848,7 +5850,7 @@
return false;
}
- MetricsLogger.action(mContext, MetricsEvent.ACTION_NOTE_CONTROLS);
+ mMetricsLogger.action(MetricsEvent.ACTION_NOTE_CONTROLS);
// ensure that it's laid but not visible until actually laid out
guts.setVisibility(View.INVISIBLE);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
index 9f56da7..09f6b55 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
@@ -23,14 +23,15 @@
import static org.mockito.Mockito.when;
import android.metrics.LogMaker;
-import android.metrics.MetricsReader;
import android.support.test.filters.FlakyTest;
import android.support.test.filters.SmallTest;
import android.support.test.metricshelper.MetricsAsserts;
import android.support.test.runner.AndroidJUnit4;
import android.util.DisplayMetrics;
+import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.logging.testing.FakeMetricsLogger;
import com.android.keyguard.KeyguardHostView.OnDismissAction;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.ActivatableNotificationView;
@@ -43,9 +44,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-// TODO(gpitsch): We have seen some flakes in these tests, needs some investigation.
-// Q: How is mMetricsReader being used by the tested code?
-// A: StatusBar uses MetricsLogger to write to the event log, then read back by MetricsReader
@SmallTest
@RunWith(AndroidJUnit4.class)
public class StatusBarTest extends SysuiTestCase {
@@ -55,8 +53,8 @@
KeyguardIndicationController mKeyguardIndicationController;
NotificationStackScrollLayout mStackScroller;
StatusBar mStatusBar;
+ FakeMetricsLogger mMetricsLogger;
- private MetricsReader mMetricsReader;
private DisplayMetrics mDisplayMetrics = new DisplayMetrics();
@Before
@@ -65,8 +63,9 @@
mUnlockMethodCache = mock(UnlockMethodCache.class);
mKeyguardIndicationController = mock(KeyguardIndicationController.class);
mStackScroller = mock(NotificationStackScrollLayout.class);
+ mMetricsLogger = new FakeMetricsLogger();
mStatusBar = new TestableStatusBar(mStatusBarKeyguardViewManager, mUnlockMethodCache,
- mKeyguardIndicationController, mStackScroller);
+ mKeyguardIndicationController, mStackScroller, mMetricsLogger);
doAnswer(invocation -> {
OnDismissAction onDismissAction = (OnDismissAction) invocation.getArguments()[0];
@@ -81,15 +80,6 @@
}).when(mStatusBarKeyguardViewManager).addAfterKeyguardGoneRunnable(any());
when(mStackScroller.getActivatedChild()).thenReturn(null);
-
- mMetricsReader = new MetricsReader();
- mMetricsReader.checkpoint(); // clear out old logs
- try {
- // pause so that no new events arrive in the rest of this millisecond.
- Thread.sleep(2);
- } catch (InterruptedException e) {
- // pass
- }
}
@Test
@@ -127,10 +117,10 @@
when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false);
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
when(mUnlockMethodCache.isMethodSecure()).thenReturn(false);
-
mStatusBar.onKeyguardViewManagerStatesUpdated();
- MetricsAsserts.assertHasLog("missing hidden insecure lockscreen log", mMetricsReader,
+ MetricsAsserts.assertHasLog("missing hidden insecure lockscreen log",
+ mMetricsLogger.getLogs(),
new LogMaker(MetricsEvent.LOCKSCREEN)
.setType(MetricsEvent.TYPE_CLOSE)
.setSubtype(0));
@@ -150,7 +140,8 @@
mStatusBar.onKeyguardViewManagerStatesUpdated();
- MetricsAsserts.assertHasLog("missing hidden secure lockscreen log", mMetricsReader,
+ MetricsAsserts.assertHasLog("missing hidden secure lockscreen log",
+ mMetricsLogger.getLogs(),
new LogMaker(MetricsEvent.LOCKSCREEN)
.setType(MetricsEvent.TYPE_CLOSE)
.setSubtype(1));
@@ -170,7 +161,8 @@
mStatusBar.onKeyguardViewManagerStatesUpdated();
- MetricsAsserts.assertHasLog("missing insecure lockscreen showing", mMetricsReader,
+ MetricsAsserts.assertHasLog("missing insecure lockscreen showing",
+ mMetricsLogger.getLogs(),
new LogMaker(MetricsEvent.LOCKSCREEN)
.setType(MetricsEvent.TYPE_OPEN)
.setSubtype(0));
@@ -190,7 +182,8 @@
mStatusBar.onKeyguardViewManagerStatesUpdated();
- MetricsAsserts.assertHasLog("missing secure lockscreen showing log", mMetricsReader,
+ MetricsAsserts.assertHasLog("missing secure lockscreen showing log",
+ mMetricsLogger.getLogs(),
new LogMaker(MetricsEvent.LOCKSCREEN)
.setType(MetricsEvent.TYPE_OPEN)
.setSubtype(1));
@@ -210,7 +203,8 @@
mStatusBar.onKeyguardViewManagerStatesUpdated();
- MetricsAsserts.assertHasLog("missing bouncer log", mMetricsReader,
+ MetricsAsserts.assertHasLog("missing bouncer log",
+ mMetricsLogger.getLogs(),
new LogMaker(MetricsEvent.BOUNCER)
.setType(MetricsEvent.TYPE_OPEN)
.setSubtype(1));
@@ -223,7 +217,8 @@
ActivatableNotificationView view = mock(ActivatableNotificationView.class);
mStatusBar.onActivated(view);
- MetricsAsserts.assertHasLog("missing lockscreen note tap log", mMetricsReader,
+ MetricsAsserts.assertHasLog("missing lockscreen note tap log",
+ mMetricsLogger.getLogs(),
new LogMaker(MetricsEvent.ACTION_LS_NOTE)
.setType(MetricsEvent.TYPE_ACTION));
}
@@ -231,11 +226,12 @@
static class TestableStatusBar extends StatusBar {
public TestableStatusBar(StatusBarKeyguardViewManager man,
UnlockMethodCache unlock, KeyguardIndicationController key,
- NotificationStackScrollLayout stack) {
+ NotificationStackScrollLayout stack, MetricsLogger logger) {
mStatusBarKeyguardViewManager = man;
mUnlockMethodCache = unlock;
mKeyguardIndicationController = key;
mStackScroller = stack;
+ mMetricsLogger = logger;
}
@Override
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index c45de0d..42446d1 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -3175,7 +3175,7 @@
DIALOG_SUPPORT_SYSTEM_INFORMATION = 756;
// These values should never appear in log outputs - they are reserved for
- // internal Tron use.
+ // internal platform metrics use.
RESERVED_FOR_LOGBUILDER_CATEGORY = 757;
RESERVED_FOR_LOGBUILDER_TYPE = 758;
RESERVED_FOR_LOGBUILDER_SUBTYPE = 759;
@@ -3282,7 +3282,7 @@
DEFAULT_AUTOFILL_PICKER = 792;
// These values should never appear in log outputs - they are reserved for
- // internal Tron use.
+ // internal platform metrics use.
NOTIFICATION_SINCE_CREATE_MILLIS = 793;
NOTIFICATION_SINCE_VISIBLE_MILLIS = 794;
NOTIFICATION_SINCE_UPDATE_MILLIS = 795;
@@ -3297,7 +3297,7 @@
QS_NFC = 800;
// These values should never appear in log outputs - they are reserved for
- // internal Tron use.
+ // internal platform metrics use.
RESERVED_FOR_LOGBUILDER_BUCKET = 801;
RESERVED_FOR_LOGBUILDER_VALUE = 802;
RESERVED_FOR_LOGBUILDER_COUNTER = 803;
@@ -3540,6 +3540,10 @@
// OS: N
ACTION_GET_CONTACT = 864;
+ // This values should never appear in log outputs - it is reserved for
+ // internal platform metrics use.
+ RESERVED_FOR_LOGBUILDER_PID = 865;
+
// ---- End O Constants, all O constants go above this line ----
// Add new aosp constants above this line.
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index ea9b651..0d5a3e0 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -289,7 +289,7 @@
* and then rebuild the cache. All under the cache lock. But that change is too
* large at this point.
*/
- final String removedPackageName = intent.getData().toString();
+ final String removedPackageName = intent.getData().getSchemeSpecificPart();
Runnable purgingRunnable = new Runnable() {
@Override
public void run() {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 10b1f2b..0a65cab 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -10247,13 +10247,8 @@
mWindowManager.setDockedStackCreateState(DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT,
null /* initialBounds */);
}
-
- final boolean successful = task.reparent(stackId, toTop,
+ task.reparent(stackId, toTop,
REPARENT_KEEP_STACK_AT_FRONT, ANIMATE, !DEFER_RESUME, "moveTaskToStack");
- if (successful && stackId == DOCKED_STACK_ID) {
- // If task moved to docked stack - show recents if needed.
- mWindowManager.showRecentApps(false /* fromHome */);
- }
} finally {
Binder.restoreCallingIdentity(ident);
}
@@ -10326,7 +10321,7 @@
*/
@Override
public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
- Rect initialBounds, boolean moveHomeStackFront) {
+ Rect initialBounds) {
enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "moveTaskToDockedStack()");
synchronized (this) {
long ident = Binder.clearCallingIdentity();
@@ -10343,12 +10338,9 @@
// Defer resuming until we move the home stack to the front below
final boolean moved = task.reparent(DOCKED_STACK_ID, toTop,
- REPARENT_KEEP_STACK_AT_FRONT, animate, DEFER_RESUME,
+ REPARENT_KEEP_STACK_AT_FRONT, animate, !DEFER_RESUME,
"moveTaskToDockedStack");
if (moved) {
- if (moveHomeStackFront) {
- mStackSupervisor.moveHomeStackToFront("moveTaskToDockedStack");
- }
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
}
return moved;
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index a679a31..15a9efc 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1582,6 +1582,16 @@
: STACK_INVISIBLE;
}
+ // Set home stack to invisible when it is below but not immediately below the docked stack
+ // A case would be if recents stack exists but has no tasks and is below the docked stack
+ // and home stack is below recents
+ if (mStackId == HOME_STACK_ID) {
+ int dockedStackIndex = mStacks.indexOf(mStackSupervisor.getStack(DOCKED_STACK_ID));
+ if (dockedStackIndex > stackIndex && stackIndex != dockedStackIndex - 1) {
+ return STACK_INVISIBLE;
+ }
+ }
+
// Find the first stack behind front stack that actually got something visible.
int stackBehindTopIndex = mStacks.indexOf(topStack) - 1;
while (stackBehindTopIndex >= 0 &&
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index bd70861..59f58d7 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -33,6 +33,7 @@
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
import static android.app.ActivityManager.StackId.LAST_STATIC_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
+import static android.app.ActivityManager.StackId.RECENTS_STACK_ID;
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
@@ -670,6 +671,13 @@
mHomeStack.moveToFront(reason);
}
+ void moveRecentsStackToFront(String reason) {
+ final ActivityStack recentsStack = getStack(RECENTS_STACK_ID);
+ if (recentsStack != null) {
+ recentsStack.moveToFront(reason);
+ }
+ }
+
/** Returns true if the focus activity was adjusted to the home stack top activity. */
boolean moveHomeStackTaskToTop(String reason) {
mHomeStack.moveHomeStackTaskToTop();
@@ -2048,6 +2056,11 @@
if (!createStaticStackIfNeeded || !StackId.isStaticStack(stackId)) {
return null;
}
+ if (stackId == DOCKED_STACK_ID) {
+ // Make sure recents stack exist when creating a dock stack as it normally need to be on
+ // the other side of the docked stack and we make visibility decisions based on that.
+ getStack(RECENTS_STACK_ID, CREATE_IF_NEEDED, createOnTop);
+ }
return (T) createStackOnDisplay(stackId, DEFAULT_DISPLAY, createOnTop);
}
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 3f33f41..c0c433e 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -690,6 +690,11 @@
}
kept = resize(bounds, RESIZE_MODE_FORCED, !mightReplaceWindow, deferResume);
} else if (stackId == DOCKED_STACK_ID || stackId == PINNED_STACK_ID) {
+ if (stackId == DOCKED_STACK_ID && moveStackMode == REPARENT_KEEP_STACK_AT_FRONT) {
+ // Move recents to front so it is not behind home stack when going into docked
+ // mode
+ mService.mStackSupervisor.moveRecentsStackToFront(reason);
+ }
kept = resize(toStack.mBounds, RESIZE_MODE_SYSTEM, !mightReplaceWindow,
deferResume);
}
@@ -713,7 +718,12 @@
supervisor.handleNonResizableTaskIfNeeded(this, preferredStackId, stackId);
- return (preferredStackId == stackId);
+ boolean successful = (preferredStackId == stackId);
+ if (successful && stackId == DOCKED_STACK_ID) {
+ // If task moved to docked stack - show recents if needed.
+ mService.mWindowManager.showRecentApps(false /* fromHome */);
+ }
+ return successful;
}
void cancelWindowTransition() {
diff --git a/services/core/java/com/android/server/vr/CompatibilityDisplay.java b/services/core/java/com/android/server/vr/CompatibilityDisplay.java
index 15edaaf..c54fd9a 100644
--- a/services/core/java/com/android/server/vr/CompatibilityDisplay.java
+++ b/services/core/java/com/android/server/vr/CompatibilityDisplay.java
@@ -2,8 +2,10 @@
package com.android.server.vr;
import android.app.Service;
+import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.content.IntentFilter;
import android.hardware.display.DisplayManager;
import android.hardware.display.VirtualDisplay;
import android.os.Build;
@@ -14,6 +16,7 @@
import android.service.vr.IVrStateCallbacks;
import android.service.vr.IVrManager;
import android.util.Log;
+import android.view.Surface;
import com.android.server.vr.VrManagerService;
@@ -26,10 +29,19 @@
private final static boolean DEBUG = false;
// TODO: Go over these values and figure out what is best
- private final static int HEIGHT = 960;
- private final static int WIDTH = 720;
+ private final static int HEIGHT = 1800;
+ private final static int WIDTH = 1400;
private final static int DPI = 320;
+ private final static String DEBUG_ACTION_SET_MODE =
+ "com.android.server.vr.CompatibilityDisplay.SET_MODE";
+ private final static String DEBUG_EXTRA_MODE_ON =
+ "com.android.servier.vr.CompatibilityDisplay.EXTRA_MODE_ON";
+ private final static String DEBUG_ACTION_SET_SURFACE =
+ "com.android.server.vr.CompatibilityDisplay.SET_SURFACE";
+ private final static String DEBUG_EXTRA_SURFACE =
+ "com.android.server.vr.CompatibilityDisplay.EXTRA_SURFACE";
+
private final DisplayManager mDisplayManager;
private final IVrManager mVrManager;
@@ -42,18 +54,14 @@
public void onVrStateChanged(boolean enabled) {
if (enabled != mIsVrModeEnabled) {
mIsVrModeEnabled = enabled;
- if (enabled) {
- // TODO: Consider not creating the display until ActivityManager needs one on
- // which to display a 2D application.
- startVirtualDisplay();
- } else {
- stopVirtualDisplay();
- }
+ updateVirtualDisplay();
}
}
};
private VirtualDisplay mVirtualDisplay;
+ private Surface mSurface;
+ private boolean mIsDebugOverrideEnabled;
private boolean mIsVrModeEnabled;
public CompatibilityDisplay(DisplayManager displayManager, IVrManager vrManager) {
@@ -64,8 +72,60 @@
/**
* Initializes the compabilitiy display by listening to VR mode changes.
*/
- public void init() {
+ public void init(Context context) {
startVrModeListener();
+ startDebugOnlyBroadcastReceiver(context);
+ }
+
+ private void updateVirtualDisplay() {
+ if (mIsVrModeEnabled || (DEBUG && mIsDebugOverrideEnabled)) {
+ // TODO: Consider not creating the display until ActivityManager needs one on
+ // which to display a 2D application.
+ // TODO: STOPSHIP Remove DEBUG conditional before launching.
+ if (DEBUG) {
+ startVirtualDisplay();
+ }
+ } else {
+ // TODO: Remove conditional when launching apps 2D doesn't force VrMode to stop.
+ if (!DEBUG) {
+ stopVirtualDisplay();
+ }
+ }
+ }
+
+ private void startDebugOnlyBroadcastReceiver(Context context) {
+ if (DEBUG) {
+ IntentFilter intentFilter = new IntentFilter(DEBUG_ACTION_SET_MODE);
+ intentFilter.addAction(DEBUG_ACTION_SET_SURFACE);
+
+ context.registerReceiver(new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+ if (DEBUG_ACTION_SET_MODE.equals(action)) {
+ mIsDebugOverrideEnabled =
+ intent.getBooleanExtra(DEBUG_EXTRA_MODE_ON, false);
+ updateVirtualDisplay();
+ } else if (DEBUG_ACTION_SET_SURFACE.equals(action)) {
+ if (mVirtualDisplay != null) {
+ final Surface newSurface =
+ intent.getParcelableExtra(DEBUG_EXTRA_SURFACE);
+
+ Log.i(TAG, "Setting the new surface from " + mSurface + " to " + newSurface);
+ if (newSurface != mSurface) {
+ mVirtualDisplay.setSurface(newSurface);
+ if (mSurface != null) {
+ mSurface.release();
+ }
+ mSurface = newSurface;
+ }
+ } else {
+ Log.w(TAG, "Cannot set the surface because the VD is null.");
+ }
+ }
+ }
+ }, intentFilter);
+ }
}
private void startVrModeListener() {
@@ -80,7 +140,7 @@
private void startVirtualDisplay() {
if (DEBUG) {
- Log.d(TAG, "Starting VD, DM:" + mDisplayManager);
+ Log.d(TAG, "Request to start VD, DM:" + mDisplayManager);
}
if (mDisplayManager == null) {
@@ -90,13 +150,16 @@
synchronized (vdLock) {
if (mVirtualDisplay != null) {
- Log.e(TAG, "Starting the virtual display when one already exists", new Exception());
+ Log.i(TAG, "VD already exists, ignoring request");
return;
}
mVirtualDisplay = mDisplayManager.createVirtualDisplay("VR 2D Display", WIDTH, HEIGHT,
- DPI,
- null /* Surface */, 0 /* flags */);
+ DPI, null /* Surface */, 0 /* flags */);
+ if (mSurface != null && mSurface.isValid()) {
+ // TODO: Need to protect all setSurface calls with a lock.
+ mVirtualDisplay.setSurface(mSurface);
+ }
}
if (DEBUG) {
diff --git a/services/core/java/com/android/server/vr/VrManagerService.java b/services/core/java/com/android/server/vr/VrManagerService.java
index 3df4d24..8a23173 100644
--- a/services/core/java/com/android/server/vr/VrManagerService.java
+++ b/services/core/java/com/android/server/vr/VrManagerService.java
@@ -26,6 +26,7 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.hardware.display.DisplayManager;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
@@ -131,6 +132,7 @@
private final NotificationAccessManager mNotifAccessManager = new NotificationAccessManager();
/** Tracks the state of the screen and keyguard UI.*/
private int mSystemSleepFlags = FLAG_AWAKE;
+ private CompatibilityDisplay mCompatibilityDisplay;
private static final int MSG_VR_STATE_CHANGE = 0;
private static final int MSG_PENDING_VR_STATE_CHANGE = 1;
@@ -537,6 +539,11 @@
} else {
Slog.i(TAG, "No default vr listener service found.");
}
+
+ DisplayManager dm =
+ (DisplayManager) getContext().getSystemService(Context.DISPLAY_SERVICE);
+ mCompatibilityDisplay = new CompatibilityDisplay(dm, mVrManager);
+ mCompatibilityDisplay.init(getContext());
} else if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
synchronized (mLock) {
mVrModeAllowed = true;
@@ -680,10 +687,10 @@
}
}
+ mCurrentVrModeComponent = calling;
if (calling != null && !Objects.equals(calling, mCurrentVrModeComponent)) {
sendUpdatedCaller = true;
}
- mCurrentVrModeComponent = calling;
if (mCurrentVrModeUser != userId) {
mCurrentVrModeUser = userId;
diff --git a/services/core/java/com/android/server/wm/TaskPositioner.java b/services/core/java/com/android/server/wm/TaskPositioner.java
index 90106a9..53c24e1 100644
--- a/services/core/java/com/android/server/wm/TaskPositioner.java
+++ b/services/core/java/com/android/server/wm/TaskPositioner.java
@@ -215,7 +215,7 @@
: DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
mService.mActivityManager.moveTaskToDockedStack(
mTask.mTaskId, createMode, true /*toTop*/, true /* animate */,
- null /* initialBounds */, false /* moveHomeStackFront */);
+ null /* initialBounds */);
}
} catch(RemoteException e) {}