diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/Activity.java | 4 | ||||
| -rw-r--r-- | core/java/android/content/Intent.java | 4 | ||||
| -rw-r--r-- | core/java/android/os/storage/IMountService.java | 63 | ||||
| -rw-r--r-- | core/java/android/preference/Preference.java | 2 | ||||
| -rw-r--r-- | core/java/android/preference/PreferenceManager.java | 2 | ||||
| -rw-r--r-- | core/java/android/provider/Settings.java | 7 | ||||
| -rw-r--r-- | core/java/android/widget/TimePickerSpinnerDelegate.java | 2 |
7 files changed, 82 insertions, 2 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 4b705dd..48dd584 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -4751,6 +4751,10 @@ public class Activity extends ContextThemeWrapper * <p>You will receive this call immediately before onResume() when your * activity is re-starting. * + * <p>This method is never invoked if your activity sets + * {@link android.R.styleable#AndroidManifestActivity_noHistory noHistory} to + * <code>true</code>. + * * @param requestCode The integer request code originally supplied to * startActivityForResult(), allowing you to identify who this * result came from. diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index af6f181..7ce4d8d 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -3535,6 +3535,10 @@ public class Intent implements Parcelable, Cloneable { * the user navigates away from it, the activity is finished. This may also * be set with the {@link android.R.styleable#AndroidManifestActivity_noHistory * noHistory} attribute. + * + * <p>If set, {@link android.app.Activity#onActivityResult onActivityResult()} + * is never invoked when the current activity starts a new activity which + * sets a result and finishes. */ public static final int FLAG_ACTIVITY_NO_HISTORY = 0x40000000; /** 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/preference/Preference.java b/core/java/android/preference/Preference.java index 56d5617..0224c73 100644 --- a/core/java/android/preference/Preference.java +++ b/core/java/android/preference/Preference.java @@ -215,7 +215,7 @@ public class Preference implements Comparable<Preference> { final TypedArray a = context.obtainStyledAttributes( attrs, com.android.internal.R.styleable.Preference, defStyleAttr, defStyleRes); - for (int i = a.getIndexCount(); i >= 0; i--) { + for (int i = a.getIndexCount() - 1; i >= 0; i--) { int attr = a.getIndex(i); switch (attr) { case com.android.internal.R.styleable.Preference_icon: diff --git a/core/java/android/preference/PreferenceManager.java b/core/java/android/preference/PreferenceManager.java index ad940c6..0a0e625 100644 --- a/core/java/android/preference/PreferenceManager.java +++ b/core/java/android/preference/PreferenceManager.java @@ -156,7 +156,7 @@ public class PreferenceManager { * should be used ANY time a preference will be displayed, since some preference * types need an Activity for managed queries. */ - private PreferenceManager(Context context) { + /*package*/ PreferenceManager(Context context) { init(context); } 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; |
