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

Commit feff951d authored by Alex Johnston's avatar Alex Johnston
Browse files

Add metrics logging for setTime and setTimeZone

Bug: 148841428
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetTime
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetTimeZone

Change-Id: I9588d1259026f7a4c655a10407fbc90dbef309ca
parent eb241932
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -157,4 +157,6 @@ enum EventId {
  SET_FACTORY_RESET_PROTECTION = 130;
  SET_COMMON_CRITERIA_MODE = 131;
  ALLOW_MODIFICATION_OF_ADMIN_CONFIGURED_NETWORKS = 132;
  SET_TIME = 133;
  SET_TIME_ZONE = 134;
}
+10 −0
Original line number Diff line number Diff line
@@ -11583,6 +11583,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                millis, "DevicePolicyManagerService: setTime");
        mInjector.binderWithCleanCallingIdentity(
                () -> mInjector.getTimeDetector().suggestManualTime(manualTimeSuggestion));
        DevicePolicyEventLogger
                .createEvent(DevicePolicyEnums.SET_TIME)
                .setAdmin(who)
                .write();
        return true;
    }
@@ -11599,6 +11604,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                        timeZone, "DevicePolicyManagerService: setTimeZone");
        mInjector.binderWithCleanCallingIdentity(() ->
                mInjector.getTimeZoneDetector().suggestManualTimeZone(manualTimeZoneSuggestion));
        DevicePolicyEventLogger
                .createEvent(DevicePolicyEnums.SET_TIME_ZONE)
                .setAdmin(who)
                .write();
        return true;
    }