Merge "Enforce dump permission in stats service" into pi-dev
am: abdf6e8039
Change-Id: I0034bd5f4452a0c8b68f9e261434897e03ab83c7
diff --git a/CleanSpec.mk b/CleanSpec.mk
index e728897..2e949c5 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -243,6 +243,7 @@
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/hardware)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates/core/java/android/os/storage/*)
$(call add-clean-step, rm -rf $(OUT_DIR)/host/common/obj/JAVA_LIBRARIES/platformprotos_intermediates)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/statsdprotolite_intermediates)
# ******************************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST ABOVE THIS BANNER
# ******************************************************************
diff --git a/cmds/statsd/src/StatsService.cpp b/cmds/statsd/src/StatsService.cpp
index 8545d76..d025337 100644
--- a/cmds/statsd/src/StatsService.cpp
+++ b/cmds/statsd/src/StatsService.cpp
@@ -244,6 +244,9 @@
* Write debugging data about statsd.
*/
status_t StatsService::dump(int fd, const Vector<String16>& args) {
+ if (!checkCallingPermission(String16(kPermissionDump))) {
+ return PERMISSION_DENIED;
+ }
FILE* out = fdopen(fd, "w");
if (out == NULL) {
return NO_MEMORY; // the fd is already open
diff --git a/core/proto/android/os/enums.proto b/core/proto/android/os/enums.proto
index aa99ac7..db4a4c4 100644
--- a/core/proto/android/os/enums.proto
+++ b/core/proto/android/os/enums.proto
@@ -60,7 +60,7 @@
// They are primarily used by android/os/HardwarePropertiesManager.java.
// Any change to the types in the thermal hal should be made here as well.
enum TemperatureTypeEnum {
- TEMPERATURE_TYPE_UKNOWN = -1;
+ TEMPERATURE_TYPE_UNKNOWN = -1;
TEMPERATURE_TYPE_CPU = 0;
TEMPERATURE_TYPE_GPU = 1;
TEMPERATURE_TYPE_BATTERY = 2;