Skip to content

Commit

Permalink
fix: Request permissions a single time at boot
Browse files Browse the repository at this point in the history
  • Loading branch information
ponces committed Sep 16, 2022
1 parent a3dca8c commit 9c3626c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/ui/views/navigation/navigation_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ class NavigationViewModel extends IndexTrackingViewModel {
: Brightness.light,
),
);
RootAPI().hasRootPermissions();
Permission.requestInstallPackages.request();
Permission.ignoreBatteryOptimizations.request();
if (prefs.getBool('permissionsRequested') == null) {
await prefs.setBool('permissionsRequested', true);
RootAPI().hasRootPermissions();
Permission.requestInstallPackages.request();
Permission.ignoreBatteryOptimizations.request();
}
}

Widget getViewForIndex(int index) {
Expand Down

0 comments on commit 9c3626c

Please sign in to comment.