Decrease frequency of high temp warnings

Instead of showing any time the temp is above throttling temp,
if the user has dismissed the notification (or clicked it), the notification
will not reshow until the temperature has gone below the throttling
temp and come back.

Test: manual
Change-Id: I4cef9144dfcff03a5e70ccd5b12efaab1e74d15b
Fixes: 34346625
This commit is contained in:
Andrew Sapperstein
2017-01-24 16:38:50 -08:00
parent 0a26aa9b31
commit 97bfa0f17d

View File

@@ -215,8 +215,16 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
return;
}
mTempWarning = false;
mNoMan.cancelAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_HIGH_TEMP,
UserHandle.ALL);
dismissTemperatureWarningInternal();
}
/**
* Internal only version of {@link #dismissTemperatureWarning()} that simply dismisses
* the notification. As such, the notification will not show again until
* {@link #dismissTemperatureWarning()} is called.
*/
private void dismissTemperatureWarningInternal() {
mNoMan.cancelAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_HIGH_TEMP, UserHandle.ALL);
}
@Override
@@ -388,10 +396,10 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
} else if (action.equals(ACTION_DISMISSED_WARNING)) {
dismissLowBatteryWarning();
} else if (ACTION_CLICKED_TEMP_WARNING.equals(action)) {
dismissTemperatureWarning();
dismissTemperatureWarningInternal();
showTemperatureDialog();
} else if (ACTION_DISMISSED_TEMP_WARNING.equals(action)) {
dismissTemperatureWarning();
dismissTemperatureWarningInternal();
}
}
}