Merge "Add self as OWNER for wm"
diff --git a/ProtoLibraries.bp b/ProtoLibraries.bp
index a0944d4..18c562b 100644
--- a/ProtoLibraries.bp
+++ b/ProtoLibraries.bp
@@ -21,10 +21,6 @@
"soong_zip",
],
- tool_files: [
- ":libprotobuf-internal-protos",
- ],
-
cmd: "mkdir -p $(genDir)/$(in) " +
"&& $(location aprotoc) " +
" --plugin=$(location protoc-gen-javastream) " +
@@ -43,6 +39,11 @@
"libs/incident/**/*.proto",
":service-permission-streaming-proto-sources",
],
+
+ data: [
+ ":libprotobuf-internal-protos",
+ ],
+
output_extension: "srcjar",
}
@@ -54,10 +55,6 @@
"protoc-gen-cppstream",
],
- tool_files: [
- ":libprotobuf-internal-protos",
- ],
-
cmd: "mkdir -p $(genDir) " +
"&& $(location aprotoc) " +
" --plugin=$(location protoc-gen-cppstream) " +
@@ -75,6 +72,10 @@
":service-permission-streaming-proto-sources",
],
+ data: [
+ ":libprotobuf-internal-protos",
+ ],
+
output_extension: "proto.h",
}
diff --git a/core/java/android/os/UserHandle.java b/core/java/android/os/UserHandle.java
index 3d5abb3..f9307b4b 100644
--- a/core/java/android/os/UserHandle.java
+++ b/core/java/android/os/UserHandle.java
@@ -597,12 +597,9 @@
@Override
public boolean equals(@Nullable Object obj) {
- try {
- if (obj != null) {
- UserHandle other = (UserHandle)obj;
- return mHandle == other.mHandle;
- }
- } catch (ClassCastException ignore) {
+ if (obj instanceof UserHandle) {
+ UserHandle other = (UserHandle) obj;
+ return mHandle == other.mHandle;
}
return false;
}
diff --git a/packages/SystemUI/plugin_core/Android.bp b/packages/SystemUI/plugin_core/Android.bp
index 34d31d9..4e39f1a 100644
--- a/packages/SystemUI/plugin_core/Android.bp
+++ b/packages/SystemUI/plugin_core/Android.bp
@@ -25,6 +25,9 @@
sdk_version: "current",
name: "PluginCoreLib",
srcs: ["src/**/*.java"],
+ optimize: {
+ proguard_flags_files: ["proguard.flags"],
+ },
// Enforce that the library is built against java 8 so that there are
// no compatibility issues with launcher
diff --git a/packages/SystemUI/plugin_core/proguard.flags b/packages/SystemUI/plugin_core/proguard.flags
new file mode 100644
index 0000000..6240898
--- /dev/null
+++ b/packages/SystemUI/plugin_core/proguard.flags
@@ -0,0 +1,11 @@
+# R8's full mode is a bit more aggressive in stripping annotations, but the
+# SystemUI plugin architecture requires these annotations at runtime. The
+# following rules are the minimal set necessary to ensure compatibility.
+# For more details, see:
+# https://r8.googlesource.com/r8/+/refs/heads/master/compatibility-faq.md#r8-full-mode
+-keepattributes RuntimeVisible*Annotation*,AnnotationDefault
+
+-keep interface com.android.systemui.plugins.annotations.** {
+ *;
+}
+-keep,allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification @com.android.systemui.plugins.annotations.** class *
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/OWNERS b/packages/SystemUI/tests/src/com/android/systemui/biometrics/OWNERS
index adb10f0..5420c37 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/OWNERS
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/OWNERS
@@ -1,4 +1,5 @@
set noparent
+# Bug component: 879035
include /services/core/java/com/android/server/biometrics/OWNERS
beverlyt@google.com
diff --git a/services/core/java/com/android/server/power/ThermalManagerService.java b/services/core/java/com/android/server/power/ThermalManagerService.java
index 96823c8a..0dbb280 100644
--- a/services/core/java/com/android/server/power/ThermalManagerService.java
+++ b/services/core/java/com/android/server/power/ThermalManagerService.java
@@ -547,6 +547,8 @@
@Override
public int onCommand(String cmd) {
switch(cmd != null ? cmd : "") {
+ case "inject-temperature":
+ return runInjectTemperature();
case "override-status":
return runOverrideStatus();
case "reset":
@@ -569,6 +571,95 @@
}
}
+
+ private int runInjectTemperature() {
+ final long token = Binder.clearCallingIdentity();
+ try {
+ final PrintWriter pw = getOutPrintWriter();
+ int type;
+ String typeName = getNextArgRequired();
+ switch (typeName.toUpperCase()) {
+ case "UNKNOWN":
+ type = Temperature.TYPE_UNKNOWN;
+ break;
+ case "CPU":
+ type = Temperature.TYPE_CPU;
+ break;
+ case "GPU":
+ type = Temperature.TYPE_GPU;
+ break;
+ case "BATTERY":
+ type = Temperature.TYPE_BATTERY;
+ break;
+ case "SKIN":
+ type = Temperature.TYPE_SKIN;
+ break;
+ case "USB_PORT":
+ type = Temperature.TYPE_USB_PORT;
+ break;
+ case "POWER_AMPLIFIER":
+ type = Temperature.TYPE_POWER_AMPLIFIER;
+ break;
+ case "BCL_VOLTAGE":
+ type = Temperature.TYPE_BCL_VOLTAGE;
+ break;
+ case "BCL_CURRENT":
+ type = Temperature.TYPE_BCL_CURRENT;
+ break;
+ case "BCL_PERCENTAGE":
+ type = Temperature.TYPE_BCL_PERCENTAGE;
+ break;
+ case "NPU":
+ type = Temperature.TYPE_NPU;
+ break;
+ default:
+ pw.println("Invalid temperature type: " + typeName);
+ return -1;
+ }
+ int throttle;
+ String throttleName = getNextArgRequired();
+ switch (throttleName.toUpperCase()) {
+ case "NONE":
+ throttle = Temperature.THROTTLING_NONE;
+ break;
+ case "LIGHT":
+ throttle = Temperature.THROTTLING_LIGHT;
+ break;
+ case "MODERATE":
+ throttle = Temperature.THROTTLING_MODERATE;
+ break;
+ case "SEVERE":
+ throttle = Temperature.THROTTLING_SEVERE;
+ break;
+ case "CRITICAL":
+ throttle = Temperature.THROTTLING_CRITICAL;
+ break;
+ case "EMERGENCY":
+ throttle = Temperature.THROTTLING_EMERGENCY;
+ break;
+ case "SHUTDOWN":
+ throttle = Temperature.THROTTLING_SHUTDOWN;
+ break;
+ default:
+ pw.println("Invalid throttle status: " + throttleName);
+ return -1;
+ }
+ String name = getNextArgRequired();
+ float value = 28.0f;
+ try {
+ String valueStr = getNextArg();
+ if (valueStr != null) value = Float.parseFloat(valueStr);
+ } catch (RuntimeException ex) {
+ pw.println("Error: " + ex.toString());
+ return -1;
+ }
+ onTemperatureChanged(new Temperature(value, type, name, throttle), true);
+ return 0;
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
private int runOverrideStatus() {
final long token = Binder.clearCallingIdentity();
try {
@@ -601,6 +692,9 @@
pw.println(" help");
pw.println(" Print this help text.");
pw.println("");
+ pw.println(" inject-temperature TYPE STATUS NAME [VALUE]");
+ pw.println(" injects a new temperature sample for the specified device.");
+ pw.println(" type and status strings follow the names in android.os.Temperature.");
pw.println(" override-status STATUS");
pw.println(" sets and locks the thermal status of the device to STATUS.");
pw.println(" status code is defined in android.os.Temperature.");