Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3045555 authored by Steve Kondik's avatar Steve Kondik
Browse files

Revert "Move wakelock check in AM after all other processing."

This reverts commit 0738f2c9.

Will revisit, this isn't correct.
parent f40f89a9
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -13181,6 +13181,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
            // counts as being in the foreground.
            adj = FOREGROUND_APP_ADJ;
            app.adjType = "exec-service";
        } else if (mUidWakeLocks.get(app.info.uid) != null) {
            // An app that is currently holding a wakelock also
            // counts as being in the foreground.
            adj = FOREGROUND_APP_ADJ;
            app.adjType = "wakelock";
        } else if (app.foregroundServices) {
            // The user is aware of this app, so make it visible.
            adj = VISIBLE_APP_ADJ;
@@ -13373,21 +13378,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
            adj = app.maxAdj;
        }
        app.curAdj = adj;
        app.curSchedGroup = adj > VISIBLE_APP_ADJ
                ? Process.THREAD_GROUP_BG_NONINTERACTIVE
                : Process.THREAD_GROUP_DEFAULT;
        
        // An app that is currently holding a wakelock also
        // counts as being in the foreground.
        // We do this after setting the schedgroup so that it can't
        // escalate beyond it's original priority
        if (mUidWakeLocks.get(app.info.uid) != null) {
            adj = FOREGROUND_APP_ADJ;
            app.adjType = "wakelock";
        } 
        
        app.curAdj = adj;
        
        return adj;
    }