/** * Load the current Gservices settings for when * {@link #shouldWeBeBrutalLocked} will allow the brutality to happen. * Must not be called with the lock held. */ void retrieveBrutalityAmount() { mMinScreenOff = (mReqMinScreenOff >= 0 ? mReqMinScreenOff : Settings.Gservices.getInt( mResolver, Settings.Gservices.MEMCHECK_MIN_SCREEN_OFF, MEMCHECK_DEFAULT_MIN_SCREEN_OFF)) * 1000; mMinAlarm = (mReqMinNextAlarm >= 0 ? mReqMinNextAlarm : Settings.Gservices.getInt( mResolver, Settings.Gservices.MEMCHECK_MIN_ALARM, MEMCHECK_DEFAULT_MIN_ALARM)) * 1000; }
/** * Determine whether it is a good time to kill, crash, or otherwise * plunder the current situation for the overall long-term benefit of * the world. * * @param curTime The current system time. * @return Returns null if this is a good time, else a String with the * text of why it is not a good time. */ String shouldWeBeBrutalLocked(long curTime) { if (mBattery == null || !mBattery.isPowered()) { return "battery"; }