Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd83d703 authored by Tej Singh's avatar Tej Singh
Browse files

Enforce dump permission in stats service

Enforces the dump permission in stats service and fixes a typo in an
enum name.

Bug: b/77723108
Test: adb shell dumpsys stats as root and not root
Test: build success on marlin (and cts build success)
Change-Id: I131f97fe4fd370d50bc4ad369377f6adcca5f6ae
parent 5000367d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -243,6 +243,7 @@ $(call add-clean-step, rm -f $(OUT_DIR)/target/common/obj/APPS/FeatureSplit2_int
$(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
# ******************************************************************
+3 −0
Original line number Diff line number Diff line
@@ -172,6 +172,9 @@ status_t StatsService::onTransact(uint32_t code, const Parcel& data, Parcel* rep
 * 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
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ enum BatteryStatusEnum {
// 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;