Loading apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -29,14 +29,16 @@ import java.util.function.Consumer; /** * Provides access to the centralized AppSearch index maintained by the system. * * <p>AppSearch is a search library for managing structured data featuring: * <p>AppSearch is an offline, on-device search library for managing structured data featuring: * * <ul> * <li>A fully offline on-device solution * <li>A set of APIs for applications to index documents and retrieve them via full-text search * <li>APIs for applications to allow the System to display their content on system UI surfaces * <li>Similarly, APIs for applications to allow the System to share their content with other * specified applications. * <li>APIs to index and retrieve data via full-text search. * <li>An API for applications to explicitly grant read-access permission of their data to other * applications. * <b>See: {@link SetSchemaRequest.Builder#setSchemaTypeVisibilityForPackage}</b> * <li>An API for applications to opt into or out of having their data displayed on System UI * surfaces by the System-designated global querier. * <b>See: {@link SetSchemaRequest.Builder#setSchemaTypeDisplayedBySystem}</b> * </ul> * * <p>Applications create a database by opening an {@link AppSearchSession}. Loading apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -283,9 +283,10 @@ public class PowerExemptionManager { */ public static final int REASON_PACKAGE_REPLACED = 311; /** * LocationProviderManager. * LocationProvider. * @hide */ @SystemApi public static final int REASON_LOCATION_PROVIDER = 312; /** * MediaButtonReceiver. Loading apex/jobscheduler/framework/java/android/os/PowerWhitelistManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -284,9 +284,10 @@ public class PowerWhitelistManager { */ public static final int REASON_PACKAGE_REPLACED = PowerExemptionManager.REASON_PACKAGE_REPLACED; /** * LocationProviderManager. * LocationProvider. * @hide */ @SystemApi public static final int REASON_LOCATION_PROVIDER = PowerExemptionManager.REASON_LOCATION_PROVIDER; /** Loading apex/jobscheduler/service/java/com/android/server/job/JobConcurrencyManager.java +5 −1 Original line number Diff line number Diff line Loading @@ -798,7 +798,8 @@ class JobConcurrencyManager { private void startJobLocked(@NonNull JobServiceContext worker, @NonNull JobStatus jobStatus, @WorkType final int workType) { final List<StateController> controllers = mService.mControllers; for (int ic = 0; ic < controllers.size(); ic++) { final int numControllers = controllers.size(); for (int ic = 0; ic < numControllers; ic++) { controllers.get(ic).prepareForExecutionLocked(jobStatus); } final PackageStats packageStats = Loading @@ -807,6 +808,9 @@ class JobConcurrencyManager { if (!worker.executeRunnableJob(jobStatus, workType)) { Slog.e(TAG, "Error executing " + jobStatus); mWorkCountTracker.onStagedJobFailed(workType); for (int ic = 0; ic < numControllers; ic++) { controllers.get(ic).unprepareFromExecutionLocked(jobStatus); } } else { mRunningJobs.add(jobStatus); mWorkCountTracker.onJobStarted(workType); Loading apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java +18 −11 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public final class ConnectivityController extends RestrictingController implemen || Log.isLoggable(TAG, Log.DEBUG); // The networking stack has a hard limit so we can't make this configurable. private static final int MAX_NETWORK_CALLBACKS = 50; private static final int MAX_NETWORK_CALLBACKS = 125; /** * Minimum amount of time that should have elapsed before we'll update a {@link UidStats} * instance. Loading Loading @@ -148,7 +148,8 @@ public final class ConnectivityController extends RestrictingController implemen // 9. Enqueue time // TODO: maybe consider number of jobs // TODO: consider IMPORTANT_WHILE_FOREGROUND bit final int runningPriority = prioritizeExistenceOver(0, us1.numRunning, us2.numRunning); final int runningPriority = prioritizeExistenceOver(0, us1.runningJobs.size(), us2.runningJobs.size()); if (runningPriority != 0) { return runningPriority; } Loading Loading @@ -256,7 +257,18 @@ public final class ConnectivityController extends RestrictingController implemen if (jobStatus.hasConnectivityConstraint()) { final UidStats uidStats = getUidStats(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), true); uidStats.numRunning++; uidStats.runningJobs.add(jobStatus); } } @GuardedBy("mLock") @Override public void unprepareFromExecutionLocked(JobStatus jobStatus) { if (jobStatus.hasConnectivityConstraint()) { final UidStats uidStats = getUidStats(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), true); uidStats.runningJobs.remove(jobStatus); postAdjustCallbacks(); } } Loading @@ -272,12 +284,7 @@ public final class ConnectivityController extends RestrictingController implemen final UidStats uidStats = getUidStats(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), true); uidStats.numReadyWithConnectivity--; if (jobStatus.madeActive != 0) { // numRunning would be 0 if the UidStats object didn't exist before this method // was called. getUidStats() handles logging, so just make sure we don't save a // negative value. uidStats.numRunning = Math.max(0, uidStats.numRunning - 1); } uidStats.runningJobs.remove(jobStatus); maybeRevokeStandbyExceptionLocked(jobStatus); postAdjustCallbacks(); } Loading Loading @@ -1151,7 +1158,7 @@ public final class ConnectivityController extends RestrictingController implemen private static class UidStats { public final int uid; public int basePriority; public int numRunning; public final ArraySet<JobStatus> runningJobs = new ArraySet<>(); public int numReadyWithConnectivity; public int numRequestedNetworkAvailable; public int numEJs; Loading @@ -1168,7 +1175,7 @@ public final class ConnectivityController extends RestrictingController implemen pw.print("UidStats{"); pw.print("uid", uid); pw.print("pri", basePriority); pw.print("#run", numRunning); pw.print("#run", runningJobs.size()); pw.print("#readyWithConn", numReadyWithConnectivity); pw.print("#netAvail", numRequestedNetworkAvailable); pw.print("#EJs", numEJs); Loading Loading
apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -29,14 +29,16 @@ import java.util.function.Consumer; /** * Provides access to the centralized AppSearch index maintained by the system. * * <p>AppSearch is a search library for managing structured data featuring: * <p>AppSearch is an offline, on-device search library for managing structured data featuring: * * <ul> * <li>A fully offline on-device solution * <li>A set of APIs for applications to index documents and retrieve them via full-text search * <li>APIs for applications to allow the System to display their content on system UI surfaces * <li>Similarly, APIs for applications to allow the System to share their content with other * specified applications. * <li>APIs to index and retrieve data via full-text search. * <li>An API for applications to explicitly grant read-access permission of their data to other * applications. * <b>See: {@link SetSchemaRequest.Builder#setSchemaTypeVisibilityForPackage}</b> * <li>An API for applications to opt into or out of having their data displayed on System UI * surfaces by the System-designated global querier. * <b>See: {@link SetSchemaRequest.Builder#setSchemaTypeDisplayedBySystem}</b> * </ul> * * <p>Applications create a database by opening an {@link AppSearchSession}. Loading
apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -283,9 +283,10 @@ public class PowerExemptionManager { */ public static final int REASON_PACKAGE_REPLACED = 311; /** * LocationProviderManager. * LocationProvider. * @hide */ @SystemApi public static final int REASON_LOCATION_PROVIDER = 312; /** * MediaButtonReceiver. Loading
apex/jobscheduler/framework/java/android/os/PowerWhitelistManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -284,9 +284,10 @@ public class PowerWhitelistManager { */ public static final int REASON_PACKAGE_REPLACED = PowerExemptionManager.REASON_PACKAGE_REPLACED; /** * LocationProviderManager. * LocationProvider. * @hide */ @SystemApi public static final int REASON_LOCATION_PROVIDER = PowerExemptionManager.REASON_LOCATION_PROVIDER; /** Loading
apex/jobscheduler/service/java/com/android/server/job/JobConcurrencyManager.java +5 −1 Original line number Diff line number Diff line Loading @@ -798,7 +798,8 @@ class JobConcurrencyManager { private void startJobLocked(@NonNull JobServiceContext worker, @NonNull JobStatus jobStatus, @WorkType final int workType) { final List<StateController> controllers = mService.mControllers; for (int ic = 0; ic < controllers.size(); ic++) { final int numControllers = controllers.size(); for (int ic = 0; ic < numControllers; ic++) { controllers.get(ic).prepareForExecutionLocked(jobStatus); } final PackageStats packageStats = Loading @@ -807,6 +808,9 @@ class JobConcurrencyManager { if (!worker.executeRunnableJob(jobStatus, workType)) { Slog.e(TAG, "Error executing " + jobStatus); mWorkCountTracker.onStagedJobFailed(workType); for (int ic = 0; ic < numControllers; ic++) { controllers.get(ic).unprepareFromExecutionLocked(jobStatus); } } else { mRunningJobs.add(jobStatus); mWorkCountTracker.onJobStarted(workType); Loading
apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java +18 −11 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public final class ConnectivityController extends RestrictingController implemen || Log.isLoggable(TAG, Log.DEBUG); // The networking stack has a hard limit so we can't make this configurable. private static final int MAX_NETWORK_CALLBACKS = 50; private static final int MAX_NETWORK_CALLBACKS = 125; /** * Minimum amount of time that should have elapsed before we'll update a {@link UidStats} * instance. Loading Loading @@ -148,7 +148,8 @@ public final class ConnectivityController extends RestrictingController implemen // 9. Enqueue time // TODO: maybe consider number of jobs // TODO: consider IMPORTANT_WHILE_FOREGROUND bit final int runningPriority = prioritizeExistenceOver(0, us1.numRunning, us2.numRunning); final int runningPriority = prioritizeExistenceOver(0, us1.runningJobs.size(), us2.runningJobs.size()); if (runningPriority != 0) { return runningPriority; } Loading Loading @@ -256,7 +257,18 @@ public final class ConnectivityController extends RestrictingController implemen if (jobStatus.hasConnectivityConstraint()) { final UidStats uidStats = getUidStats(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), true); uidStats.numRunning++; uidStats.runningJobs.add(jobStatus); } } @GuardedBy("mLock") @Override public void unprepareFromExecutionLocked(JobStatus jobStatus) { if (jobStatus.hasConnectivityConstraint()) { final UidStats uidStats = getUidStats(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), true); uidStats.runningJobs.remove(jobStatus); postAdjustCallbacks(); } } Loading @@ -272,12 +284,7 @@ public final class ConnectivityController extends RestrictingController implemen final UidStats uidStats = getUidStats(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), true); uidStats.numReadyWithConnectivity--; if (jobStatus.madeActive != 0) { // numRunning would be 0 if the UidStats object didn't exist before this method // was called. getUidStats() handles logging, so just make sure we don't save a // negative value. uidStats.numRunning = Math.max(0, uidStats.numRunning - 1); } uidStats.runningJobs.remove(jobStatus); maybeRevokeStandbyExceptionLocked(jobStatus); postAdjustCallbacks(); } Loading Loading @@ -1151,7 +1158,7 @@ public final class ConnectivityController extends RestrictingController implemen private static class UidStats { public final int uid; public int basePriority; public int numRunning; public final ArraySet<JobStatus> runningJobs = new ArraySet<>(); public int numReadyWithConnectivity; public int numRequestedNetworkAvailable; public int numEJs; Loading @@ -1168,7 +1175,7 @@ public final class ConnectivityController extends RestrictingController implemen pw.print("UidStats{"); pw.print("uid", uid); pw.print("pri", basePriority); pw.print("#run", numRunning); pw.print("#run", runningJobs.size()); pw.print("#readyWithConn", numReadyWithConnectivity); pw.print("#netAvail", numRequestedNetworkAvailable); pw.print("#EJs", numEJs); Loading