Loading services/core/java/com/android/server/am/OomAdjuster.java +8 −9 Original line number Diff line number Diff line Loading @@ -1287,7 +1287,7 @@ public abstract class OomAdjuster { @GuardedBy({"mService", "mProcLock"}) protected void updateAppUidRecIfNecessaryLSP(final ProcessRecord app) { if (!app.isKilledByAm() && app.isProcessRunning()) { if (app.isolated && app.mServices.numberOfRunningServices() <= 0 if (app.isolated && app.getServices().numberOfRunningServices() <= 0 && app.getIsolatedEntryPoint() == null) { // No op. } else { Loading @@ -1298,18 +1298,17 @@ public abstract class OomAdjuster { } @GuardedBy({"mService", "mProcLock"}) private void updateAppUidRecLSP(ProcessRecord app) { private void updateAppUidRecLSP(ProcessRecordInternal app) { final UidRecordInternal uidRec = app.getUidRecord(); if (uidRec != null) { final ProcessRecordInternal state = app; uidRec.setEphemeral(app.info.isInstantApp()); if (uidRec.getCurProcState() > state.getCurProcState()) { uidRec.setCurProcState(state.getCurProcState()); uidRec.setEphemeral(app.isInstantApp()); if (uidRec.getCurProcState() > app.getCurProcState()) { uidRec.setCurProcState(app.getCurProcState()); } if (app.mServices.hasForegroundServices()) { if (app.getServices().hasForegroundServices()) { uidRec.setHasForegroundServices(true); } uidRec.setCurCapability(uidRec.getCurCapability() | state.getCurCapability()); uidRec.setCurCapability(uidRec.getCurCapability() | app.getCurCapability()); } } Loading Loading @@ -2303,7 +2302,7 @@ public abstract class OomAdjuster { mService.mHandler.post(() -> { synchronized (mService) { mService.mServices.stopAllForegroundServicesLocked( app.uid, app.info.packageName); app.uid, app.getPackageName()); } }); } Loading services/core/java/com/android/server/am/ProcessRecord.java +10 −0 Original line number Diff line number Diff line Loading @@ -1225,6 +1225,16 @@ class ProcessRecord extends ProcessRecordInternal implements WindowProcessListen return info.uid; } @Override public String getPackageName() { return info.packageName; } @Override public boolean isInstantApp() { return info.isInstantApp(); } @Override public long getLastPss() { return mProfile.getLastPss(); Loading services/core/java/com/android/server/am/psc/ProcessRecordInternal.java +6 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,12 @@ public abstract class ProcessRecordInternal { */ public abstract int getApplicationUid(); /** Returns the package name of the application this process belongs to. */ public abstract String getPackageName(); /** Returns whether this process is for an instant app. */ public abstract boolean isInstantApp(); /** Returns the {@link UidRecordInternal} associated with this process. */ public abstract UidRecordInternal getUidRecord(); Loading Loading
services/core/java/com/android/server/am/OomAdjuster.java +8 −9 Original line number Diff line number Diff line Loading @@ -1287,7 +1287,7 @@ public abstract class OomAdjuster { @GuardedBy({"mService", "mProcLock"}) protected void updateAppUidRecIfNecessaryLSP(final ProcessRecord app) { if (!app.isKilledByAm() && app.isProcessRunning()) { if (app.isolated && app.mServices.numberOfRunningServices() <= 0 if (app.isolated && app.getServices().numberOfRunningServices() <= 0 && app.getIsolatedEntryPoint() == null) { // No op. } else { Loading @@ -1298,18 +1298,17 @@ public abstract class OomAdjuster { } @GuardedBy({"mService", "mProcLock"}) private void updateAppUidRecLSP(ProcessRecord app) { private void updateAppUidRecLSP(ProcessRecordInternal app) { final UidRecordInternal uidRec = app.getUidRecord(); if (uidRec != null) { final ProcessRecordInternal state = app; uidRec.setEphemeral(app.info.isInstantApp()); if (uidRec.getCurProcState() > state.getCurProcState()) { uidRec.setCurProcState(state.getCurProcState()); uidRec.setEphemeral(app.isInstantApp()); if (uidRec.getCurProcState() > app.getCurProcState()) { uidRec.setCurProcState(app.getCurProcState()); } if (app.mServices.hasForegroundServices()) { if (app.getServices().hasForegroundServices()) { uidRec.setHasForegroundServices(true); } uidRec.setCurCapability(uidRec.getCurCapability() | state.getCurCapability()); uidRec.setCurCapability(uidRec.getCurCapability() | app.getCurCapability()); } } Loading Loading @@ -2303,7 +2302,7 @@ public abstract class OomAdjuster { mService.mHandler.post(() -> { synchronized (mService) { mService.mServices.stopAllForegroundServicesLocked( app.uid, app.info.packageName); app.uid, app.getPackageName()); } }); } Loading
services/core/java/com/android/server/am/ProcessRecord.java +10 −0 Original line number Diff line number Diff line Loading @@ -1225,6 +1225,16 @@ class ProcessRecord extends ProcessRecordInternal implements WindowProcessListen return info.uid; } @Override public String getPackageName() { return info.packageName; } @Override public boolean isInstantApp() { return info.isInstantApp(); } @Override public long getLastPss() { return mProfile.getLastPss(); Loading
services/core/java/com/android/server/am/psc/ProcessRecordInternal.java +6 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,12 @@ public abstract class ProcessRecordInternal { */ public abstract int getApplicationUid(); /** Returns the package name of the application this process belongs to. */ public abstract String getPackageName(); /** Returns whether this process is for an instant app. */ public abstract boolean isInstantApp(); /** Returns the {@link UidRecordInternal} associated with this process. */ public abstract UidRecordInternal getUidRecord(); Loading