feat: fix critical bugs, optimize AppBlockerService battery usage, and add AI validation selector#30
feat: fix critical bugs, optimize AppBlockerService battery usage, and add AI validation selector#30Afrasyaab-GH wants to merge 5 commits into
Conversation
…ified AI validation engine selection
|
tchhh, you could've just made a custom quest for adding that nano gemini support |
|
i'd like to merge this but its been so long i last worked on this project that i don't remember a thing. so it will take a bit more time. |
No worries at all, please take all the time you need to review it! There is absolutely no rush.
Regarding the Nano support, a custom quest is definitely a cool alternative! We ended up building it directly into the AI Snap Quest pipeline so that users can seamlessly toggle between Cloud, Private API Key, and Local Offline (Nano/ONNX) validation engines depending on their device capabilities and privacy preferences. I also just pushed a few updates to address some critical crashes and UI bugs:
|
|
|
PLease someone test the QuestPhone Cloud Server Mode: Untested (I have not tested the default server/cloud-based validation engine). I will try to fix it but I can not promise |
Hi there! This Pull Request resolves several critical bugs in the navigation and sync layers, optimizes background service performance to prevent battery drain, resolves Android 14+ foreground service crashes, and introduces a unified AI Validation Engine settings configuration screen.
🛠️ Changes Made
1. Android 14+ Foreground Service Crash Fixes (New)
AppBlockerServiceType Update: Changed the service type fromdataSynctospecialUse(with subtypeapp_blocking_and_screentime_restrictionsin the manifest). This prevents the strict 24-hour runtime exhaustion limit on Android 14+ (which was throwingForegroundServiceStartNotAllowedException).startForegroundServiceinvocations intry-catchblocks acrossMainActivity,DeepFocusQuestView,OnboardingScreen, andAppListViewModelto safely handle background start restrictions without crashing.2. Navigation & Sync Bug Fixes
RootRoute.kt: CorrectedShowTutorialsroute string from"showTutorial{/"to"showTutorial/"to prevent navigation crashes.unSyncedQuestItemsandunSyncedStatsItemscollections in separatelaunchcoroutine builders so they execute in parallel. Stats are now successfully synced without getting blocked by the quest flow.StatsSyncWorker.kt: Changed the worker to mark stats as synced on thestatsRepositoryinstead of thequestRepository, resolving the infinite synchronization loop.FcmHandler.kt: Corrected the lookup key from"coins"to"gift_coins".UserRepository.kt: UpdatedactivateBoostto store the actual passediteminstead of hardcodingInventoryItem.XP_BOOSTER.ScreenUsageStatsHelper.ktandUsageStatsHelper.ktto prevent start time constraints from being silently discarded.3. AppBlockerService battery & UI optimizations
AppBlockerService.ktto run the 100ms polling loop on a dedicated background thread (HandlerThread"AppBlockerMonitor") instead of the main/UI thread.loadUnlockedAppsFromServer()) from the tight 100ms loop and set up cache updates reactively.4. AI Validation Selector Settings & Failure Recovery UI
ModelDownloadDialognow automatically switches your active engine to"local".ORT_INVALID_PROTOBUFerrors during load time on ONNX Runtime), which remain unresolved. Selecting local models will show a description dialog but may fail during evaluation.