2

The article referenced in @mattm's answer is a bit outdated. IdleMaintenanceService was removed in Lollipop, things have changed. On Pie, scheduled fstrim is triggered from StorageManagerService (1) to MountService (2): if the device is alive at midnight + idle, fstrim gets run at the next available charging + idle time * (3) Mount service calls ...


Only top voted, non community-wiki answers of a minimum length are eligible