summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/storage/IMountService.java63
-rw-r--r--core/java/android/provider/Settings.java7
-rw-r--r--core/java/android/widget/TimePickerSpinnerDelegate.java2
3 files changed, 72 insertions, 0 deletions
diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java
index cf407f4..116110e 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 79e84d9..73c7cc3 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5544,6 +5544,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.
diff --git a/core/java/android/widget/TimePickerSpinnerDelegate.java b/core/java/android/widget/TimePickerSpinnerDelegate.java
index 73e05e8..61d3d0f 100644
--- a/core/java/android/widget/TimePickerSpinnerDelegate.java
+++ b/core/java/android/widget/TimePickerSpinnerDelegate.java
@@ -61,6 +61,8 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im
// Also NOT a real index, just used for keyboard mode.
private static final int ENABLE_PICKER_INDEX = 3;
+ // LayoutLib relies on these constants. Change TimePickerSpinnerDelegate_Delegate if
+ // modifying these.
private static final int AM = 0;
private static final int PM = 1;