[mob][photos] Hook faces into MachineLearningController

This commit is contained in:
laurenspriem
2024-05-14 18:09:38 +05:30
parent 17696c6665
commit df1ca5d583
2 changed files with 28 additions and 7 deletions

View File

@@ -25,6 +25,8 @@ class MachineLearningController {
bool _isRunningML = false;
late Timer _userInteractionTimer;
get canRunML => _isDeviceHealthy && !_isUserInteracting;
void init() {
if (Platform.isAndroid) {
_startInteractionTimer();
@@ -52,7 +54,7 @@ class MachineLearningController {
}
void _fireControlEvent() {
final shouldRunML = _isDeviceHealthy && !_isUserInteracting;
final shouldRunML = canRunML;
if (shouldRunML != _isRunningML) {
_isRunningML = shouldRunML;
_logger.info(