Android Lollipop Internals and our inferiority complex 
Presentation from droidcon Zagreb 2015
While going through JobScheduler internals try to answer the following question: How big is the gap between us and rockstar developers from Google or Square
intent.getAction(); if (Intent.ACTION_BATTERY_LOW.equals(action)) { [...] // If we get this action, the battery is discharging => it isn't plugged in so // there's no work to cancel. We track this variable for the case where it is // charging, but hasn't been for long enough to be healthy. mBatteryHealthy = false; } else if (Intent.ACTION_BATTERY_OKAY.equals(action)) { [...] mBatteryHealthy = true; maybeReportNewChargingState(); } [...] }
has been unused / // screen off or dreaming for at least this long private static final long INACTIVITY_IDLE_THRESHOLD = 71 * 60 * 1000; // millis; 71 min private static final long IDLE_WINDOW_SLOP = 5 * 60 * 1000; // 5 minute window, to be nice quotes are here ;-)
action = intent.getAction(); [...] } else if (action.equals(Intent.ACTION_SCREEN_OFF) || action.equals(Intent.ACTION_DREAMING_STARTED)) { // when the screen goes off or dreaming starts, we schedule the // alarm that will tell us when we have decided the device is // truly idle. final long nowElapsed = SystemClock.elapsedRealtime(); final long when = nowElapsed + INACTIVITY_IDLE_THRESHOLD; if (DEBUG) { Slog.v(TAG, "Scheduling idle : " + action + " now:" + nowElapsed + " when=" + when); } mAlarm.setWindow(AlarmManager.ELAPSED_REALTIME_WAKEUP, when, IDLE_WINDOW_SLOP, mIdleTriggerIntent); } [...]
not a rocket science there can cure from inferiority complex • write code to get better it always sucks with the first version gets better which each commit or PR