Revert "Revert "Fix a bootloop problem when /data/system/usagestats/usage-history.xml is empty.""

This reverts commit b2c0a004aa1be54eb21a79f001d42b34ca5086d8.