summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-11-26 10:34:45 +0000
committerNarayan Kamath <narayan@google.com>2014-11-26 10:39:08 +0000
commit7377998dac67ce8d486e11b9bd2f159fe0ca501d (patch)
tree00b4acd48899dd96171e285c1bf857028461cab6 /core/java/android
parent9da0881ffbcdc566cc1bf60b817ab4f617d0049a (diff)
parenta42f7c1d4247a940258a04bae839dccb28219823 (diff)
resolved conflicts for merge of a42f7c1d to lmp-sprout-dev
Change-Id: I8e53c9d7e0014b4ffc621c561b737aa2dae5460c
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/os/storage/IMountService.java63
-rw-r--r--core/java/android/provider/Settings.java7
2 files changed, 70 insertions, 0 deletions
diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java
index cf407f401844..116110eba74d 100644
--- a/core/java/android/os/storage/IMountService.java
+++ b/core/java/android/os/storage/IMountService.java
@@ -856,6 +856,38 @@ public interface IMountService extends IInterface {
}
return _result;
}
+
+ @Override
+ public long lastMaintenance() throws RemoteException {
+ Parcel _data = Parcel.obtain();
+ Parcel _reply = Parcel.obtain();
+ long _result;
+ try {
+ _data.writeInterfaceToken(DESCRIPTOR);
+ mRemote.transact(Stub.TRANSACTION_lastMaintenance, _data, _reply, 0);
+ _reply.readException();
+ _result = _reply.readLong();
+ } finally {
+ _reply.recycle();
+ _data.recycle();
+ }
+ return _result;
+ }
+
+ @Override
+ public void runMaintenance() throws RemoteException {
+ Parcel _data = Parcel.obtain();
+ Parcel _reply = Parcel.obtain();
+ try {
+ _data.writeInterfaceToken(DESCRIPTOR);
+ mRemote.transact(Stub.TRANSACTION_runMaintenance, _data, _reply, 0);
+ _reply.readException();
+ } finally {
+ _reply.recycle();
+ _data.recycle();
+ }
+ return;
+ }
}
private static final String DESCRIPTOR = "IMountService";
@@ -942,6 +974,10 @@ public interface IMountService extends IInterface {
static final int TRANSACTION_resizeSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 40;
+ static final int TRANSACTION_lastMaintenance = IBinder.FIRST_CALL_TRANSACTION + 41;
+
+ static final int TRANSACTION_runMaintenance = IBinder.FIRST_CALL_TRANSACTION + 42;
+
/**
* Cast an IBinder object into an IMountService interface, generating a
* proxy if needed.
@@ -1347,6 +1383,19 @@ public interface IMountService extends IInterface {
reply.writeInt(resultCode);
return true;
}
+ case TRANSACTION_lastMaintenance: {
+ data.enforceInterface(DESCRIPTOR);
+ long lastMaintenance = lastMaintenance();
+ reply.writeNoException();
+ reply.writeLong(lastMaintenance);
+ return true;
+ }
+ case TRANSACTION_runMaintenance: {
+ data.enforceInterface(DESCRIPTOR);
+ runMaintenance();
+ reply.writeNoException();
+ return true;
+ }
}
return super.onTransact(code, data, reply, flags);
}
@@ -1617,4 +1666,18 @@ public interface IMountService extends IInterface {
public String getField(String field) throws RemoteException;
public int resizeSecureContainer(String id, int sizeMb, String key) throws RemoteException;
+
+ /**
+ * Report the time of the last maintenance operation such as fstrim.
+ * @return Timestamp of the last maintenance operation, in the
+ * System.currentTimeMillis() time base
+ * @throws RemoteException
+ */
+ public long lastMaintenance() throws RemoteException;
+
+ /**
+ * Kick off an immediate maintenance operation
+ * @throws RemoteException
+ */
+ public void runMaintenance() throws RemoteException;
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index b1c338ee1cdd..fbfd53e38369 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5550,6 +5550,13 @@ public final class Settings {
public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
/**
+ * Time since last fstrim (milliseconds) after which we force one to happen
+ * during device startup. If unset, the default is 3 days.
+ * @hide
+ */
+ public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
+
+ /**
* The interval in milliseconds at which to check packet counts on the
* mobile data interface when screen is on, to detect possible data
* connection problems.