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

Commit 7f2c91fc authored by Mao Jinlong's avatar Mao Jinlong Committed by Gerrit - the friendly Code Review server
Browse files

Shutdown : Add factory data reset check for timezone persist file

Clear value in POWER_OFF_ALARM_TIMEZONE_FILE when factory data reset to
avoid time zone not being reset after factory data reset.

Change-Id: Icb83591d566f67645e77c853d00b7bcf34e7fee4
CRs-Fixed: 1087103
parent cb366e6b
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -524,8 +524,13 @@ public final class ShutdownThread extends Thread {
                    AlarmManager.POWER_OFF_ALARM_HANDLED);
        }

        // If it is factory data reset, value in POWER_OFF_ALARM_TIMEZONE_FILE will be cleared.
        if (mReboot && PowerManager.REBOOT_RECOVERY.equals(mReason)) {
            AlarmManager.writePowerOffAlarmFile(AlarmManager.POWER_OFF_ALARM_TIMEZONE_FILE, "");
        } else {
            AlarmManager.writePowerOffAlarmFile(AlarmManager.POWER_OFF_ALARM_TIMEZONE_FILE,
                    SystemProperties.get("persist.sys.timezone"));
        }
        rebootOrShutdown(mContext, mReboot, mReason);
    }