Add an automatic storage management job service.

This service runs once a day when plugged in when the device has
under 15% free space remaining. If the FeatureFactory has a
storage management job, it runs the job to begin to free up space
on the device.

This is a temporary landing place and will be refactored very
quickly out of Settings.

Bug: 28600825

Change-Id: Id2ebb42a333b3b4e3daef4e50cf985fe055b85c7
This commit is contained in:
Daniel Nishi
2016-05-04 10:08:36 -07:00
parent 74cc9772e9
commit 80c204420b
9 changed files with 237 additions and 2 deletions

View File

@@ -0,0 +1,40 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.overlay;
import android.app.job.JobParameters;
import android.content.Context;
/**
* Feature provider for automatic storage management jobs.
*/
public interface StorageManagementJobProvider {
/**
* Starts an asynchronous deletion job to clear out storage older than
* @param params Standard JobService parameters.
* @param daysToRetain Number of days of information to retain on the device.
* @return If the job needs to process the work on a separate thread.
*/
boolean onStartJob(Context context, JobParameters params, int daysToRetain);
/**
* Attempt to stop the execution of the job.
* @param params Parameters specifying info about this job.
* @return If the job should be rescheduled.
*/
boolean onStopJob(Context context, JobParameters params);
}