diff options
265 files changed, 2163 insertions, 556 deletions
diff --git a/api/current.txt b/api/current.txt index 27407a2..fd9f0be 100644 --- a/api/current.txt +++ b/api/current.txt @@ -3167,31 +3167,27 @@ package android.app { } public class AppOpsManager { - method public int checkOp(int, int, java.lang.String); - method public int checkOpNoThrow(int, int, java.lang.String); + method public int checkOp(java.lang.String, int, java.lang.String); + method public int checkOpNoThrow(java.lang.String, int, java.lang.String); method public void checkPackage(int, java.lang.String); - method public void finishOp(int, int, java.lang.String); - method public void finishOp(int); - method public int noteOp(int, int, java.lang.String); - method public int noteOpNoThrow(int, int, java.lang.String); - method public static java.lang.String opToName(int); - method public int startOp(int, int, java.lang.String); - method public int startOpNoThrow(int, int, java.lang.String); - method public void startWatchingMode(int, java.lang.String, android.app.AppOpsManager.Callback); - method public void stopWatchingMode(android.app.AppOpsManager.Callback); + method public void finishOp(java.lang.String, int, java.lang.String); + method public int noteOp(java.lang.String, int, java.lang.String); + method public int noteOpNoThrow(java.lang.String, int, java.lang.String); + method public int startOp(java.lang.String, int, java.lang.String); + method public int startOpNoThrow(java.lang.String, int, java.lang.String); + method public void startWatchingMode(int, java.lang.String, android.app.AppOpsManager.OnOpChangedListener); + method public void stopWatchingMode(android.app.AppOpsManager.OnOpChangedListener); field public static final int MODE_ALLOWED = 0; // 0x0 field public static final int MODE_ERRORED = 2; // 0x2 field public static final int MODE_IGNORED = 1; // 0x1 - field public static final int OP_COARSE_LOCATION = 0; // 0x0 - field public static final int OP_FINE_LOCATION = 1; // 0x1 - field public static final int OP_GPS = 2; // 0x2 - field public static final int OP_MONITOR_HIGH_POWER_LOCATION = 42; // 0x2a - field public static final int OP_MONITOR_LOCATION = 41; // 0x29 - field public static final int OP_NONE = -1; // 0xffffffff + field public static final java.lang.String OPSTR_COARSE_LOCATION = "android:coarse_location"; + field public static final java.lang.String OPSTR_FINE_LOCATION = "android:fine_location"; + field public static final java.lang.String OPSTR_MONITOR_HIGH_POWER_LOCATION = "android:monitor_location_high_power"; + field public static final java.lang.String OPSTR_MONITOR_LOCATION = "android:monitor_location"; } - public static abstract interface AppOpsManager.Callback { - method public abstract void opChanged(int, java.lang.String); + public static abstract interface AppOpsManager.OnOpChangedListener { + method public abstract void onOpChanged(java.lang.String, java.lang.String); } public class Application extends android.content.ContextWrapper implements android.content.ComponentCallbacks2 { @@ -10845,17 +10841,62 @@ package android.hardware.camera2 { field public static final int CAMERA_ERROR = 3; // 0x3 } + public final class CameraCharacteristics extends android.hardware.camera2.CameraMetadata { + method public T get(android.hardware.camera2.CameraMetadata.Key<T>); + method public java.util.List<android.hardware.camera2.CameraMetadata.Key<?>> getAvailableCaptureRequestKeys(); + method public java.util.List<android.hardware.camera2.CameraMetadata.Key<?>> getAvailableCaptureResultKeys(); + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_AVAILABLE_ANTIBANDING_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_COMPENSATION_RANGE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_COMPENSATION_STEP; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_AVAILABLE_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_EFFECTS; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_SCENE_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_AVAILABLE_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_MAX_REGIONS; + field public static final android.hardware.camera2.CameraMetadata.Key FLASH_INFO_AVAILABLE; + field public static final android.hardware.camera2.CameraMetadata.Key INFO_SUPPORTED_HARDWARE_LEVEL; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_AVAILABLE_THUMBNAIL_SIZES; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FACING; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_APERTURES; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_FILTER_DENSITIES; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_FOCAL_LENGTHS; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_HYPERFOCAL_DISTANCE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_MINIMUM_FOCUS_DISTANCE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_SHADING_MAP_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_MAX_NUM_OUTPUT_STREAMS; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_FORMATS; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_JPEG_MIN_DURATIONS; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_JPEG_SIZES; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_MAX_DIGITAL_ZOOM; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_PROCESSED_SIZES; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_BASE_GAIN_FACTOR; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_ACTIVE_ARRAY_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_EXPOSURE_TIME_RANGE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_MAX_FRAME_DURATION; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_PHYSICAL_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_SENSITIVITY_RANGE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_MAX_ANALOG_SENSITIVITY; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_ORIENTATION; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_MAX_FACE_COUNT; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_MAX_CURVE_POINTS; + } + public abstract interface CameraDevice implements java.lang.AutoCloseable { - method public abstract void capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraDevice.CaptureListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; - method public abstract void captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraDevice.CaptureListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; + method public abstract int capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraDevice.CaptureListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; + method public abstract int captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraDevice.CaptureListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; method public abstract void close(); method public abstract void configureOutputs(java.util.List<android.view.Surface>) throws android.hardware.camera2.CameraAccessException; method public abstract android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int) throws android.hardware.camera2.CameraAccessException; method public abstract void flush() throws android.hardware.camera2.CameraAccessException; method public abstract java.lang.String getId(); - method public abstract android.hardware.camera2.CameraProperties getProperties() throws android.hardware.camera2.CameraAccessException; - method public abstract void setRepeatingBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraDevice.CaptureListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; - method public abstract void setRepeatingRequest(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraDevice.CaptureListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; + method public abstract android.hardware.camera2.CameraCharacteristics getProperties() throws android.hardware.camera2.CameraAccessException; + method public abstract int setRepeatingBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraDevice.CaptureListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; + method public abstract int setRepeatingRequest(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraDevice.CaptureListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; method public abstract void stopRepeating() throws android.hardware.camera2.CameraAccessException; method public abstract void waitUntilIdle() throws android.hardware.camera2.CameraAccessException; field public static final int TEMPLATE_PREVIEW = 1; // 0x1 @@ -10867,7 +10908,8 @@ package android.hardware.camera2 { public static abstract class CameraDevice.CaptureListener { ctor public CameraDevice.CaptureListener(); method public void onCaptureCompleted(android.hardware.camera2.CameraDevice, android.hardware.camera2.CaptureRequest, android.hardware.camera2.CaptureResult); - method public void onCaptureFailed(android.hardware.camera2.CameraDevice, android.hardware.camera2.CaptureRequest); + method public void onCaptureFailed(android.hardware.camera2.CameraDevice, android.hardware.camera2.CaptureRequest, android.hardware.camera2.CaptureFailure); + method public void onCaptureSequenceCompleted(android.hardware.camera2.CameraDevice, int, int); method public void onCaptureStarted(android.hardware.camera2.CameraDevice, android.hardware.camera2.CaptureRequest, long); } @@ -10890,8 +10932,8 @@ package android.hardware.camera2 { public final class CameraManager { method public void addAvailabilityListener(android.hardware.camera2.CameraManager.AvailabilityListener, android.os.Handler); + method public android.hardware.camera2.CameraCharacteristics getCameraCharacteristics(java.lang.String) throws android.hardware.camera2.CameraAccessException; method public java.lang.String[] getCameraIdList() throws android.hardware.camera2.CameraAccessException; - method public android.hardware.camera2.CameraProperties getCameraProperties(java.lang.String) throws android.hardware.camera2.CameraAccessException; method public void openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateListener, android.os.Handler) throws android.hardware.camera2.CameraAccessException; method public void removeAvailabilityListener(android.hardware.camera2.CameraManager.AvailabilityListener); } @@ -11028,49 +11070,14 @@ package android.hardware.camera2 { method public final int hashCode(); } - public final class CameraProperties extends android.hardware.camera2.CameraMetadata { - method public T get(android.hardware.camera2.CameraMetadata.Key<T>); - method public java.util.List<android.hardware.camera2.CameraMetadata.Key<?>> getAvailableCaptureRequestKeys(); - method public java.util.List<android.hardware.camera2.CameraMetadata.Key<?>> getAvailableCaptureResultKeys(); - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_AVAILABLE_ANTIBANDING_MODES; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_COMPENSATION_RANGE; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_COMPENSATION_STEP; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_AVAILABLE_MODES; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_EFFECTS; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_SCENE_MODES; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_AVAILABLE_MODES; - field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_MAX_REGIONS; - field public static final android.hardware.camera2.CameraMetadata.Key FLASH_INFO_AVAILABLE; - field public static final android.hardware.camera2.CameraMetadata.Key INFO_SUPPORTED_HARDWARE_LEVEL; - field public static final android.hardware.camera2.CameraMetadata.Key JPEG_AVAILABLE_THUMBNAIL_SIZES; - field public static final android.hardware.camera2.CameraMetadata.Key LENS_FACING; - field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_APERTURES; - field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_FILTER_DENSITIES; - field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_FOCAL_LENGTHS; - field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION; - field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_HYPERFOCAL_DISTANCE; - field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_MINIMUM_FOCUS_DISTANCE; - field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_SHADING_MAP_SIZE; - field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_MAX_NUM_OUTPUT_STREAMS; - field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_FORMATS; - field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_JPEG_MIN_DURATIONS; - field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_JPEG_SIZES; - field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_MAX_DIGITAL_ZOOM; - field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS; - field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_PROCESSED_SIZES; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_BASE_GAIN_FACTOR; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_ACTIVE_ARRAY_SIZE; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_EXPOSURE_TIME_RANGE; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_MAX_FRAME_DURATION; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_PHYSICAL_SIZE; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_SENSITIVITY_RANGE; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_MAX_ANALOG_SENSITIVITY; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_ORIENTATION; - field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES; - field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_MAX_FACE_COUNT; - field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_MAX_CURVE_POINTS; + public class CaptureFailure { + method public int getFrameNumber(); + method public int getReason(); + method public android.hardware.camera2.CaptureRequest getRequest(); + method public int getSequenceId(); + method public boolean wasImageCaptured(); + field public static final int REASON_ERROR = 0; // 0x0 + field public static final int REASON_FLUSHED = 1; // 0x1 } public final class CaptureRequest extends android.hardware.camera2.CameraMetadata implements android.os.Parcelable { @@ -11139,6 +11146,9 @@ package android.hardware.camera2 { public final class CaptureResult extends android.hardware.camera2.CameraMetadata { method public T get(android.hardware.camera2.CameraMetadata.Key<T>); + method public int getFrameNumber(); + method public android.hardware.camera2.CaptureRequest getRequest(); + method public int getSequenceId(); field public static final android.hardware.camera2.CameraMetadata.Key BLACK_LEVEL_LOCK; field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_GAINS; field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_TRANSFORM; diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index a727b07..7d4d57c 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -152,7 +152,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM int startFlags = data.readInt(); String profileFile = data.readString(); ParcelFileDescriptor profileFd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; Bundle options = data.readInt() != 0 ? Bundle.CREATOR.createFromParcel(data) : null; int userId = data.readInt(); @@ -178,7 +178,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM int startFlags = data.readInt(); String profileFile = data.readString(); ParcelFileDescriptor profileFd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; Bundle options = data.readInt() != 0 ? Bundle.CREATOR.createFromParcel(data) : null; int userId = data.readInt(); @@ -1354,7 +1354,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM int profileType = data.readInt(); String path = data.readString(); ParcelFileDescriptor fd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; boolean res = profileControl(process, userId, start, path, fd, profileType); reply.writeNoException(); reply.writeInt(res ? 1 : 0); @@ -1608,7 +1608,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM boolean managed = data.readInt() != 0; String path = data.readString(); ParcelFileDescriptor fd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; boolean res = dumpHeap(process, userId, managed, path, fd); reply.writeNoException(); reply.writeInt(res ? 1 : 0); diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index bf2a1e4..055044b 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -23,6 +23,7 @@ import com.android.internal.app.IAppOpsService; import com.android.internal.app.IAppOpsCallback; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import android.content.Context; @@ -32,50 +33,76 @@ import android.os.Process; import android.os.RemoteException; /** - * API for interacting with "application operation" tracking. Allows you to: + * API for interacting with "application operation" tracking. * - * <ul> - * <li> Note when operations are happening, and find out if they are allowed for the current - * caller.</li> - * <li> Disallow specific apps from doing specific operations.</li> - * <li> Collect all of the current information about operations that have been executed or are not - * being allowed.</li> - * <li> Monitor for changes in whether an operation is allowed.</li> - * </ul> - * - * <p>Each operation is identified by a single integer; these integers are a fixed set of - * operations, enumerated by the OP_* constants. - * - * <p></p>When checking operations, the result is a "mode" integer indicating the current setting - * for the operation under that caller: MODE_ALLOWED, MODE_IGNORED (don't execute the operation but - * fake its behavior enough so that the caller doesn't crash), MODE_ERRORED (through a - * SecurityException back to the caller; the normal operation calls will do this for you). + * <p>This API is not generally intended for third party application developers; most + * features are only available to system applicatins. Obtain an instance of it through + * {@link Context#getSystemService(String) Context.getSystemService} with + * {@link Context#APP_OPS_SERVICE Context.APP_OPS_SERVICE}.</p> */ public class AppOpsManager { + /** + * <p>App ops allows callers to:</p> + * + * <ul> + * <li> Note when operations are happening, and find out if they are allowed for the current + * caller.</li> + * <li> Disallow specific apps from doing specific operations.</li> + * <li> Collect all of the current information about operations that have been executed or + * are not being allowed.</li> + * <li> Monitor for changes in whether an operation is allowed.</li> + * </ul> + * + * <p>Each operation is identified by a single integer; these integers are a fixed set of + * operations, enumerated by the OP_* constants. + * + * <p></p>When checking operations, the result is a "mode" integer indicating the current + * setting for the operation under that caller: MODE_ALLOWED, MODE_IGNORED (don't execute + * the operation but fake its behavior enough so that the caller doesn't crash), + * MODE_ERRORED (throw a SecurityException back to the caller; the normal operation calls + * will do this for you). + */ + final Context mContext; final IAppOpsService mService; - final ArrayMap<Callback, IAppOpsCallback> mModeWatchers - = new ArrayMap<Callback, IAppOpsCallback>(); + final ArrayMap<OnOpChangedListener, IAppOpsCallback> mModeWatchers + = new ArrayMap<OnOpChangedListener, IAppOpsCallback>(); static IBinder sToken; + /** + * Result from {@link #checkOp}, {@link #noteOp}, {@link #startOp}: the given caller is + * allowed to perform the given operation. + */ public static final int MODE_ALLOWED = 0; + + /** + * Result from {@link #checkOp}, {@link #noteOp}, {@link #startOp}: the given caller is + * not allowed to perform the given operation, and this attempt should + * <em>silently fail</em> (it should not cause the app to crash). + */ public static final int MODE_IGNORED = 1; + + /** + * Result from {@link #checkOpNoThrow}, {@link #noteOpNoThrow}, {@link #startOpNoThrow}: the + * given caller is not allowed to perform the given operation, and this attempt should + * cause it to have a fatal error, typically a {@link SecurityException}. + */ public static final int MODE_ERRORED = 2; // when adding one of these: // - increment _NUM_OP - // - add rows to sOpToSwitch, sOpNames, sOpPerms, sOpDefaultMode + // - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode // - add descriptive strings to Settings/res/values/arrays.xml // - add the op to the appropriate template in AppOpsState.OpsTemplate (settings app) - /** No operation specified. */ + /** @hide No operation specified. */ public static final int OP_NONE = -1; - /** Access to coarse location information. */ + /** @hide Access to coarse location information. */ public static final int OP_COARSE_LOCATION = 0; - /** Access to fine location information. */ + /** @hide Access to fine location information. */ public static final int OP_FINE_LOCATION = 1; - /** Causing GPS to run. */ + /** @hide Causing GPS to run. */ public static final int OP_GPS = 2; /** @hide */ public static final int OP_VIBRATE = 3; @@ -153,13 +180,26 @@ public class AppOpsManager { public static final int OP_AUDIO_BLUETOOTH_VOLUME = 39; /** @hide */ public static final int OP_WAKE_LOCK = 40; - /** Continually monitoring location data. */ + /** @hide Continually monitoring location data. */ public static final int OP_MONITOR_LOCATION = 41; - /** Continually monitoring location data with a relatively high power request. */ + /** @hide Continually monitoring location data with a relatively high power request. */ public static final int OP_MONITOR_HIGH_POWER_LOCATION = 42; /** @hide */ public static final int _NUM_OP = 43; + /** Access to coarse location information. */ + public static final String OPSTR_COARSE_LOCATION = + "android:coarse_location"; + /** Access to fine location information. */ + public static final String OPSTR_FINE_LOCATION = + "android:fine_location"; + /** Continually monitoring location data. */ + public static final String OPSTR_MONITOR_LOCATION + = "android:monitor_location"; + /** Continually monitoring location data with a relatively high power request. */ + public static final String OPSTR_MONITOR_HIGH_POWER_LOCATION + = "android:monitor_location_high_power"; + /** * This maps each operation to the operation that serves as the * switch to determine whether it is allowed. Generally this is @@ -215,6 +255,56 @@ public class AppOpsManager { }; /** + * This maps each operation to the public string constant for it. + * If it doesn't have a public string constant, it maps to null. + */ + private static String[] sOpToString = new String[] { + OPSTR_COARSE_LOCATION, + OPSTR_FINE_LOCATION, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + OPSTR_MONITOR_LOCATION, + OPSTR_MONITOR_HIGH_POWER_LOCATION, + }; + + /** * This provides a simple name for each operation to be used * in debug output. */ @@ -363,6 +453,36 @@ public class AppOpsManager { AppOpsManager.MODE_ALLOWED, }; + private static HashMap<String, Integer> sOpStrToOp = new HashMap<String, Integer>(); + + static { + if (sOpToSwitch.length != _NUM_OP) { + throw new IllegalStateException("sOpStringLength " + sOpToSwitch.length + + " should be " + _NUM_OP); + } + if (sOpToString.length != _NUM_OP) { + throw new IllegalStateException("sOpStringLength " + sOpToString.length + + " should be " + _NUM_OP); + } + if (sOpNames.length != _NUM_OP) { + throw new IllegalStateException("sOpStringLength " + sOpNames.length + + " should be " + _NUM_OP); + } + if (sOpPerms.length != _NUM_OP) { + throw new IllegalStateException("sOpStringLength " + sOpPerms.length + + " should be " + _NUM_OP); + } + if (sOpDefaultMode.length != _NUM_OP) { + throw new IllegalStateException("sOpStringLength " + sOpDefaultMode.length + + " should be " + _NUM_OP); + } + for (int i=0; i<_NUM_OP; i++) { + if (sOpToString[i] != null) { + sOpStrToOp.put(sOpToString[i], i); + } + } + } + /** * Retrieve the op switch that controls the given operation. * @hide @@ -373,6 +493,7 @@ public class AppOpsManager { /** * Retrieve a non-localized name for the operation, for debugging output. + * @hide */ public static String opToName(int op) { if (op == OP_NONE) return "NONE"; @@ -537,8 +658,18 @@ public class AppOpsManager { /** * Callback for notification of changes to operation state. */ - public interface Callback { - public void opChanged(int op, String packageName); + public interface OnOpChangedListener { + public void onOpChanged(String op, String packageName); + } + + /** + * Callback for notification of changes to operation state. + * This allows you to see the raw op codes instead of strings. + * @hide + */ + public static class OnOpChangedInternalListener implements OnOpChangedListener { + public void onOpChanged(String op, String packageName) { } + public void onOpChanged(int op, String packageName) { } } AppOpsManager(Context context, IAppOpsService service) { @@ -598,13 +729,18 @@ public class AppOpsManager { * @param packageName The name of the application to monitor. * @param callback Where to report changes. */ - public void startWatchingMode(int op, String packageName, final Callback callback) { + public void startWatchingMode(int op, String packageName, final OnOpChangedListener callback) { synchronized (mModeWatchers) { IAppOpsCallback cb = mModeWatchers.get(callback); if (cb == null) { cb = new IAppOpsCallback.Stub() { public void opChanged(int op, String packageName) { - callback.opChanged(op, packageName); + if (callback instanceof OnOpChangedInternalListener) { + ((OnOpChangedInternalListener)callback).onOpChanged(op, packageName); + } + if (sOpToString[op] != null) { + callback.onOpChanged(sOpToString[op], packageName); + } } }; mModeWatchers.put(callback, cb); @@ -620,7 +756,7 @@ public class AppOpsManager { * Stop monitoring that was previously started with {@link #startWatchingMode}. All * monitoring associated with this callback will be removed. */ - public void stopWatchingMode(Callback callback) { + public void stopWatchingMode(OnOpChangedListener callback) { synchronized (mModeWatchers) { IAppOpsCallback cb = mModeWatchers.get(callback); if (cb != null) { @@ -636,6 +772,106 @@ public class AppOpsManager { return packageName + " from uid " + uid + " not allowed to perform " + sOpNames[op]; } + private int strOpToOp(String op) { + Integer val = sOpStrToOp.get(op); + if (val == null) { + throw new IllegalArgumentException("Unknown operation string: " + op); + } + return val; + } + + /** + * Do a quick check for whether an application might be able to perform an operation. + * This is <em>not</em> a security check; you must use {@link #noteOp(String, int, String)} + * or {@link #startOp(String, int, String)} for your actual security checks, which also + * ensure that the given uid and package name are consistent. This function can just be + * used for a quick check to see if an operation has been disabled for the application, + * as an early reject of some work. This does not modify the time stamp or other data + * about the operation. + * @param op The operation to check. One of the OPSTR_* constants. + * @param uid The user id of the application attempting to perform the operation. + * @param packageName The name of the application attempting to perform the operation. + * @return Returns {@link #MODE_ALLOWED} if the operation is allowed, or + * {@link #MODE_IGNORED} if it is not allowed and should be silently ignored (without + * causing the app to crash). + * @throws SecurityException If the app has been configured to crash on this op. + */ + public int checkOp(String op, int uid, String packageName) { + return checkOp(strOpToOp(op), uid, packageName); + } + + /** + * Like {@link #checkOp but instead of throwing a {@link SecurityException} it + * returns {@link #MODE_ERRORED}. + */ + public int checkOpNoThrow(String op, int uid, String packageName) { + return checkOpNoThrow(strOpToOp(op), uid, packageName); + } + + /** + * Make note of an application performing an operation. Note that you must pass + * in both the uid and name of the application to be checked; this function will verify + * that these two match, and if not, return {@link #MODE_IGNORED}. If this call + * succeeds, the last execution time of the operation for this app will be updated to + * the current time. + * @param op The operation to note. One of the OPSTR_* constants. + * @param uid The user id of the application attempting to perform the operation. + * @param packageName The name of the application attempting to perform the operation. + * @return Returns {@link #MODE_ALLOWED} if the operation is allowed, or + * {@link #MODE_IGNORED} if it is not allowed and should be silently ignored (without + * causing the app to crash). + * @throws SecurityException If the app has been configured to crash on this op. + */ + public int noteOp(String op, int uid, String packageName) { + return noteOp(strOpToOp(op), uid, packageName); + } + + /** + * Like {@link #noteOp} but instead of throwing a {@link SecurityException} it + * returns {@link #MODE_ERRORED}. + */ + public int noteOpNoThrow(String op, int uid, String packageName) { + return noteOpNoThrow(strOpToOp(op), uid, packageName); + } + + /** + * Report that an application has started executing a long-running operation. Note that you + * must pass in both the uid and name of the application to be checked; this function will + * verify that these two match, and if not, return {@link #MODE_IGNORED}. If this call + * succeeds, the last execution time of the operation for this app will be updated to + * the current time and the operation will be marked as "running". In this case you must + * later call {@link #finishOp(String, int, String)} to report when the application is no + * longer performing the operation. + * @param op The operation to start. One of the OPSTR_* constants. + * @param uid The user id of the application attempting to perform the operation. + * @param packageName The name of the application attempting to perform the operation. + * @return Returns {@link #MODE_ALLOWED} if the operation is allowed, or + * {@link #MODE_IGNORED} if it is not allowed and should be silently ignored (without + * causing the app to crash). + * @throws SecurityException If the app has been configured to crash on this op. + */ + public int startOp(String op, int uid, String packageName) { + return startOp(strOpToOp(op), uid, packageName); + } + + /** + * Like {@link #startOp} but instead of throwing a {@link SecurityException} it + * returns {@link #MODE_ERRORED}. + */ + public int startOpNoThrow(String op, int uid, String packageName) { + return startOpNoThrow(strOpToOp(op), uid, packageName); + } + + /** + * Report that an application is no longer performing an operation that had previously + * been started with {@link #startOp(String, int, String)}. There is no validation of input + * or result; the parameters supplied here must be the exact same ones previously passed + * in when starting the operation. + */ + public void finishOp(String op, int uid, String packageName) { + finishOp(strOpToOp(op), uid, packageName); + } + /** * Do a quick check for whether an application might be able to perform an operation. * This is <em>not</em> a security check; you must use {@link #noteOp(int, int, String)} @@ -651,6 +887,7 @@ public class AppOpsManager { * {@link #MODE_IGNORED} if it is not allowed and should be silently ignored (without * causing the app to crash). * @throws SecurityException If the app has been configured to crash on this op. + * @hide */ public int checkOp(int op, int uid, String packageName) { try { @@ -667,6 +904,7 @@ public class AppOpsManager { /** * Like {@link #checkOp} but instead of throwing a {@link SecurityException} it * returns {@link #MODE_ERRORED}. + * @hide */ public int checkOpNoThrow(int op, int uid, String packageName) { try { @@ -706,6 +944,7 @@ public class AppOpsManager { * {@link #MODE_IGNORED} if it is not allowed and should be silently ignored (without * causing the app to crash). * @throws SecurityException If the app has been configured to crash on this op. + * @hide */ public int noteOp(int op, int uid, String packageName) { try { @@ -722,6 +961,7 @@ public class AppOpsManager { /** * Like {@link #noteOp} but instead of throwing a {@link SecurityException} it * returns {@link #MODE_ERRORED}. + * @hide */ public int noteOpNoThrow(int op, int uid, String packageName) { try { @@ -766,6 +1006,7 @@ public class AppOpsManager { * {@link #MODE_IGNORED} if it is not allowed and should be silently ignored (without * causing the app to crash). * @throws SecurityException If the app has been configured to crash on this op. + * @hide */ public int startOp(int op, int uid, String packageName) { try { @@ -782,6 +1023,7 @@ public class AppOpsManager { /** * Like {@link #startOp} but instead of throwing a {@link SecurityException} it * returns {@link #MODE_ERRORED}. + * @hide */ public int startOpNoThrow(int op, int uid, String packageName) { try { @@ -801,6 +1043,7 @@ public class AppOpsManager { * been started with {@link #startOp(int, int, String)}. There is no validation of input * or result; the parameters supplied here must be the exact same ones previously passed * in when starting the operation. + * @hide */ public void finishOp(int op, int uid, String packageName) { try { @@ -809,6 +1052,7 @@ public class AppOpsManager { } } + /** @hide */ public void finishOp(int op) { finishOp(op, Process.myUid(), mContext.getOpPackageName()); } diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index 876bf78..e40a04b 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -143,7 +143,7 @@ public abstract class ApplicationThreadNative extends Binder boolean isForward = data.readInt() != 0; String profileName = data.readString(); ParcelFileDescriptor profileFd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; boolean autoStopProfiler = data.readInt() != 0; scheduleLaunchActivity(intent, b, ident, info, curConfig, compatInfo, procState, state, ri, pi, notResumed, isForward, profileName, profileFd, autoStopProfiler); @@ -267,7 +267,7 @@ public abstract class ApplicationThreadNative extends Binder ? new ComponentName(data) : null; String profileName = data.readString(); ParcelFileDescriptor profileFd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; boolean autoStopProfiler = data.readInt() != 0; Bundle testArgs = data.readBundle(); IBinder binder = data.readStrongBinder(); @@ -418,7 +418,7 @@ public abstract class ApplicationThreadNative extends Binder int profileType = data.readInt(); String path = data.readString(); ParcelFileDescriptor fd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; profilerControl(start, path, fd, profileType); return true; } @@ -473,7 +473,7 @@ public abstract class ApplicationThreadNative extends Binder boolean managed = data.readInt() != 0; String path = data.readString(); ParcelFileDescriptor fd = data.readInt() != 0 - ? data.readFileDescriptor() : null; + ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; dumpHeap(managed, path, fd); return true; } diff --git a/core/java/android/app/DownloadManager.java b/core/java/android/app/DownloadManager.java index 165c3db..800ead9 100644 --- a/core/java/android/app/DownloadManager.java +++ b/core/java/android/app/DownloadManager.java @@ -150,6 +150,11 @@ public class DownloadManager { public static final String COLUMN_MEDIAPROVIDER_URI = Downloads.Impl.COLUMN_MEDIAPROVIDER_URI; /** + * @hide + */ + public final static String COLUMN_ALLOW_WRITE = Downloads.Impl.COLUMN_ALLOW_WRITE; + + /** * Value of {@link #COLUMN_STATUS} when the download is waiting to start. */ public final static int STATUS_PENDING = 1 << 0; @@ -315,6 +320,7 @@ public class DownloadManager { Downloads.Impl.COLUMN_TOTAL_BYTES + " AS " + COLUMN_TOTAL_SIZE_BYTES, Downloads.Impl.COLUMN_LAST_MODIFICATION + " AS " + COLUMN_LAST_MODIFIED_TIMESTAMP, Downloads.Impl.COLUMN_CURRENT_BYTES + " AS " + COLUMN_BYTES_DOWNLOADED_SO_FAR, + Downloads.Impl.COLUMN_ALLOW_WRITE, /* add the following 'computed' columns to the cursor. * they are not 'returned' by the database, but their inclusion * eliminates need to have lot of methods in CursorTranslator @@ -1185,6 +1191,14 @@ public class DownloadManager { public long addCompletedDownload(String title, String description, boolean isMediaScannerScannable, String mimeType, String path, long length, boolean showNotification) { + return addCompletedDownload(title, description, isMediaScannerScannable, mimeType, path, + length, showNotification, false); + } + + /** {@hide} */ + public long addCompletedDownload(String title, String description, + boolean isMediaScannerScannable, String mimeType, String path, long length, + boolean showNotification, boolean allowWrite) { // make sure the input args are non-null/non-zero validateArgumentIsNonEmpty("title", title); validateArgumentIsNonEmpty("description", description); @@ -1210,12 +1224,14 @@ public class DownloadManager { Request.SCANNABLE_VALUE_NO); values.put(Downloads.Impl.COLUMN_VISIBILITY, (showNotification) ? Request.VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION : Request.VISIBILITY_HIDDEN); + values.put(Downloads.Impl.COLUMN_ALLOW_WRITE, allowWrite ? 1 : 0); Uri downloadUri = mResolver.insert(Downloads.Impl.CONTENT_URI, values); if (downloadUri == null) { return -1; } return Long.parseLong(downloadUri.getLastPathSegment()); } + private static final String NON_DOWNLOADMANAGER_DOWNLOAD = "non-dwnldmngr-download-dont-retry2download"; @@ -1227,8 +1243,10 @@ public class DownloadManager { /** * Get the DownloadProvider URI for the download with the given ID. + * + * @hide */ - Uri getDownloadUri(long id) { + public Uri getDownloadUri(long id) { return ContentUris.withAppendedId(mBaseUri, id); } diff --git a/core/java/android/content/ContentProviderClient.java b/core/java/android/content/ContentProviderClient.java index 39b453d..0650798 100644 --- a/core/java/android/content/ContentProviderClient.java +++ b/core/java/android/content/ContentProviderClient.java @@ -26,6 +26,8 @@ import android.os.RemoteException; import android.os.ParcelFileDescriptor; import android.content.res.AssetFileDescriptor; +import dalvik.system.CloseGuard; + import java.io.FileNotFoundException; import java.util.ArrayList; @@ -49,6 +51,8 @@ public class ContentProviderClient { private final boolean mStable; private boolean mReleased; + private final CloseGuard mGuard = CloseGuard.get(); + /** * @hide */ @@ -58,6 +62,7 @@ public class ContentProviderClient { mContentResolver = contentResolver; mPackageName = contentResolver.mPackageName; mStable = stable; + mGuard.open("release"); } /** See {@link ContentProvider#query ContentProvider.query} */ @@ -324,6 +329,7 @@ public class ContentProviderClient { throw new IllegalStateException("Already released"); } mReleased = true; + mGuard.close(); if (mStable) { return mContentResolver.releaseProvider(mContentProvider); } else { @@ -332,6 +338,13 @@ public class ContentProviderClient { } } + @Override + protected void finalize() throws Throwable { + if (mGuard != null) { + mGuard.warnIfOpen(); + } + } + /** * Get a reference to the {@link ContentProvider} that is associated with this * client. If the {@link ContentProvider} is running in a different process then diff --git a/core/java/android/hardware/camera2/CameraProperties.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index a2faf09..85fa7d6 100644 --- a/core/java/android/hardware/camera2/CameraProperties.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -32,7 +32,7 @@ import java.util.List; * @see CameraDevice * @see CameraManager */ -public final class CameraProperties extends CameraMetadata { +public final class CameraCharacteristics extends CameraMetadata { private final CameraMetadataNative mProperties; private List<Key<?>> mAvailableRequestKeys; @@ -42,7 +42,7 @@ public final class CameraProperties extends CameraMetadata { * Takes ownership of the passed-in properties object * @hide */ - public CameraProperties(CameraMetadataNative properties) { + public CameraCharacteristics(CameraMetadataNative properties) { mProperties = properties; } @@ -60,7 +60,7 @@ public final class CameraProperties extends CameraMetadata { * * <p>Each key is only listed once in the list. The order of the keys is undefined.</p> * - * <p>Note that there is no {@code getAvailableCameraPropertiesKeys()} -- use + * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use * {@link #getKeys()} instead.</p> * * @return List of keys supported by this CameraDevice for CaptureRequests. @@ -81,7 +81,7 @@ public final class CameraProperties extends CameraMetadata { * * <p>Each key is only listed once in the list. The order of the keys is undefined.</p> * - * <p>Note that there is no {@code getAvailableCameraPropertiesKeys()} -- use + * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use * {@link #getKeys()} instead.</p> * * @return List of keys supported by this CameraDevice for CaptureResults. diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java index f047b0d..ec89041 100644 --- a/core/java/android/hardware/camera2/CameraDevice.java +++ b/core/java/android/hardware/camera2/CameraDevice.java @@ -118,22 +118,22 @@ public interface CameraDevice extends AutoCloseable { * this camera device.</p> * * <p>This ID can be used to query the camera device's {@link - * CameraProperties fixed properties} with {@link - * CameraManager#getCameraProperties}.</p> + * CameraCharacteristics fixed properties} with {@link + * CameraManager#getCameraCharacteristics}.</p> * * <p>This method can be called even if the device has been closed or has encountered * a serious error.</p> * * @return the ID for this camera device * - * @see CameraManager#getCameraProperties + * @see CameraManager#getCameraCharacteristics * @see CameraManager#getDeviceIdList */ public String getId(); /** * Get the static properties for this camera. These are identical to the - * properties returned by {@link CameraManager#getCameraProperties}. + * properties returned by {@link CameraManager#getCameraCharacteristics}. * * @return the static properties of the camera * @@ -141,10 +141,9 @@ public interface CameraDevice extends AutoCloseable { * encountered a fatal error * @throws IllegalStateException if the camera device has been closed * - * @see CameraManager#getCameraProperties + * @see CameraManager#getCameraCharacteristics */ - public CameraProperties getProperties() throws CameraAccessException; - + public CameraCharacteristics getProperties() throws CameraAccessException; /** * <p>Set up a new output set of Surfaces for the camera device.</p> * @@ -165,7 +164,7 @@ public interface CameraDevice extends AutoCloseable { * the size of the Surface with * {@link android.view.SurfaceHolder#setFixedSize} to be one of the * supported - * {@link CameraProperties#SCALER_AVAILABLE_PROCESSED_SIZES processed sizes} + * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES processed sizes} * before calling {@link android.view.SurfaceHolder#getSurface}.</li> * * <li>For accessing through an OpenGL texture via a @@ -173,14 +172,14 @@ public interface CameraDevice extends AutoCloseable { * the SurfaceTexture with * {@link android.graphics.SurfaceTexture#setDefaultBufferSize} to be one * of the supported - * {@link CameraProperties#SCALER_AVAILABLE_PROCESSED_SIZES processed sizes} + * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES processed sizes} * before creating a Surface from the SurfaceTexture with * {@link Surface#Surface}.</li> * * <li>For recording with {@link android.media.MediaCodec}: Call * {@link android.media.MediaCodec#createInputSurface} after configuring * the media codec to use one of the - * {@link CameraProperties#SCALER_AVAILABLE_PROCESSED_SIZES processed sizes} + * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES processed sizes} * </li> * * <li>For recording with {@link android.media.MediaRecorder}: TODO</li> @@ -189,16 +188,16 @@ public interface CameraDevice extends AutoCloseable { * Create a RenderScript * {@link android.renderscript.Allocation Allocation} with a supported YUV * type, the IO_INPUT flag, and one of the supported - * {@link CameraProperties#SCALER_AVAILABLE_PROCESSED_SIZES processed sizes}. Then + * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES processed sizes}. Then * obtain the Surface with * {@link android.renderscript.Allocation#getSurface}.</li> * * <li>For access to uncompressed or JPEG data in the application: Create a * {@link android.media.ImageReader} object with the desired - * {@link CameraProperties#SCALER_AVAILABLE_FORMATS image format}, and a + * {@link CameraCharacteristics#SCALER_AVAILABLE_FORMATS image format}, and a * size from the matching - * {@link CameraProperties#SCALER_AVAILABLE_PROCESSED_SIZES processed}, - * {@link CameraProperties#SCALER_AVAILABLE_JPEG_SIZES jpeg}. Then obtain + * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES processed}, + * {@link CameraCharacteristics#SCALER_AVAILABLE_JPEG_SIZES jpeg}. Then obtain * a Surface from it.</li> * * </ul> @@ -305,6 +304,9 @@ public interface CameraDevice extends AutoCloseable { * {@code null} to use the current thread's {@link android.os.Looper * looper}. * + * @return int A unique capture sequence ID used by + * {@link CaptureListener#onCaptureSequenceCompleted}. + * * @throws CameraAccessException if the camera device is no longer connected or has * encountered a fatal error * @throws IllegalStateException if the camera is currently busy or unconfigured, @@ -317,7 +319,7 @@ public interface CameraDevice extends AutoCloseable { * @see #setRepeatingRequest * @see #setRepeatingBurst */ - public void capture(CaptureRequest request, CaptureListener listener, Handler handler) + public int capture(CaptureRequest request, CaptureListener listener, Handler handler) throws CameraAccessException; /** @@ -346,6 +348,9 @@ public interface CameraDevice extends AutoCloseable { * {@code null} to use the current thread's {@link android.os.Looper * looper}. * + * @return int A unique capture sequence ID used by + * {@link CaptureListener#onCaptureSequenceCompleted}. + * * @throws CameraAccessException if the camera device is no longer connected or has * encountered a fatal error * @throws IllegalStateException if the camera is currently busy or unconfigured, @@ -358,7 +363,7 @@ public interface CameraDevice extends AutoCloseable { * @see #setRepeatingRequest * @see #setRepeatingBurst */ - public void captureBurst(List<CaptureRequest> requests, CaptureListener listener, + public int captureBurst(List<CaptureRequest> requests, CaptureListener listener, Handler handler) throws CameraAccessException; /** @@ -399,6 +404,9 @@ public interface CameraDevice extends AutoCloseable { * {@code null} to use the current thread's {@link android.os.Looper * looper}. * + * @return int A unique capture sequence ID used by + * {@link CaptureListener#onCaptureSequenceCompleted}. + * * @throws CameraAccessException if the camera device is no longer connected or has * encountered a fatal error * @throws IllegalStateException if the camera is currently busy or unconfigured, @@ -413,7 +421,7 @@ public interface CameraDevice extends AutoCloseable { * @see #stopRepeating * @see #flush */ - public void setRepeatingRequest(CaptureRequest request, CaptureListener listener, + public int setRepeatingRequest(CaptureRequest request, CaptureListener listener, Handler handler) throws CameraAccessException; /** @@ -454,6 +462,9 @@ public interface CameraDevice extends AutoCloseable { * {@code null} to use the current thread's {@link android.os.Looper * looper}. * + * @return int A unique capture sequence ID used by + * {@link CaptureListener#onCaptureSequenceCompleted}. + * * @throws CameraAccessException if the camera device is no longer connected or has * encountered a fatal error * @throws IllegalStateException if the camera is currently busy or unconfigured, @@ -468,7 +479,7 @@ public interface CameraDevice extends AutoCloseable { * @see #stopRepeating * @see #flush */ - public void setRepeatingBurst(List<CaptureRequest> requests, CaptureListener listener, + public int setRepeatingBurst(List<CaptureRequest> requests, CaptureListener listener, Handler handler) throws CameraAccessException; /** @@ -601,7 +612,6 @@ public interface CameraDevice extends AutoCloseable { * @see #captureBurst * @see #setRepeatingRequest * @see #setRepeatingBurst - * */ public static abstract class CaptureListener { @@ -672,8 +682,13 @@ public interface CameraDevice extends AutoCloseable { * * <p>The default implementation of this method does nothing.</p> * - * @param camera The CameraDevice sending the callback. - * @param request The request that was given to the CameraDevice + * @param camera + * The CameraDevice sending the callback. + * @param request + * The request that was given to the CameraDevice + * @param failure + * The output failure from the capture, including the failure reason + * and the frame number. * * @see #capture * @see #captureBurst @@ -681,7 +696,30 @@ public interface CameraDevice extends AutoCloseable { * @see #setRepeatingBurst */ public void onCaptureFailed(CameraDevice camera, - CaptureRequest request) { + CaptureRequest request, CaptureFailure failure) { + // default empty implementation + } + + /** + * This method is called independently of the others in CaptureListener, + * when a capture sequence finishes and all {@link CaptureResult} + * or {@link CaptureFailure} for it have been returned via this listener. + * + * @param camera + * The CameraDevice sending the callback. + * @param sequenceId + * A sequence ID returned by the {@link #capture} family of functions. + * @param frameNumber + * The last frame number (returned by {@link CaptureResult#getFrameNumber} + * or {@link CaptureFailure#getFrameNumber}) in the capture sequence. + * + * @see CaptureResult#getFrameNumber() + * @see CaptureFailure#getFrameNumber() + * @see CaptureResult#getSequenceId() + * @see CaptureFailure#getSequenceId() + */ + public void onCaptureSequenceCompleted(CameraDevice camera, + int sequenceId, int frameNumber) { // default empty implementation } } diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java index 29895ef..af0512e 100644 --- a/core/java/android/hardware/camera2/CameraManager.java +++ b/core/java/android/hardware/camera2/CameraManager.java @@ -166,7 +166,7 @@ public final class CameraManager { * @see #getCameraIdList * @see android.app.admin.DevicePolicyManager#setCameraDisabled */ - public CameraProperties getCameraProperties(String cameraId) + public CameraCharacteristics getCameraCharacteristics(String cameraId) throws CameraAccessException { synchronized (mLock) { @@ -179,7 +179,7 @@ public final class CameraManager { // TODO: implement and call a service function to get the capabilities on C++ side // TODO: get properties from service - return new CameraProperties(new CameraMetadataNative()); + return new CameraCharacteristics(new CameraMetadataNative()); } /** diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index 7f4ba4f..b447494 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -40,11 +40,19 @@ import java.util.List; * * @see CameraDevice * @see CameraManager - * @see CameraProperties + * @see CameraCharacteristics **/ public abstract class CameraMetadata { /** + * Set a camera metadata field to a value. The field definitions can be + * found in {@link CameraCharacteristics}, {@link CaptureResult}, and + * {@link CaptureRequest}. + * + * @param key The metadata field to write. + * @param value The value to set the field to, which must be of a matching + * type to the key. + * * @hide */ protected CameraMetadata() { @@ -54,7 +62,7 @@ public abstract class CameraMetadata { * Get a camera metadata field value. * * <p>The field definitions can be - * found in {@link CameraProperties}, {@link CaptureResult}, and + * found in {@link CameraCharacteristics}, {@link CaptureResult}, and * {@link CaptureRequest}.</p> * * <p>Querying the value for the same key more than once will return a value @@ -195,43 +203,43 @@ public abstract class CameraMetadata { *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ // - // Enumeration values for CameraProperties#LENS_FACING + // Enumeration values for CameraCharacteristics#LENS_FACING // /** - * @see CameraProperties#LENS_FACING + * @see CameraCharacteristics#LENS_FACING */ public static final int LENS_FACING_FRONT = 0; /** - * @see CameraProperties#LENS_FACING + * @see CameraCharacteristics#LENS_FACING */ public static final int LENS_FACING_BACK = 1; // - // Enumeration values for CameraProperties#LED_AVAILABLE_LEDS + // Enumeration values for CameraCharacteristics#LED_AVAILABLE_LEDS // /** * <p> * android.led.transmit control is used * </p> - * @see CameraProperties#LED_AVAILABLE_LEDS + * @see CameraCharacteristics#LED_AVAILABLE_LEDS * @hide */ public static final int LED_AVAILABLE_LEDS_TRANSMIT = 0; // - // Enumeration values for CameraProperties#INFO_SUPPORTED_HARDWARE_LEVEL + // Enumeration values for CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL // /** - * @see CameraProperties#INFO_SUPPORTED_HARDWARE_LEVEL + * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL */ public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; /** - * @see CameraProperties#INFO_SUPPORTED_HARDWARE_LEVEL + * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL */ public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; diff --git a/core/java/android/hardware/camera2/CaptureFailure.java b/core/java/android/hardware/camera2/CaptureFailure.java new file mode 100644 index 0000000..3b408cf --- /dev/null +++ b/core/java/android/hardware/camera2/CaptureFailure.java @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2013 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 android.hardware.camera2; + +import android.hardware.camera2.CameraDevice.CaptureListener; + +/** + * A report of failed capture for a single image capture from the image sensor. + * + * <p>CaptureFailures are produced by a {@link CameraDevice} if processing a + * {@link CaptureRequest} fails, either partially or fully. Use {@link #getReason} + * to determine the specific nature of the failed capture.</p> + * + * <p>Receiving a CaptureFailure means that the metadata associated with that frame number + * has been dropped -- no {@link CaptureResult} with the same frame number will be + * produced.</p> + */ +public class CaptureFailure { + /** + * The {@link CaptureResult} has been dropped this frame only due to an error + * in the framework. + * + * @see #getReason() + */ + public static final int REASON_ERROR = 0; + + /** + * The capture has failed due to a {@link CameraDevice#flush} call from the application. + * + * @see #getReason() + */ + public static final int REASON_FLUSHED = 1; + + private final CaptureRequest mRequest; + private final int mReason; + private final boolean mDropped; + private final int mSequenceId; + private final int mFrameNumber; + + /** + * @hide + */ + public CaptureFailure(CaptureRequest request, int reason, boolean dropped, int sequenceId, + int frameNumber) { + mRequest = request; + mReason = reason; + mDropped = dropped; + mSequenceId = sequenceId; + mFrameNumber = frameNumber; + } + + /** + * Get the request associated with this failed capture. + * + * <p>Whenever a request is unsuccessfully captured, with + * {@link CameraDevice.CaptureListener#onCaptureFailed}, + * the {@code failed capture}'s {@code getRequest()} will return that {@code request}. + * </p> + * + * <p>In particular, + * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() { + * {@literal @}Override + * void onCaptureFailed(CaptureRequest myRequest, CaptureFailure myFailure) { + * assert(myFailure.getRequest.equals(myRequest) == true); + * } + * }; + * </code></pre> + * </p> + * + * @return The request associated with this failed capture. Never {@code null}. + */ + public CaptureRequest getRequest() { + return mRequest; + } + + /** + * Get the frame number associated with this failed capture. + * + * <p>Whenever a request has been processed, regardless of failed capture or success, + * it gets a unique frame number assigned to its future result/failed capture.</p> + * + * <p>This value monotonically increments, starting with 0, + * for every new result or failure; and the scope is the lifetime of the + * {@link CameraDevice}.</p> + * + * @return int frame number + */ + public int getFrameNumber() { + return mFrameNumber; + } + + /** + * Determine why the request was dropped, whether due to an error or to a user + * action. + * + * @return int One of {@code REASON_*} integer constants. + * + * @see #REASON_ERROR + * @see #REASON_FLUSHED + */ + public int getReason() { + return mReason; + } + + /** + * Determine if the image was captured from the camera. + * + * <p>If the image was not captured, no image buffers will be available. + * If the image was captured, then image buffers may be available.</p> + * + * @return boolean True if the image was captured, false otherwise. + */ + public boolean wasImageCaptured() { + return !mDropped; + } + + /** + * The sequence ID for this failed capture that was returned by the + * {@link CameraDevice#capture} family of functions. + * + * <p>The sequence ID is a unique monotonically increasing value starting from 0, + * incremented every time a new group of requests is submitted to the CameraDevice.</p> + * + * @return int The ID for the sequence of requests that this capture failure is the result of + * + * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted + */ + public int getSequenceId() { + return mSequenceId; + } +} diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index 3ec5ca0..f30bcc5 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -17,11 +17,13 @@ package android.hardware.camera2; import android.hardware.camera2.impl.CameraMetadataNative; +import android.hardware.camera2.CameraDevice.CaptureListener; import android.os.Parcel; import android.os.Parcelable; import android.view.Surface; import java.util.HashSet; +import java.util.Objects; /** @@ -62,30 +64,37 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable { private Object mUserTag; /** - * Construct empty request - * @hide + * Construct empty request. + * + * Used by Binder to unparcel this object only. */ - public CaptureRequest() { + private CaptureRequest() { mSettings = new CameraMetadataNative(); mSurfaceSet = new HashSet<Surface>(); } /** - * Clone from source capture request + * Clone from source capture request. + * + * Used by the Builder to create an immutable copy. */ + @SuppressWarnings("unchecked") private CaptureRequest(CaptureRequest source) { mSettings = new CameraMetadataNative(source.mSettings); mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone(); } /** - * Take ownership of passed-in settings + * Take ownership of passed-in settings. + * + * Used by the Builder to create a mutable CaptureRequest. */ private CaptureRequest(CameraMetadataNative settings) { mSettings = settings; mSurfaceSet = new HashSet<Surface>(); } + @SuppressWarnings("unchecked") @Override public <T> T get(Key<T> key) { return mSettings.get(key); @@ -108,6 +117,34 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable { return mUserTag; } + /** + * Determine whether this CaptureRequest is equal to another CaptureRequest. + * + * <p>A request is considered equal to another is if it's set of key/values is equal, it's + * list of output surfaces is equal, and the user tag is equal.</p> + * + * @param other Another instance of CaptureRequest. + * + * @return True if the requests are the same, false otherwise. + */ + @Override + public boolean equals(Object other) { + return other instanceof CaptureRequest + && equals((CaptureRequest)other); + } + + private boolean equals(CaptureRequest other) { + return other != null + && Objects.equals(mUserTag, other.mUserTag) + && mSurfaceSet.equals(other.mSurfaceSet) + && mSettings.equals(other.mSettings); + } + + @Override + public int hashCode() { + return mSettings.hashCode(); + } + public static final Parcelable.Creator<CaptureRequest> CREATOR = new Parcelable.Creator<CaptureRequest>() { @Override diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 377e78a..b82104d 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -37,13 +37,25 @@ import android.hardware.camera2.impl.CameraMetadataNative; public final class CaptureResult extends CameraMetadata { private final CameraMetadataNative mResults; + private final CaptureRequest mRequest; + private final int mSequenceId; /** * Takes ownership of the passed-in properties object * @hide */ - public CaptureResult(CameraMetadataNative results) { + public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) { + if (results == null) { + throw new IllegalArgumentException("results was null"); + } + + if (parent == null) { + throw new IllegalArgumentException("parent was null"); + } + mResults = results; + mRequest = parent; + mSequenceId = sequenceId; } @Override @@ -51,6 +63,61 @@ public final class CaptureResult extends CameraMetadata { return mResults.get(key); } + /** + * Get the request associated with this result. + * + * <p>Whenever a request is successfully captured, with + * {@link CameraDevice.CaptureListener#onCaptureCompleted}, + * the {@code result}'s {@code getRequest()} will return that {@code request}. + * </p> + * + * <p>In particular, + * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() { + * {@literal @}Override + * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) { + * assert(myResult.getRequest.equals(myRequest) == true); + * } + * }; + * </code></pre> + * </p> + * + * @return The request associated with this result. Never {@code null}. + */ + public CaptureRequest getRequest() { + return mRequest; + } + + /** + * Get the frame number associated with this result. + * + * <p>Whenever a request has been processed, regardless of failure or success, + * it gets a unique frame number assigned to its future result/failure.</p> + * + * <p>This value monotonically increments, starting with 0, + * for every new result or failure; and the scope is the lifetime of the + * {@link CameraDevice}.</p> + * + * @return int frame number + */ + public int getFrameNumber() { + return get(REQUEST_FRAME_COUNT); + } + + /** + * The sequence ID for this failure that was returned by the + * {@link CameraDevice#capture} family of functions. + * + * <p>The sequence ID is a unique monotonically increasing value starting from 0, + * incremented every time a new group of requests is submitted to the CameraDevice.</p> + * + * @return int The ID for the sequence of requests that this capture result is a part of + * + * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted + */ + public int getSequenceId() { + return mSequenceId; + } + /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * The key entries below this point are generated from metadata * definitions in /system/media/camera/docs. Do not modify by hand or @@ -523,8 +590,9 @@ public final class CaptureResult extends CameraMetadata { /** * <p> - * Number of frames captured since - * open() + * A frame counter set by the framework. This value monotonically + * increases with every new result (that is, each new result has a unique + * frameCount value). * </p> * <p> * Reset on release() diff --git a/core/java/android/hardware/camera2/Face.java b/core/java/android/hardware/camera2/Face.java index 6bfc535..ef068ca 100644 --- a/core/java/android/hardware/camera2/Face.java +++ b/core/java/android/hardware/camera2/Face.java @@ -128,7 +128,7 @@ public final class Face { * Bounds of the face. * * <p>A rectangle relative to the sensor's - * {@link CameraProperties#SENSOR_INFO_ACTIVE_ARRAY_SIZE}, with (0,0) + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE}, with (0,0) * representing the top-left corner of the active array rectangle.</p> * * <p>There is no constraints on the the Rectangle value other than it diff --git a/core/java/android/hardware/camera2/impl/CameraDevice.java b/core/java/android/hardware/camera2/impl/CameraDevice.java index efbd769..f126472 100644 --- a/core/java/android/hardware/camera2/impl/CameraDevice.java +++ b/core/java/android/hardware/camera2/impl/CameraDevice.java @@ -20,7 +20,7 @@ import static android.hardware.camera2.CameraAccessException.CAMERA_IN_USE; import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CameraMetadata; -import android.hardware.camera2.CameraProperties; +import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureResult; import android.hardware.camera2.ICameraDeviceCallbacks; @@ -88,7 +88,7 @@ public class CameraDevice implements android.hardware.camera2.CameraDevice { } @Override - public CameraProperties getProperties() throws CameraAccessException { + public CameraCharacteristics getProperties() throws CameraAccessException { CameraMetadataNative info = new CameraMetadataNative(); @@ -101,7 +101,7 @@ public class CameraDevice implements android.hardware.camera2.CameraDevice { return null; } - CameraProperties properties = new CameraProperties(info); + CameraCharacteristics properties = new CameraCharacteristics(info); return properties; } @@ -179,24 +179,24 @@ public class CameraDevice implements android.hardware.camera2.CameraDevice { } @Override - public void capture(CaptureRequest request, CaptureListener listener, Handler handler) + public int capture(CaptureRequest request, CaptureListener listener, Handler handler) throws CameraAccessException { - submitCaptureRequest(request, listener, handler, /*streaming*/false); + return submitCaptureRequest(request, listener, handler, /*streaming*/false); } @Override - public void captureBurst(List<CaptureRequest> requests, CaptureListener listener, + public int captureBurst(List<CaptureRequest> requests, CaptureListener listener, Handler handler) throws CameraAccessException { if (requests.isEmpty()) { Log.w(TAG, "Capture burst request list is empty, do nothing!"); - return; + return -1; } // TODO throw new UnsupportedOperationException("Burst capture implemented yet"); } - private void submitCaptureRequest(CaptureRequest request, CaptureListener listener, + private int submitCaptureRequest(CaptureRequest request, CaptureListener listener, Handler handler, boolean repeating) throws CameraAccessException { // Need a valid handler, or current thread needs to have a looper, if @@ -220,7 +220,7 @@ public class CameraDevice implements android.hardware.camera2.CameraDevice { throw e.asChecked(); } catch (RemoteException e) { // impossible - return; + return -1; } if (listener != null) { mCaptureListenerMap.put(requestId, new CaptureListenerHolder(listener, request, @@ -231,21 +231,22 @@ public class CameraDevice implements android.hardware.camera2.CameraDevice { mRepeatingRequestIdStack.add(requestId); } + return requestId; } } @Override - public void setRepeatingRequest(CaptureRequest request, CaptureListener listener, + public int setRepeatingRequest(CaptureRequest request, CaptureListener listener, Handler handler) throws CameraAccessException { - submitCaptureRequest(request, listener, handler, /*streaming*/true); + return submitCaptureRequest(request, listener, handler, /*streaming*/true); } @Override - public void setRepeatingBurst(List<CaptureRequest> requests, CaptureListener listener, + public int setRepeatingBurst(List<CaptureRequest> requests, CaptureListener listener, Handler handler) throws CameraAccessException { if (requests.isEmpty()) { Log.w(TAG, "Set Repeating burst request list is empty, do nothing!"); - return; + return -1; } // TODO throw new UnsupportedOperationException("Burst capture implemented yet"); @@ -429,14 +430,16 @@ public class CameraDevice implements android.hardware.camera2.CameraDevice { return; } - final CaptureResult resultAsCapture = new CaptureResult(result); + final CaptureRequest request = holder.getRequest(); + final CaptureResult resultAsCapture = new CaptureResult(result, request, requestId); holder.getHandler().post( new Runnable() { + @Override public void run() { holder.getListener().onCaptureCompleted( CameraDevice.this, - holder.getRequest(), + request, resultAsCapture); } }); diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java index c13438a..6d7b03e 100644 --- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java +++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java @@ -101,7 +101,7 @@ public class CameraMetadataNative extends CameraMetadata implements Parcelable { /** * Set a camera metadata field to a value. The field definitions can be - * found in {@link CameraProperties}, {@link CaptureResult}, and + * found in {@link CameraCharacteristics}, {@link CaptureResult}, and * {@link CaptureRequest}. * * @param key The metadata field to write. diff --git a/core/java/android/hardware/camera2/package.html b/core/java/android/hardware/camera2/package.html index e9d9cea..9f6c2a9 100644 --- a/core/java/android/hardware/camera2/package.html +++ b/core/java/android/hardware/camera2/package.html @@ -34,7 +34,7 @@ framerate on most Android devices.</p> CameraDevices} provide a set of static property information that describes the hardware device and the available settings and output parameters for the device. This information is provided through the -{@link android.hardware.camera2.CameraProperties} object.</p> +{@link android.hardware.camera2.CameraCharacteristics} object.</p> <p>To capture or stream images from a camera device, the application must first configure a set of output Surfaces for use with the camera diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java index b914940..c106514 100644 --- a/core/java/android/net/MobileDataStateTracker.java +++ b/core/java/android/net/MobileDataStateTracker.java @@ -211,8 +211,6 @@ public class MobileDataStateTracker extends BaseNetworkStateTracker { private class MobileDataStateReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - // Assume this isn't a provisioning network. - mNetworkInfo.setIsConnectedToProvisioningNetwork(false); if (intent.getAction().equals(TelephonyIntents. ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN)) { String apnName = intent.getStringExtra(PhoneConstants.DATA_APN_KEY); @@ -244,6 +242,11 @@ public class MobileDataStateTracker extends BaseNetworkStateTracker { if (!TextUtils.equals(apnType, mApnType)) { return; } + // Assume this isn't a provisioning network. + mNetworkInfo.setIsConnectedToProvisioningNetwork(false); + if (DBG) { + log("Broadcast received: " + intent.getAction() + " apnType=" + apnType); + } int oldSubtype = mNetworkInfo.getSubtype(); int newSubType = TelephonyManager.getDefault().getNetworkType(); @@ -351,6 +354,8 @@ public class MobileDataStateTracker extends BaseNetworkStateTracker { } return; } + // Assume this isn't a provisioning network. + mNetworkInfo.setIsConnectedToProvisioningNetwork(false); String reason = intent.getStringExtra(PhoneConstants.FAILURE_REASON_KEY); String apnName = intent.getStringExtra(PhoneConstants.DATA_APN_KEY); if (DBG) { diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index a99705b..2ab5a91 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -887,8 +887,9 @@ public abstract class PreferenceActivity extends ListActivity implements /** * Subclasses should override this method and verify that the given fragment is a valid type - * to be attached to this activity. The default implementation returns <code>true</code> prior - * to Key Lime Pie, <code>false</code> otherwise. + * to be attached to this activity. The default implementation returns <code>true</code> for + * apps built for <code>android:targetSdkVersion</code> older than + * {@link android.os.Build.VERSION_CODES#KITKAT}. For later versions, it will throw an exception. * @param fragmentName the class name of the Fragment about to be attached to this activity. * @return true if the fragment class name is valid for this Activity and false otherwise. */ diff --git a/core/java/android/provider/Downloads.java b/core/java/android/provider/Downloads.java index 9999760..b2d9b93 100644 --- a/core/java/android/provider/Downloads.java +++ b/core/java/android/provider/Downloads.java @@ -410,6 +410,8 @@ public final class Downloads { /** The column that is used to count retries */ public static final String COLUMN_FAILED_CONNECTIONS = "numfailed"; + public static final String COLUMN_ALLOW_WRITE = "allow_write"; + /** * default value for {@link #COLUMN_LAST_UPDATESRC}. * This value is used when this column's value is not relevant. diff --git a/core/jni/android/graphics/Typeface.cpp b/core/jni/android/graphics/Typeface.cpp index ff62fff..a7a0bb2 100644 --- a/core/jni/android/graphics/Typeface.cpp +++ b/core/jni/android/graphics/Typeface.cpp @@ -44,7 +44,13 @@ static SkTypeface* Typeface_create(JNIEnv* env, jobject, jstring name, } static SkTypeface* Typeface_createFromTypeface(JNIEnv* env, jobject, SkTypeface* family, int style) { - return SkTypeface::CreateFromTypeface(family, (SkTypeface::Style)style); + SkTypeface* face = SkTypeface::CreateFromTypeface(family, (SkTypeface::Style)style); + // return the default font at the best style if the requested style does not + // exist in the provided family + if (NULL == face) { + face = SkTypeface::CreateFromName(NULL, (SkTypeface::Style)style); + } + return face; } static void Typeface_unref(JNIEnv* env, jobject obj, SkTypeface* face) { diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 0adda56..84a0d37 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -582,9 +582,12 @@ <!-- Don't show lock screen before unlock screen (PIN/pattern/password) --> <bool name="config_enableLockBeforeUnlockScreen">false</bool> - <!-- Diable lockscreen rotation by default --> + <!-- Disable lockscreen rotation by default --> <bool name="config_enableLockScreenRotation">false</bool> + <!-- Disable lockscreen transparent bars by default --> + <bool name="config_enableLockScreenTransparentBars">false</bool> + <!-- Enable puk unlockscreen by default. If unlock screen is disabled, the puk should be unlocked through Emergency Dialer --> <bool name="config_enable_puk_unlock_screen">true</bool> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 8370b9f..14b319f 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1282,6 +1282,7 @@ <java-symbol type="bool" name="config_disableMenuKeyInLockScreen" /> <java-symbol type="bool" name="config_enableLockBeforeUnlockScreen" /> <java-symbol type="bool" name="config_enableLockScreenRotation" /> + <java-symbol type="bool" name="config_enableLockScreenTransparentBars" /> <java-symbol type="bool" name="config_lidControlsSleep" /> <java-symbol type="bool" name="config_reverseDefaultRotation" /> <java-symbol type="bool" name="config_showNavigationBar" /> diff --git a/docs/downloads/training/Scheduler.zip b/docs/downloads/training/Scheduler.zip Binary files differnew file mode 100644 index 0000000..81dfb5f --- /dev/null +++ b/docs/downloads/training/Scheduler.zip diff --git a/docs/html/training/best-background.jd b/docs/html/training/best-background.jd new file mode 100644 index 0000000..917eabb --- /dev/null +++ b/docs/html/training/best-background.jd @@ -0,0 +1,8 @@ +page.title=Best Practices for Background Jobs +page.trainingcourse=true + +@jd:body + + +<p>These classes show you how to run jobs in the background to boost your +application's performance and minimize its drain on the battery.</p> diff --git a/docs/html/training/scheduling/alarms.jd b/docs/html/training/scheduling/alarms.jd new file mode 100644 index 0000000..758dc95 --- /dev/null +++ b/docs/html/training/scheduling/alarms.jd @@ -0,0 +1,312 @@ +page.title=Scheduling Repeating Alarms +parent.title=Using Wake Locks +parent.link=index.html + +trainingnavtop=true + +@jd:body + +<div id="tb-wrapper"> +<div id="tb"> + +<!-- table of contents --> +<h2>This lesson teaches you to</h2> +<ol> + <li><a href="#set">Set a Repeating Alarm</a></li> + <li><a href="#cancel">Cancel an Alarm</a></li> + <li><a href="#boot">Start an Alarm When the Device Boots</a></li> +</ol> + +<h2>Try it out</h2> + +<div class="download-box"> + <a href="{@docRoot}shareables/training/Scheduler.zip" +class="button">Download the sample</a> + <p class="filename">Scheduler.zip</p> +</div> + +</div> +</div> + +<p>Alarms (based on the {@link android.app.AlarmManager} class) give you a way to perform +time-based operations outside the lifetime of your application. +For example, you could use an alarm to initiate a long-running operation, such +as starting a service once a day to download a weather forecast.</p> + +<p>Alarms have these characteristics:</p> +<ul> + +<li>They let you fire Intents at set times and/or intervals.</li> + +<li>You can use them in conjunction with broadcast receivers to start services and perform +other operations.</li> + +<li>They operate outside of your application, so you can use them to trigger events or +actions even when your app is not running, and even if the device itself is asleep.</li> + +<li>They help you to minimize your app's resource requirements. You can schedule operations +without relying on timers or continuously running background services.</li> + +</ul> + +<p class="note"><strong>Note:</strong> For timing operations that are guaranteed to occur +<em>during</em> the lifetime of your application, +instead consider using the {@link android.os.Handler} class in conjunction with +{@link java.util.Timer} and {@link java.lang.Thread}. This approach gives Android better +control over system resources.</p> + +<h2 id="set">Set a Repeating Alarm</h2> + +<p>As described above, repeating alarms are a good choice for scheduling regular events or +data lookups. A repeating alarm has the following characteristics:</p> + +<ul> +<li>A alarm type. For more discussion, see <a href="#type">Choose an alarm type</a>.</li> +<li>A trigger time. If the trigger time you specify is in the past, the alarm triggers +immediately.</li> +<li>The alarm's interval. For example, once a day, every hour, every 5 seconds, and so on.</li> +<li>A pending intent that fires when the alarm is triggered. When you set a second alarm +that uses the same pending intent, it replaces the original alarm.</li> +</ul> + +<p>Every choice you make in designing your repeating alarm can have consequences in how your +app uses (or abuses) system resources. Even a carefully managed alarm can have a major impact +on battery life. Follow these guidelines as you design your app:</p> + +<ul> +<li>Keep your alarm frequency to a minimum.</li> +<li>Don't wake up the device unnecessarily (this behavior is determined by the alarm type, +as described in <a href="#type">Choose an alarm type</a>).</li> +<li>Don't make your alarm's trigger time any more precise than it has to be: + +<ul> +<li>Use {@link android.app.AlarmManager#setInexactRepeating setInexactRepeating()} instead +of {@link android.app.AlarmManager#setRepeating setRepeating()} whenever possible. +When you use {@link android.app.AlarmManager#setInexactRepeating setInexactRepeating()}, +Android synchronizes multiple inexact repeating alarms and fires +them at the same time. This reduces the drain on the battery.</li> +<li>If your alarm's behavior is based on an interval (for example, your alarm +fires once an hour) rather than a precise trigger time (for example, your alarm fires at +7 a.m. sharp and every 20 minutes after that), use an {@code ELAPSED_REALTIME} +alarm type.</li> +</ul></li> + +</ul> + +<h3 id="type">Choose an alarm type</h3> + +<p>One of the first considerations in using a repeating alarm is what its type should be.</p> + + +<p>There are two general clock types for alarms: "elapsed real time" and "real time clock" +(RTC). +Elapsed real time uses the "time since system boot" as a +reference, and real time clock uses UTC (wall clock) time. This means that +elapsed real time is suited to setting an alarm based on the passage of time (for +example, an alarm that fires every 30 seconds) since it isn't affected by +time zone/locale. The real time clock type is better suited for alarms that are dependent +on current locale.</p> + +<p>Both types have a "wakeup" version, which says to wake up the device's CPU if the +screen is off. This ensures that the alarm will fire at the scheduled time. This is useful +if your app has a time dependency—for example, if it has a limited window to perform a +particular operation. If you don't use the wakeup version of your alarm type, then +all the repeating alarms will fire when your device is next awake.</p> + +<p>If you simply need your alarm to fire at a particular interval (for example, every half +hour), use one of the elapsed real time types. In general, this is the better choice.</p> + +<p>If you need your alarm to fire at a particular time of day, +then choose one of the clock-based real time clock types. Note, however, that this approach can +have some drawbacks—the app may not translate well to other locales, and if the user +changes the device's time setting, it could cause unexpected behavior in your app.</p> + +<p>Here is the list of types:</p> + +<ul> + +<li>{@link android.app.AlarmManager#ELAPSED_REALTIME}—Fires the pending intent based +on the amount of time since the device was booted, but doesn't wake up the device. The +elapsed time includes any time during which the device was asleep.</li> + +<li>{@link android.app.AlarmManager#ELAPSED_REALTIME_WAKEUP}—Wakes up the device and +fires the pending intent after the specified length of time has elapsed since device +boot.</li> + +<li>{@link android.app.AlarmManager#RTC}—Fires the pending intent +at the specified time but does not wake up the device.</li> + +<li>{@link android.app.AlarmManager#RTC_WAKEUP}—Wakes up the +device to fire the pending intent at the specified time.</li> +</ul> + +<h4>ELAPSED_REALTIME_WAKEUP examples</h3> + +<p>Here are some examples of using {@link android.app.AlarmManager#ELAPSED_REALTIME_WAKEUP}. +</p> + +<p>Wake up the device to fire the alarm in 30 minutes, and every 30 minutes +after that:</p> + +<pre> +// Hopefully your alarm will have a lower frequency than this! +alarmMgr.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, + AlarmManager.INTERVAL_HALF_HOUR, + AlarmManager.INTERVAL_HALF_HOUR, alarmIntent);</pre> + +<p>Wake up the device to fire a one-time (non-repeating) alarm in one minute:</p> + +<pre>private AlarmManager alarmMgr; +private PendingIntent alarmIntent; +... +alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); +Intent intent = new Intent(context, AlarmReceiver.class); +alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0); + +alarmMgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, + SystemClock.elapsedRealtime() + + 60 * 1000, alarmIntent);</pre> + + +<h4>RTC examples</h3> + +<p>Here are some examples of using {@link android.app.AlarmManager#RTC_WAKEUP}.</p> + +<p>Wake up the device to fire the alarm at approximately 2:00 p.m., and repeat once a day +at the same time:</p> + +<pre>// Set the alarm to start at approximately 2:00 p.m. +Calendar calendar = Calendar.getInstance(); +calendar.setTimeInMillis(System.currentTimeMillis()); +calendar.set(Calendar.HOUR_OF_DAY, 14); + +// With setInexactRepeating(), you have to use one of the AlarmManager interval +// constants--in this case, AlarmManager.INTERVAL_DAY. +alarmMgr.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), + AlarmManager.INTERVAL_DAY, alarmIntent);</pre> + +<p>Wake up the device to fire the alarm at precisely 8:30 a.m., and every 20 minutes +thereafter:</p> + +<pre>private AlarmManager alarmMgr; +private PendingIntent alarmIntent; +... +alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); +Intent intent = new Intent(context, AlarmReceiver.class); +alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0); + +// Set the alarm to start at 8:30 a.m. +Calendar calendar = Calendar.getInstance(); +calendar.setTimeInMillis(System.currentTimeMillis()); +calendar.set(Calendar.HOUR_OF_DAY, 8); +calendar.set(Calendar.MINUTE, 30); + +// setRepeating() lets you specify a precise custom interval--in this case, +// 20 minutes. +alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), + 1000 * 60 * 20, alarmIntent);</pre> + +<h3>Decide how precise your alarm needs to be</h3> + +<p>As described above, choosing the alarm type is often the first step in creating an alarm. +A further distinction is how precise you need your alarm to be. For most apps, +{@link android.app.AlarmManager#setInexactRepeating setInexactRepeating()} is the right +choice. +When you use this method, Android synchronizes multiple inexact repeating alarms and fires +them at the same time. This reduces the drain on the battery.</p> + +<p>For the rare app that has rigid time requirements—for example, the alarm needs to +fire precisely at 8:30 a.m., and every hour on the hour +thereafter—use {@link android.app.AlarmManager#setRepeating setRepeating()}. But you +should avoid using exact alarms if possible.</p> + +<p>With {@link android.app.AlarmManager#setInexactRepeating setInexactRepeating()}, +you can't specify a custom interval the way you can with +{@link android.app.AlarmManager#setRepeating setRepeating()}. You have to use one of the +interval constants, such as {@link android.app.AlarmManager#INTERVAL_FIFTEEN_MINUTES}, +{@link android.app.AlarmManager#INTERVAL_DAY}, and so on. See {@link android.app.AlarmManager} +for the complete list. +</p> + +<h2 id="cancel">Cancel an Alarm</h2> + +<p>Depending on your app, you may want to include the ability to cancel the alarm. +To cancel an alarm, call {@link android.app.AlarmManager#cancel cancel()} on the Alarm +Manager, passing in the {@link android.app.PendingIntent} you no longer want to fire. For +example:</p> + +<pre>// If the alarm has been set, cancel it. +if (alarmMgr!= null) { + alarmMgr.cancel(alarmIntent); +}</pre> + +<h2 id="boot">Start an Alarm When the Device Boots</h2> + +<p>By default, all alarms are canceled when a device shuts down. +To prevent this from happening, you can design your application +to automatically restart a repeating alarm if the user reboots the device. This ensures +that the {@link android.app.AlarmManager} will continue doing its task without the user +needing to manually restart the alarm.</p> + + +<p>Here are the steps:</p> +<ol> +<li>Set the <a href="{@docRoot}reference/android/Manifest.permission.html#RECEIVE_BOOT_COMPLETED"> +{@code RECEIVE_BOOT_COMPLETED}</a> permission in your application's manifest. This allows +your app to receive the +{@link android.content.Intent#ACTION_BOOT_COMPLETED} that is broadcast after the system +finishes booting (this only works if the app has already been launched by the user at least once): +<pre> +<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/></pre> +</li> + +<li>Implement a {@link android.content.BroadcastReceiver} to receive the broadcast: +<pre>public class SampleBootReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { + // Set the alarm here. + } + } +}</pre></li> + +<li>Add the receiver to your app's manifest file with an intent filter that filters on +the {@link android.content.Intent#ACTION_BOOT_COMPLETED} action: + +<pre><receiver android:name=".SampleBootReceiver" + android:enabled="false"> + <intent-filter> + <action android:name="android.intent.action.BOOT_COMPLETED"></action> + </intent-filter> +</receiver></pre> + + +<p>Notice that in the manifest, the boot receiver is set to +{@code android:enabled="false"}. This means that the receiver will not be called +unless the application explicitly enables it. This prevents the boot receiver from being +called unnecessarily. You can enable a receiver (for example, if the user sets an alarm) +as follows:</p> + +<pre>ComponentName receiver = new ComponentName(context, SampleBootReceiver.class); +PackageManager pm = context.getPackageManager(); + +pm.setComponentEnabledSetting(receiver, + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, + PackageManager.DONT_KILL_APP); +</pre> + +<p>Once you enable the receiver this way, it will stay enabled, even if the user reboots +the device. In other words, programmatically enabling the receiver overrides the +manifest setting, even across reboots. The receiver will stay enabled until your app disables it. +You can disable a receiver (for example, if the user cancels an alarm) as follows:</p> + +<pre>ComponentName receiver = new ComponentName(context, SampleBootReceiver.class); +PackageManager pm = context.getPackageManager(); + +pm.setComponentEnabledSetting(receiver, + PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP);</pre> + +</li> +</ol> diff --git a/docs/html/training/scheduling/index.jd b/docs/html/training/scheduling/index.jd new file mode 100644 index 0000000..9ffbc16 --- /dev/null +++ b/docs/html/training/scheduling/index.jd @@ -0,0 +1,66 @@ +page.title=Managing Device Awake State +page.tags="" + +trainingnavtop=true +startpage=true + + +@jd:body +<div id="tb-wrapper"> +<div id="tb"> + +<!-- Required platform, tools, add-ons, devices, knowledge, etc. --> +<h2>Dependencies and prerequisites</h2> + +<ul> + <li>Android 1.6 (API Level 4) or higher</li> +</ul> + +<h2>Try it out</h2> + +<div class="download-box"> + <a href="{@docRoot}shareables/training/Scheduler.zip" +class="button">Download the sample</a> + <p class="filename">Scheduler.zip</p> +</div> + +</div> +</div> + +<p> +When an Android device is left idle, it will first dim, then turn off the screen, and +ultimately turn off the CPU. This prevents the device's battery from quickly getting +drained. Yet there are times when your application might require a different behavior:</p> + +<ul> + +<li>Apps such as games or movie apps may need to keep the screen turned on.</p> + +<li>Other applications may not need the screen to remain on, but they may require the CPU + to keep running until a critical operation finishes.</p> + +</ul> + +<p> +This class describes how to keep a device awake when necessary without draining +its battery. +</p> +<h2>Lessons</h2> + +<dl> + <dt> + <strong><a href="wakelock.html">Keeping the Device Awake</a></strong> + </dt> + <dd> + Learn how to keep the screen or CPU awake as needed, while minimizing the impact + on battery life. + </dd> + <dt> + <strong><a href="alarms.html">Scheduling Repeating Alarms</a></strong> + </dt> + <dd> + Learn how to use repeating alarms to schedule operations that take place outside + of the lifetime of the application, even if the application is not running and/or the + device is asleep. + </dd> +</dl> diff --git a/docs/html/training/scheduling/wakelock.jd b/docs/html/training/scheduling/wakelock.jd new file mode 100644 index 0000000..0fab7be --- /dev/null +++ b/docs/html/training/scheduling/wakelock.jd @@ -0,0 +1,215 @@ +page.title=Keeping the Device Awake + +trainingnavtop=true + +@jd:body + +<div id="tb-wrapper"> +<div id="tb"> + +<!-- table of contents --> +<h2>This lesson teaches you to</h2> +<ol> + <li><a href="#screen">Keep the Screen On</a></li> + <li><a href="#cpu">Keep the CPU On</a></li> +</ol> + +<h2>Try it out</h2> + +<div class="download-box"> + <a href="{@docRoot}shareables/training/Scheduler.zip" +class="button">Download the sample</a> + <p class="filename">Scheduler.zip</p> +</div> + +</div> +</div> + + +<p>To avoid draining the battery, an Android device that is left idle quickly falls asleep. +However, there are times when an application needs to wake up the screen or the CPU +and keep it awake to complete some work.</p> + +<p>The approach you take depends on the needs of your app. However, a general rule of thumb +is that you should use the most lightweight approach possible for your app, to minimize your +app's impact on system resources. The following sections describe how to handle the cases +where the device's default sleep behavior is incompatible with the requirements of your app.</p> + +<h2 id="screen">Keep the Screen On</h2> + +<p>Certain apps need to keep the screen turned on, such as games or movie apps. The best +way to do this is to use the +{@link android.view.WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON FLAG_KEEP_SCREEN_ON} +in your activity (and only in an activity, never in a service or +other app component). For example:</p> + +<pre>public class MainActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + <strong>getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);</strong> + }</pre> + +<p>The advantage of this approach is that unlike wake locks (discussed in <a href="#cpu"> +Keep the CPU On</a>), it doesn't require special permission, and the platform correctly +manages the user moving between applications, without your app needing to worry about +releasing unused resources.</p> + +<p>Another way to implement this is in your application's layout XML file, by using the +{@link android.R.attr#keepScreenOn android:keepScreenOn} attribute:</p> + +<pre><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + <strong>android:keepScreenOn="true"></strong> + ... +</RelativeLayout></pre> + +<p>Using <code>android:keepScreenOn="true"</code> is equivalent to using +{@link android.view.WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON FLAG_KEEP_SCREEN_ON}. +You can use whichever approach is best for your app. The advantage of setting the flag +programmatically in your activity is that it gives you the option of programmatically +clearing the flag later and thereby allowing the screen to turn off.</p> + +<p class="note"><strong>Note:</strong> You don't need to clear the +{@link android.view.WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON FLAG_KEEP_SCREEN_ON} +flag unless you no longer want the screen to +stay on in your running application (for example, if you want the screen to time out +after a certain period of inactivity). The window manager takes care of +ensuring that the right things happen when the app goes into the background or returns to +the foreground. But if you want to explicitly clear the flag and thereby allow the screen to +turn off again, use {@link android.view.Window#clearFlags clearFlags()}: +{@code getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)}.</p> + +<h2 id="cpu">Keep the CPU On</h2> + +<div class="sidebox-wrapper"> +<div class="sidebox"> + <h2>Alternatives to using wake locks</h2> + +<ul> + +<li>If your app is performing long-running HTTP downloads, consider using +{@link android.app.DownloadManager}.</li> + +<li>If your app is synchronizing data from an external server, consider creating a +<a href="{@docRoot}training/sync-adapters/index.html">sync +adapter</a>.</li> + +<li>If your app relies on background services, consider using +<a href="{@docRoot}training/scheduling/alarms.html">repeating alarms</a> +or <a href="{@docRoot}google/gcm/index.html">Google Cloud Messaging</a> to trigger these +services at specific intervals.</li> + +</ul> +</div> +</div> + + +<p>If you need to keep the CPU running in order to complete some work before the device goes +to sleep, you can use a {@link android.os.PowerManager} system service feature called +wake locks. Wake locks allow your application to control the power state of the host device.</p> + +<p>Creating and holding wake locks can have a dramatic impact on the host device's battery +life. Thus you should use wake locks only when strictly necessary +and hold them for as short a time as possible. For example, you should never need to use a +wake lock in an activity. As described above, if you want +to keep the screen on in your activity, use +{@link android.view.WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON FLAG_KEEP_SCREEN_ON}.</p> + + +<p>One legitimate case for using a wake lock might be a background service +that needs to grab a wake lock to keep the CPU running to do work while the screen is off. +Again, though, this practice should be minimized because of its impact on battery life.</p> + +<p>To use a wake lock, the first step is to add the {@link android.Manifest.permission#WAKE_LOCK} + permission to your application's manifest file:</p> + +<pre><uses-permission android:name="android.permission.WAKE_LOCK" /></pre> + +<p>If your app includes a broadcast receiver that uses a service to do some +work, you can manage your wake lock through a +{@link android.support.v4.content.WakefulBroadcastReceiver}, as described in +<a href="#wakeful">Using a WakefulBroadcastReceiver</a>. This is the preferred approach. +If your app doesn't follow that pattern, here is how you set a wake lock +directly:</p> + +<pre> +PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); +Wakelock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, + "MyWakelockTag"); +wakeLock.acquire();</pre> + +<p>To release the wake lock, call +{@link android.os.PowerManager.WakeLock#release wakelock.release()}. This releases your +claim to the CPU. It's important to release a wake lock as soon as your app is finished +using it to avoid draining the battery.</p> + +<h3 id="wakeful">Using WakefulBroadcastReceiver</h3> + +<p>Using a broadcast receiver in conjunction with a service lets you manage the life cycle +of a background task.</p> + +<p>A {@link android.support.v4.content.WakefulBroadcastReceiver} is a special type of +broadcast receiver that takes care of +creating and managing a +{@link android.os.PowerManager#PARTIAL_WAKE_LOCK} for your app. A +{@link android.support.v4.content.WakefulBroadcastReceiver} +passes off the work to a {@link android.app.Service} +(typically an +{@link android.app.IntentService}), while ensuring that the device does not +go back to sleep in the transition. If you don't hold a wake lock while transitioning +the work to a service, you are effectively allowing the device to go back to sleep before +the work completes. The net result is that the app might not finish doing the work until +some arbitrary point in the future, which is not what you want.</p> + +<p>The first step in using a +{@link android.support.v4.content.WakefulBroadcastReceiver} is to add it to your +manifest, as with any other broadcast receiver:</p> + +<pre><receiver android:name=".MyWakefulReceiver"></receiver></pre> + +<p>The following code starts {@code MyIntentService} with the method +{@link android.support.v4.content.WakefulBroadcastReceiver#startWakefulService startWakefulService()}. +This method is comparable to {@link android.content.Context#startService startService()}, except that +the {@link android.support.v4.content.WakefulBroadcastReceiver} is holding a +wake lock when the service starts. The intent that is passed with +{@link android.support.v4.content.WakefulBroadcastReceiver#startWakefulService startWakefulService()} +holds an extra identifying the wake lock:</p> + +<pre>public class MyWakefulReceiver extends WakefulBroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + + // Start the service, keeping the device awake while the service is + // launching. This is the Intent to deliver to the service. + Intent service = new Intent(context, MyIntentService.class); + startWakefulService(context, service); + } +}</pre> + +<p>When the service is finished, it calls +{@link android.support.v4.content.WakefulBroadcastReceiver#completeWakefulIntent MyWakefulReceiver.completeWakefulIntent()} +to release the wake lock. The +{@link android.support.v4.content.WakefulBroadcastReceiver#completeWakefulIntent completeWakefulIntent()} +method has as its parameter the same intent that was +passed in from the {@link android.support.v4.content.WakefulBroadcastReceiver}:</p> +<pre> +public class MyIntentService extends IntentService { + public static final int NOTIFICATION_ID = 1; + private NotificationManager mNotificationManager; + NotificationCompat.Builder builder; + public MyIntentService() { + super("MyIntentService"); + } + @Override + protected void onHandleIntent(Intent intent) { + Bundle extras = intent.getExtras(); + // Do the work that requires your app to keep the CPU running. + // ... + // Release the wake lock provided by the WakefulBroadcastReceiver. + MyWakefulReceiver.completeWakefulIntent(intent); + } +}</pre> diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs index 8c2752e..a3c9dac 100644 --- a/docs/html/training/training_toc.cs +++ b/docs/html/training/training_toc.cs @@ -993,49 +993,13 @@ include the action bar on devices running Android 2.1 or higher." <li class="nav-section"> <div class="nav-section-header"> - <a href="<?cs var:toroot ?>training/best-performance.html"> + <a href="<?cs var:toroot ?>training/best-background.html"> <span class="small">Best Practices for</span><br/> - Performance + Background Jobs </a> </div> <ul> - <li> - <a href="<?cs var:toroot ?>training/articles/perf-tips.html" - description= - "How to optimize your app's performance in various ways to improve its - responsiveness and battery efficiency." - >Performance Tips</a> - </li> - - <li class="nav-section"> - <div class="nav-section-header"> - <a href="<?cs var:toroot ?>training/improving-layouts/index.html" - description= - "How to identify problems in your app's layout performance and improve the UI - responsiveness." - >Improving Layout Performance</a> - </div> - <ul> - <li><a href="<?cs var:toroot ?>training/improving-layouts/optimizing-layout.html"> - Optimizing Layout Hierarchies - </a> - </li> - <li><a href="<?cs var:toroot ?>training/improving-layouts/reusing-layouts.html"> - Re-using Layouts with <include/> - </a> - </li> - <li><a href="<?cs var:toroot ?>training/improving-layouts/loading-ondemand.html"> - Loading Views On Demand - </a> - </li> - <li><a href="<?cs var:toroot ?>training/improving-layouts/smooth-scrolling.html"> - Making ListView Scrolling Smooth - </a> - </li> - </ul> - </li> - <li class="nav-section"> <div class="nav-section-header"> <a href="<?cs var:toroot ?>training/run-background-service/index.html" @@ -1077,6 +1041,70 @@ include the action bar on devices running Android 2.1 or higher." </ul> </li> + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>training/scheduling/index.html" + description="How to use repeating alarms and wake locks + to run background jobs." + >Managing Device Awake State</a> + </div> + <ul> + <li><a href="<?cs var:toroot ?>training/scheduling/wakelock.html"> + Keeping the Device Awake</a> + </li> + <li><a href="<?cs var:toroot ?>training/scheduling/alarms.html"> + Scheduling Repeating Alarms</a> + </li> + </ul> + </li> + </ul> + </li> <!-- end of Background Jobs --> + + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>training/best-performance.html"> + <span class="small">Best Practices for</span><br/> + Performance + </a> + </div> + <ul> + + <li> + <a href="<?cs var:toroot ?>training/articles/perf-tips.html" + description= + "How to optimize your app's performance in various ways to improve its + responsiveness and battery efficiency." + >Performance Tips</a> + </li> + + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>training/improving-layouts/index.html" + description= + "How to identify problems in your app's layout performance and improve the UI + responsiveness." + >Improving Layout Performance</a> + </div> + <ul> + <li><a href="<?cs var:toroot ?>training/improving-layouts/optimizing-layout.html"> + Optimizing Layout Hierarchies + </a> + </li> + <li><a href="<?cs var:toroot ?>training/improving-layouts/reusing-layouts.html"> + Re-using Layouts with <include/> + </a> + </li> + <li><a href="<?cs var:toroot ?>training/improving-layouts/loading-ondemand.html"> + Loading Views On Demand + </a> + </li> + <li><a href="<?cs var:toroot ?>training/improving-layouts/smooth-scrolling.html"> + Making ListView Scrolling Smooth + </a> + </li> + </ul> + </li> + <li class="nav-section"> <div class="nav-section-header"> <a href="/training/monitoring-device-state/index.html" diff --git a/media/java/android/media/audiofx/Visualizer.java b/media/java/android/media/audiofx/Visualizer.java index 9197ed8..580a4f9 100644 --- a/media/java/android/media/audiofx/Visualizer.java +++ b/media/java/android/media/audiofx/Visualizer.java @@ -93,6 +93,24 @@ public class Visualizer { */ public static final int SCALING_MODE_AS_PLAYED = 1; + /** + * @hide + * CANDIDATE FOR PUBLIC API + * Defines a measurement mode with no requested measurement. + */ + public static final int MEASUREMENT_MODE_NONE = 0; + + /** + * @hide + * CANDIDATE FOR PUBLIC API + * Defines a measurement mode which computes the peak and RMS value in mB, where 0mB is the + * maximum sample value, and -9600mB is the minimum value. + * Values for peak and RMS can be retrieved with {@link #getIntMeasurements(int, int[])}, where + * the array holds the peak value at index {@link #MEASUREMENT_INDEX_PEAK} in the measurement + * array, and the RMS value at index {@link #MEASUREMENT_INDEX_RMS}. + */ + public static final int MEASUREMENT_MODE_PEAK_RMS = 1 << 0; + // to keep in sync with frameworks/base/media/jni/audioeffect/android_media_Visualizer.cpp private static final int NATIVE_EVENT_PCM_CAPTURE = 0; private static final int NATIVE_EVENT_FFT_CAPTURE = 1; @@ -350,6 +368,47 @@ public class Visualizer { } /** + * @hide + * CANDIDATE FOR PUBLIC API + * Sets the combination of measurement modes to be performed by this audio effect. + * @param mode a mask of the measurements to perform. The valid values are + * {@link #MEASUREMENT_MODE_NONE} (to cancel any measurement) + * or {@link #MEASUREMENT_MODE_PEAK_RMS}. + * @return {@link #SUCCESS} in case of success, {@link #ERROR_BAD_VALUE} in case of failure. + * @throws IllegalStateException + */ + public int setMeasurementMode(int mode) + throws IllegalStateException { + synchronized (mStateLock) { + if (mState == STATE_UNINITIALIZED) { + throw(new IllegalStateException("setMeasurementMode() called in wrong state: " + + mState)); + } + return native_setMeasurementMode(mode); + } + } + + /** + * @hide + * CANDIDATE FOR PUBLIC API + * Returns the current measurement modes performed by this audio effect + * @return the mask of the measurements, + * {@link #MEASUREMENT_MODE_NONE} (when no measurements are performed) + * or {@link #MEASUREMENT_MODE_PEAK_RMS}. + * @throws IllegalStateException + */ + public int getMeasurementMode() + throws IllegalStateException { + synchronized (mStateLock) { + if (mState == STATE_UNINITIALIZED) { + throw(new IllegalStateException("getMeasurementMode() called in wrong state: " + + mState)); + } + return native_getMeasurementMode(); + } + } + + /** * Returns the sampling rate of the captured audio. * @return the sampling rate in milliHertz. */ @@ -437,6 +496,51 @@ public class Visualizer { } } + /** + * @hide + * CANDIDATE FOR PUBLIC API + * A class to store peak and RMS values. + * Peak and RMS are expressed in mB, as described in the + * {@link Visualizer#MEASUREMENT_MODE_PEAK_RMS} measurement mode. + */ + public static final class MeasurementPeakRms { + /** + * @hide + * CANDIDATE FOR PUBLIC API + */ + public int mPeak; + /** + * @hide + * CANDIDATE FOR PUBLIC API + */ + public int mRms; + } + + /** + * @hide + * Retrieves the latest peak and RMS measurement. + * Sets the peak and RMS fields of the {@link Visualizer.MeasurementPeakRms} to the latest + * measured values. + * @param measurement a non-null {@link Visualizer.MeasurementPeakRms} instance to store + * the measurement values. + * @return {@link #SUCCESS} in case of success, {@link #ERROR_BAD_VALUE}, + * {@link #ERROR_NO_MEMORY}, {@link #ERROR_INVALID_OPERATION} or {@link #ERROR_DEAD_OBJECT} + * in case of failure. + */ + public int getMeasurementPeakRms(MeasurementPeakRms measurement) { + if (measurement == null) { + Log.e(TAG, "Cannot store measurements in a null object"); + return ERROR_BAD_VALUE; + } + synchronized (mStateLock) { + if (mState != STATE_ENABLED) { + throw (new IllegalStateException("getMeasurementPeakRms() called in wrong state: " + + mState)); + } + return native_getPeakRms(measurement); + } + } + //--------------------------------------------------------- // Interface definitions //-------------------- @@ -640,12 +744,18 @@ public class Visualizer { private native final int native_getScalingMode(); + private native final int native_setMeasurementMode(int mode); + + private native final int native_getMeasurementMode(); + private native final int native_getSamplingRate(); private native final int native_getWaveForm(byte[] waveform); private native final int native_getFft(byte[] fft); + private native final int native_getPeakRms(MeasurementPeakRms measurement); + private native final int native_setPeriodicCapture(int rate, boolean waveForm, boolean fft); //--------------------------------------------------------- diff --git a/media/jni/audioeffect/android_media_Visualizer.cpp b/media/jni/audioeffect/android_media_Visualizer.cpp index 4d77cfd..40cd06b 100644 --- a/media/jni/audioeffect/android_media_Visualizer.cpp +++ b/media/jni/audioeffect/android_media_Visualizer.cpp @@ -43,6 +43,8 @@ using namespace android; // ---------------------------------------------------------------------------- static const char* const kClassPathName = "android/media/audiofx/Visualizer"; +static const char* const kClassPeakRmsPathName = + "android/media/audiofx/Visualizer$MeasurementPeakRms"; struct fields_t { // these fields provide access from C++ to the... @@ -50,6 +52,8 @@ struct fields_t { jmethodID midPostNativeEvent; // event post callback method jfieldID fidNativeVisualizer; // stores in Java the native Visualizer object jfieldID fidJniData; // stores in Java additional resources used by the native Visualizer + jfieldID fidPeak; // to access Visualizer.MeasurementPeakRms.mPeak + jfieldID fidRms; // to access Visualizer.MeasurementPeakRms.mRms }; static fields_t fields; @@ -257,6 +261,14 @@ android_media_visualizer_native_init(JNIEnv *env) fields.clazzEffect = (jclass)env->NewGlobalRef(clazz); + // Get the Visualizer.MeasurementPeakRms class + clazz = env->FindClass(kClassPeakRmsPathName); + if (clazz == NULL) { + ALOGE("Can't find %s", kClassPeakRmsPathName); + return; + } + jclass clazzMeasurementPeakRms = (jclass)env->NewGlobalRef(clazz); + // Get the postEvent method fields.midPostNativeEvent = env->GetStaticMethodID( fields.clazzEffect, @@ -283,7 +295,24 @@ android_media_visualizer_native_init(JNIEnv *env) ALOGE("Can't find Visualizer.%s", "mJniData"); return; } + // fidPeak + fields.fidPeak = env->GetFieldID( + clazzMeasurementPeakRms, + "mPeak", "I"); + if (fields.fidPeak == NULL) { + ALOGE("Can't find Visualizer.MeasurementPeakRms.%s", "mPeak"); + return; + } + // fidRms + fields.fidRms = env->GetFieldID( + clazzMeasurementPeakRms, + "mRms", "I"); + if (fields.fidRms == NULL) { + ALOGE("Can't find Visualizer.MeasurementPeakRms.%s", "mPeak"); + return; + } + env->DeleteGlobalRef(clazzMeasurementPeakRms); } static void android_media_visualizer_effect_callback(int32_t event, @@ -513,6 +542,26 @@ android_media_visualizer_native_getScalingMode(JNIEnv *env, jobject thiz) } static jint +android_media_visualizer_native_setMeasurementMode(JNIEnv *env, jobject thiz, jint mode) +{ + Visualizer* lpVisualizer = getVisualizer(env, thiz); + if (lpVisualizer == NULL) { + return VISUALIZER_ERROR_NO_INIT; + } + return translateError(lpVisualizer->setMeasurementMode(mode)); +} + +static jint +android_media_visualizer_native_getMeasurementMode(JNIEnv *env, jobject thiz) +{ + Visualizer* lpVisualizer = getVisualizer(env, thiz); + if (lpVisualizer == NULL) { + return MEASUREMENT_MODE_NONE; + } + return lpVisualizer->getMeasurementMode(); +} + +static jint android_media_visualizer_native_getSamplingRate(JNIEnv *env, jobject thiz) { Visualizer* lpVisualizer = getVisualizer(env, thiz); @@ -560,6 +609,25 @@ android_media_visualizer_native_getFft(JNIEnv *env, jobject thiz, jbyteArray jFf } static jint +android_media_visualizer_native_getPeakRms(JNIEnv *env, jobject thiz, jobject jPeakRmsObj) +{ + Visualizer* lpVisualizer = getVisualizer(env, thiz); + if (lpVisualizer == NULL) { + return VISUALIZER_ERROR_NO_INIT; + } + int32_t measurements[2]; + jint status = translateError( + lpVisualizer->getIntMeasurements(MEASUREMENT_MODE_PEAK_RMS, + 2, measurements)); + if (status == VISUALIZER_SUCCESS) { + // measurement worked, write the values to the java object + env->SetIntField(jPeakRmsObj, fields.fidPeak, measurements[MEASUREMENT_IDX_PEAK]); + env->SetIntField(jPeakRmsObj, fields.fidRms, measurements[MEASUREMENT_IDX_RMS]); + } + return status; +} + +static jint android_media_setPeriodicCapture(JNIEnv *env, jobject thiz, jint rate, jboolean jWaveform, jboolean jFft) { Visualizer* lpVisualizer = getVisualizer(env, thiz); @@ -606,9 +674,13 @@ static JNINativeMethod gMethods[] = { {"native_getCaptureSize", "()I", (void *)android_media_visualizer_native_getCaptureSize}, {"native_setScalingMode", "(I)I", (void *)android_media_visualizer_native_setScalingMode}, {"native_getScalingMode", "()I", (void *)android_media_visualizer_native_getScalingMode}, + {"native_setMeasurementMode","(I)I", (void *)android_media_visualizer_native_setMeasurementMode}, + {"native_getMeasurementMode","()I", (void *)android_media_visualizer_native_getMeasurementMode}, {"native_getSamplingRate", "()I", (void *)android_media_visualizer_native_getSamplingRate}, {"native_getWaveForm", "([B)I", (void *)android_media_visualizer_native_getWaveForm}, {"native_getFft", "([B)I", (void *)android_media_visualizer_native_getFft}, + {"native_getPeakRms", "(Landroid/media/audiofx/Visualizer$MeasurementPeakRms;)I", + (void *)android_media_visualizer_native_getPeakRms}, {"native_setPeriodicCapture","(IZZ)I",(void *)android_media_setPeriodicCapture}, }; diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java index 56d73c0..9d8489c 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java @@ -18,7 +18,7 @@ package com.android.mediaframeworktest.integration; import android.graphics.SurfaceTexture; import android.hardware.camera2.CameraMetadata; -import android.hardware.camera2.CameraProperties; +import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.ICameraDeviceCallbacks; import android.hardware.camera2.ICameraDeviceUser; @@ -269,7 +269,7 @@ public class CameraDeviceBinderTest extends AndroidTestCase { assertEquals(CameraBinderTestUtils.NO_ERROR, status); assertFalse(info.isEmpty()); - assertNotNull(info.get(CameraProperties.SCALER_AVAILABLE_FORMATS)); + assertNotNull(info.get(CameraCharacteristics.SCALER_AVAILABLE_FORMATS)); } @SmallTest diff --git a/packages/DocumentsUI/AndroidManifest.xml b/packages/DocumentsUI/AndroidManifest.xml index 19a29f2..71a0567 100644 --- a/packages/DocumentsUI/AndroidManifest.xml +++ b/packages/DocumentsUI/AndroidManifest.xml @@ -11,7 +11,8 @@ <!-- TODO: allow rotation when state saving is in better shape --> <activity android:name=".DocumentsActivity" - android:theme="@style/Theme"> + android:theme="@style/Theme" + android:icon="@drawable/ic_doc_text"> <intent-filter android:priority="100"> <action android:name="android.intent.action.OPEN_DOCUMENT" /> <category android:name="android.intent.category.DEFAULT" /> diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_breadcrumb_arrow.png b/packages/DocumentsUI/res/drawable-hdpi/ic_breadcrumb_arrow.png Binary files differindex 8a170b0..7c4c1a6 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_breadcrumb_arrow.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_breadcrumb_arrow.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_accept.png b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_accept.png Binary files differindex a7726e7..649985d 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_accept.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_accept.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_cancel.png b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_cancel.png Binary files differindex 658a6dd..791bf6d 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_cancel.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_cancel.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_select_item.png b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_select_item.png Binary files differindex 57b3069..6c32af1 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_select_item.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_select_item.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert.png Binary files differindex 40b4326..5bc4e05 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info.png Binary files differnew file mode 100644 index 0000000..ffb076c --- /dev/null +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png Binary files differindex a1e2b7f..179db33 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_apk.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_apk.png Binary files differindex 36fccad..8704a78 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_apk.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_apk.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio.png Binary files differindex 3aba859..465838d 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_certificate.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_certificate.png Binary files differindex 778f9ba..434a6e6 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_certificate.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_certificate.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_codes.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_codes.png Binary files differindex 65b03d1..940d185 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_codes.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_codes.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_compressed.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_compressed.png Binary files differindex e9719b8..35cdc1f 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_compressed.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_compressed.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_contact.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_contact.png Binary files differindex 4b2107c..8f3b82c 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_contact.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_contact.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_event.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_event.png Binary files differindex 9ca3b35..a3df893 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_event.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_event.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_font.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_font.png Binary files differindex dc3bebc..92225ba 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_font.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_font.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic.png Binary files differindex 68d973f..55b9b7d 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image.png Binary files differindex 69afe06..72b611d 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_pdf.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_pdf.png Binary files differindex 7e2bef1..e08b0e6 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_pdf.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_pdf.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_presentation.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_presentation.png Binary files differindex 9b9729b..0c55e8c 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_presentation.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_presentation.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_spreadsheet.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_spreadsheet.png Binary files differindex ab917ce..880564e 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_spreadsheet.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_spreadsheet.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_text.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_text.png Binary files differindex 9b96b2f..cb60165 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_text.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_text.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video.png Binary files differindex 89a0d37..9a942d2 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_drawer.png b/packages/DocumentsUI/res/drawable-hdpi/ic_drawer.png Binary files differdeleted file mode 100644 index ff7b1de..0000000 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_drawer.png +++ /dev/null diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_glyph.png b/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_glyph.png Binary files differnew file mode 100644 index 0000000..053c0b8 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_glyph.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_shadow.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_shadow.9.png Binary files differindex 594ce69..4a710ce 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_shadow.9.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_shadow.9.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_shadow_tablet.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_shadow_tablet.9.png Binary files differindex 6ee47a9..a1bbc8b 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_shadow_tablet.9.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_drawer_shadow_tablet.9.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_background.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_background.9.png Binary files differindex 8797e94..7c3d69d 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_background.9.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_background.9.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_focused.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_focused.9.png Binary files differnew file mode 100644 index 0000000..8b90094 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_focused.9.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_pressed.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_pressed.9.png Binary files differnew file mode 100644 index 0000000..1e41d7a --- /dev/null +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_pressed.9.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png Binary files differindex 7c9aee3..a6e56ea 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_gradient_bg.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_gradient_bg.9.png Binary files differindex 4b9eeb0..b896c55 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_gradient_bg.9.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_gradient_bg.9.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_copy.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_copy.png Binary files differindex 85b60ac..c907bf6 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_copy.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_copy.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_delete.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_delete.png Binary files differindex 3a039e0..1fe7af7 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_delete.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_delete.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_disconnect.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_disconnect.png Binary files differindex 164d2de..8a88407 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_disconnect.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_disconnect.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_new_folder.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_new_folder.png Binary files differindex 490d7ca..638c812 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_new_folder.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_new_folder.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png Binary files differindex d49b58f..2a007d2 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_rename.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_rename.png Binary files differindex e8b000c..2756327 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_rename.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_rename.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_search.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_search.png Binary files differindex a5ed309..b00328b 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_search.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_search.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_settings.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_settings.png Binary files differindex 2406366..03e0cc7 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_settings.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_settings.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_share.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_share.png Binary files differindex 61b7099..cf7d2f4 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_share.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_share.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_sortby.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_sortby.png Binary files differindex 05df3d7..78638f7 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_sortby.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_sortby.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_undo.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_undo.png Binary files differindex 6ac9dc1..20dce0f 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_undo.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_undo.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_grid.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_grid.png Binary files differindex 0779f5c..3f3b536 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_grid.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_grid.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_list.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_list.png Binary files differindex ab7e5cb..79bffc9 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_list.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_list.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_open.png b/packages/DocumentsUI/res/drawable-hdpi/ic_open.png Binary files differindex 17f4a41..595c4b9 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_open.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_open.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_popout.png b/packages/DocumentsUI/res/drawable-hdpi/ic_popout.png Binary files differindex f89f813..3700512 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_popout.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_popout.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_download.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_download.png Binary files differindex baf5810..52f1c70 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_download.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_download.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder.png Binary files differindex 4ee96b9..915e118 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent.png Binary files differindex 5374e27..303b7f9 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard.png Binary files differindex caf58030..2375e17 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_usb.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_usb.png Binary files differindex cfa69f1..5c0c87b 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_usb.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_usb.png diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_subdirectory_arrow.png b/packages/DocumentsUI/res/drawable-hdpi/ic_subdirectory_arrow.png Binary files differindex f5c5f18..99060cd 100644 --- a/packages/DocumentsUI/res/drawable-hdpi/ic_subdirectory_arrow.png +++ b/packages/DocumentsUI/res/drawable-hdpi/ic_subdirectory_arrow.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_breadcrumb_arrow.png b/packages/DocumentsUI/res/drawable-mdpi/ic_breadcrumb_arrow.png Binary files differindex 623d9db..09e77af 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_breadcrumb_arrow.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_breadcrumb_arrow.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_accept.png b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_accept.png Binary files differindex 11779bb..f42be13 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_accept.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_accept.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_cancel.png b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_cancel.png Binary files differindex bebd803..b47e306 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_cancel.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_cancel.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_select_item.png b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_select_item.png Binary files differindex af2412f..903a041 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_select_item.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_select_item.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert.png Binary files differindex b092ea0..4835d5f 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info.png Binary files differnew file mode 100644 index 0000000..2d29442 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png Binary files differindex adf23f4..318dd5b 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_apk.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_apk.png Binary files differindex 1c6f8d1..932995e 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_apk.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_apk.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio.png Binary files differindex 40cdc76..cb94d99 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_certificate.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_certificate.png Binary files differindex 94339f4..240d7f4 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_certificate.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_certificate.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_codes.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_codes.png Binary files differindex a84490c..6c6aad6 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_codes.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_codes.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_compressed.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_compressed.png Binary files differindex f827d6d..8fc7bea 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_compressed.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_compressed.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_contact.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_contact.png Binary files differindex 33f1367..290ad3a 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_contact.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_contact.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_event.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_event.png Binary files differindex 6597785..e5eda72 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_event.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_event.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_font.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_font.png Binary files differindex 8b1cded..00bd478 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_font.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_font.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic.png Binary files differindex f73ab71..a1bd14e 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image.png Binary files differindex 0217430..b81b1e5 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_pdf.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_pdf.png Binary files differindex 4fca711..3381c42 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_pdf.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_pdf.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_presentation.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_presentation.png Binary files differindex 0860552..68cc971 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_presentation.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_presentation.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_spreadsheet.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_spreadsheet.png Binary files differindex 7431e83..2934e5a 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_spreadsheet.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_spreadsheet.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_text.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_text.png Binary files differindex c540a80..95565b3 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_text.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_text.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video.png Binary files differindex ab0222a..3a5b798 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_glyph.png b/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_glyph.png Binary files differnew file mode 100644 index 0000000..f616d3b --- /dev/null +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_glyph.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_shadow.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_shadow.9.png Binary files differindex 99a3026..9343a39 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_shadow.9.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_shadow.9.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_shadow_tablet.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_shadow_tablet.9.png Binary files differindex b85d70b..fabb56e 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_shadow_tablet.9.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_drawer_shadow_tablet.9.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_background.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_background.9.png Binary files differindex d632b58..567a06b 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_background.9.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_background.9.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_focused.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_focused.9.png Binary files differnew file mode 100644 index 0000000..1525572 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_focused.9.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_pressed.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_pressed.9.png Binary files differnew file mode 100644 index 0000000..16c9296 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_pressed.9.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png Binary files differindex 7cf9178..6e63b8c 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_gradient_bg.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_gradient_bg.9.png Binary files differindex 792b269..1120864 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_gradient_bg.9.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_gradient_bg.9.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_copy.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_copy.png Binary files differindex ea1ea52..fbf5c88 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_copy.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_copy.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_delete.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_delete.png Binary files differindex 9992321..ecb4bf2 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_delete.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_delete.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_disconnect.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_disconnect.png Binary files differindex cb09782..96b01b9 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_disconnect.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_disconnect.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_new_folder.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_new_folder.png Binary files differindex 65dfaa6..ee95809 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_new_folder.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_new_folder.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png Binary files differindex 795a28d..7a63828 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_rename.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_rename.png Binary files differindex a56b776..9ab2f78 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_rename.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_rename.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_search.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_search.png Binary files differindex 4e44240..2d0ab8a 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_search.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_search.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_settings.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_settings.png Binary files differindex 67f8e4d..cf5575a 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_settings.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_settings.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_share.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_share.png Binary files differindex ecd5a17..368fbd6 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_share.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_share.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_sortby.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_sortby.png Binary files differindex 549a381..2155d02 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_sortby.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_sortby.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_undo.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_undo.png Binary files differindex 43b7220..d56db42 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_undo.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_undo.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_grid.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_grid.png Binary files differindex 0e40d89..0a0c8f1 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_grid.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_grid.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_list.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_list.png Binary files differindex d0c1717..8a724ac 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_list.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_list.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_open.png b/packages/DocumentsUI/res/drawable-mdpi/ic_open.png Binary files differindex 56cfa49..adfacc1 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_open.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_open.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_popout.png b/packages/DocumentsUI/res/drawable-mdpi/ic_popout.png Binary files differindex 98a853f..b17de2d 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_popout.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_popout.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_download.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_download.png Binary files differindex 60ebeef..4f903df 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_download.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_download.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder.png Binary files differindex 944de5b..4352d08 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent.png Binary files differindex 45f7e0b..bf9b1b6 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard.png Binary files differindex 3b065f3..6adc2a3 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_usb.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_usb.png Binary files differindex fb83d5d..d318dba 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_usb.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_usb.png diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_subdirectory_arrow.png b/packages/DocumentsUI/res/drawable-mdpi/ic_subdirectory_arrow.png Binary files differindex 276f00d..a7a2b12 100644 --- a/packages/DocumentsUI/res/drawable-mdpi/ic_subdirectory_arrow.png +++ b/packages/DocumentsUI/res/drawable-mdpi/ic_subdirectory_arrow.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_breadcrumb_arrow.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_breadcrumb_arrow.png Binary files differindex 9109320..33c8f27 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_breadcrumb_arrow.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_breadcrumb_arrow.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_accept.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_accept.png Binary files differindex 89e580b..ef9641d 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_accept.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_accept.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_cancel.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_cancel.png Binary files differindex d35b802..9c3d008 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_cancel.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_cancel.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_select_item.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_select_item.png Binary files differindex 254cb18..4cf4f3f 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_select_item.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_select_item.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert.png Binary files differindex 7d1468a..17f9f9e 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info.png Binary files differnew file mode 100644 index 0000000..2f9cc58 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png Binary files differindex 29e009e..e67aa8d 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_apk.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_apk.png Binary files differindex baded5e..d0e2594 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_apk.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_apk.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio.png Binary files differindex 908aafb..2e66f03 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_certificate.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_certificate.png Binary files differindex 1c3dee4..64e0d42 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_certificate.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_certificate.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_codes.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_codes.png Binary files differindex a068209..a4f70ba 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_codes.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_codes.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_compressed.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_compressed.png Binary files differindex af0e36d..4897221 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_compressed.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_compressed.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_contact.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_contact.png Binary files differindex e6833dc..4cec994 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_contact.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_contact.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_event.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_event.png Binary files differindex ff67036..5e46b71 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_event.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_event.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_font.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_font.png Binary files differindex aaca230..977cfd2 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_font.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_font.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic.png Binary files differindex 82cf876..e05c4b4 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image.png Binary files differindex 5221393..98d3f79 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_pdf.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_pdf.png Binary files differindex 3e94790..ff2ff14 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_pdf.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_pdf.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_presentation.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_presentation.png Binary files differindex 5c4edf6..2917377 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_presentation.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_presentation.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_spreadsheet.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_spreadsheet.png Binary files differindex d10dcf7..87c6538 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_spreadsheet.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_spreadsheet.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_text.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_text.png Binary files differindex f15cdfb..97c4500 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_text.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_text.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video.png Binary files differindex f751be7..1a8e632 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_glyph.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_glyph.png Binary files differnew file mode 100644 index 0000000..002ccd9 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_glyph.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_shadow.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_shadow.9.png Binary files differindex 96acf35..027c64a 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_shadow.9.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_shadow.9.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_shadow_tablet.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_shadow_tablet.9.png Binary files differindex d21193a..2c39a67 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_shadow_tablet.9.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_drawer_shadow_tablet.9.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_background.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_background.9.png Binary files differindex 2655912..8f7f4ab 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_background.9.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_background.9.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_focused.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_focused.9.png Binary files differnew file mode 100644 index 0000000..b82ae20 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_focused.9.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_pressed.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_pressed.9.png Binary files differnew file mode 100644 index 0000000..edd6266 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_pressed.9.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png Binary files differindex 3344980..c3af9ec 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_gradient_bg.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_gradient_bg.9.png Binary files differindex 450a486..60ce8d5 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_gradient_bg.9.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_gradient_bg.9.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_copy.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_copy.png Binary files differindex 614b1e3..c650185 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_copy.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_copy.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_delete.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_delete.png Binary files differindex 7ab538f..0771ed2 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_delete.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_delete.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_disconnect.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_disconnect.png Binary files differindex 904672a..91c31e3 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_disconnect.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_disconnect.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_new_folder.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_new_folder.png Binary files differindex f94d3f6..f06b298 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_new_folder.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_new_folder.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png Binary files differindex 0603bbf..c3a7eaa 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_rename.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_rename.png Binary files differindex b63b70c..17e09b3 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_rename.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_rename.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_search.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_search.png Binary files differindex 9dd1938..0ab604f 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_search.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_search.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_settings.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_settings.png Binary files differindex bba370e..5054fc8 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_settings.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_settings.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_share.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_share.png Binary files differindex 1cf6dca..d3d386e 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_share.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_share.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_sortby.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_sortby.png Binary files differindex a23bee4..85c8734 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_sortby.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_sortby.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_undo.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_undo.png Binary files differindex 0cadd92..82c1a30 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_undo.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_undo.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_grid.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_grid.png Binary files differindex 8ec013c..0258312 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_grid.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_grid.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_list.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_list.png Binary files differindex 45dd72f..ccace9d 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_list.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_list.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_open.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_open.png Binary files differindex b64d8f1..a56940a 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_open.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_open.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_popout.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_popout.png Binary files differindex 3a33bce..f6a0af4 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_popout.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_popout.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download.png Binary files differindex 6f64d8c..6c6447e 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder.png Binary files differindex 4d5564c..c916e0b 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent.png Binary files differindex 000a521..714f2ee 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard.png Binary files differindex 223cff1..6016c08 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_usb.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_usb.png Binary files differindex d77023b..b05b9a4 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_usb.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_usb.png diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_subdirectory_arrow.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_subdirectory_arrow.png Binary files differindex 7f3364d..1da8196 100644 --- a/packages/DocumentsUI/res/drawable-xhdpi/ic_subdirectory_arrow.png +++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_subdirectory_arrow.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert.png Binary files differindex 865f3a5..8bee0dc 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info.png Binary files differnew file mode 100644 index 0000000..ad6c59b --- /dev/null +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png Binary files differindex 7515993..4c56bd0 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_apk.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_apk.png Binary files differindex 4eaf6ce..5f64229 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_apk.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_apk.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio.png Binary files differindex 3659f4a..48ab9c7 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_codes.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_codes.png Binary files differindex 0ec4e86..945119a 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_codes.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_codes.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_contact.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_contact.png Binary files differindex bdd99d6..5263365 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_contact.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_contact.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic.png Binary files differindex c459556..c098866 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image.png Binary files differindex 5991968..06d8d9c 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_pdf.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_pdf.png Binary files differindex cd46f79..a3b146b 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_pdf.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_pdf.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_text.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_text.png Binary files differindex 84960b9..bc4ce79 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_text.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_text.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_drawer_glyph.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_drawer_glyph.png Binary files differnew file mode 100644 index 0000000..adee4a3 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_drawer_glyph.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_drawer_shadow.9.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_drawer_shadow.9.png Binary files differindex 97fd9d6..1a59e1a8 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_drawer_shadow.9.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_drawer_shadow.9.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_focused.9.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_focused.9.png Binary files differnew file mode 100644 index 0000000..901af80 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_focused.9.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_pressed.9.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_pressed.9.png Binary files differnew file mode 100644 index 0000000..e21e350 --- /dev/null +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_pressed.9.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_copy.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_copy.png Binary files differindex 1f72cce..f23e23c 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_copy.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_copy.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_delete.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_delete.png Binary files differindex f4dca7f..f67c72e 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_delete.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_delete.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_new_folder.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_new_folder.png Binary files differindex 038a597..b17ba1d 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_new_folder.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_new_folder.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_rename.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_rename.png Binary files differindex 140abba..eed0eaf 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_rename.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_rename.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_search.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_search.png Binary files differindex 6079806..40fb392 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_search.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_search.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_settings.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_settings.png Binary files differindex ecd7de1..b988ab5 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_settings.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_settings.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_share.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_share.png Binary files differindex 9084717..6ace932 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_share.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_share.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_sortby.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_sortby.png Binary files differindex 358f97a..867c8e8 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_sortby.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_sortby.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_undo.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_undo.png Binary files differindex eec1b95..e4c9f8a 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_undo.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_undo.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_grid.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_grid.png Binary files differindex 175a76c..9e27d63 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_grid.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_grid.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_list.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_list.png Binary files differindex 07c7c02..e4c679a 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_list.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_list.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download.png Binary files differindex d68f9c5..3b8afc9 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent.png Binary files differindex d95ebb5..a3215f2 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard.png Binary files differindex cc27107..873a553 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_usb.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_usb.png Binary files differindex 1562609..d213e7c 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_usb.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_usb.png diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_subdirectory_arrow.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_subdirectory_arrow.png Binary files differindex 8710c68..db53a01 100644 --- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_subdirectory_arrow.png +++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_subdirectory_arrow.png diff --git a/packages/DocumentsUI/res/drawable/item_root.xml b/packages/DocumentsUI/res/drawable/item_root.xml index 6f201cc..60d4ab0 100644 --- a/packages/DocumentsUI/res/drawable/item_root.xml +++ b/packages/DocumentsUI/res/drawable/item_root.xml @@ -15,8 +15,8 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@color/item_root_activated" /> - <item android:state_activated="true" android:drawable="@color/item_root_activated" /> - <item android:state_focused="true" android:drawable="@color/item_root_activated" /> + <item android:state_pressed="true" android:drawable="@color/item_root_pressed" /> + <item android:state_activated="true" android:drawable="@color/item_root_focused" /> + <item android:state_focused="true" android:drawable="@color/item_root_focused" /> <item android:drawable="@android:color/transparent" /> </selector> diff --git a/packages/DocumentsUI/res/layout/fragment_backend.xml b/packages/DocumentsUI/res/layout/fragment_backend.xml deleted file mode 100644 index 2648de2..0000000 --- a/packages/DocumentsUI/res/layout/fragment_backend.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2013 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. ---> - -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <GridView - android:id="@+id/grid" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:listSelector="@android:color/transparent" - android:paddingTop="?android:attr/listPreferredItemPaddingStart" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" /> - -</FrameLayout> diff --git a/packages/DocumentsUI/res/layout/fragment_directory.xml b/packages/DocumentsUI/res/layout/fragment_directory.xml index 07bf127..98ded34 100644 --- a/packages/DocumentsUI/res/layout/fragment_directory.xml +++ b/packages/DocumentsUI/res/layout/fragment_directory.xml @@ -38,6 +38,11 @@ android:id="@+id/grid" android:layout_width="match_parent" android:layout_height="match_parent" + android:paddingStart="@dimen/grid_padding_horiz" + android:paddingEnd="@dimen/grid_padding_horiz" + android:paddingTop="@dimen/grid_padding" + android:paddingBottom="@dimen/grid_padding" + android:scrollbarStyle="outsideOverlay" android:listSelector="@android:color/transparent" android:visibility="gone" /> diff --git a/packages/DocumentsUI/res/layout/fragment_save.xml b/packages/DocumentsUI/res/layout/fragment_save.xml index 49038bc..570b517 100644 --- a/packages/DocumentsUI/res/layout/fragment_save.xml +++ b/packages/DocumentsUI/res/layout/fragment_save.xml @@ -17,36 +17,49 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" - android:gravity="center_vertical" - android:background="@color/chip" - android:minHeight="?android:attr/listPreferredItemHeightSmall"> - - <ImageView - android:id="@android:id/icon" - android:layout_width="24dp" - android:layout_height="24dp" - android:layout_marginStart="8dp" - android:layout_marginEnd="8dp" - android:scaleType="centerInside" - android:contentDescription="@null" /> - - <EditText - android:id="@android:id/title" - android:layout_width="0dip" + android:orientation="vertical"> + + <!-- Le sigh, this really should be an asset --> + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="#ccc" /> + + <LinearLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="1" - android:singleLine="true" - android:selectAllOnFocus="true" /> - - <Button - android:id="@android:id/button1" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:background="?android:attr/selectableItemBackground" - android:text="@string/menu_save" - android:textAllCaps="true" - android:textAppearance="?android:attr/textAppearanceSmall" - android:padding="8dp" /> + android:orientation="horizontal" + android:gravity="center_vertical" + android:background="#ddd" + android:minHeight="?android:attr/listPreferredItemHeightSmall"> + + <ImageView + android:id="@android:id/icon" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + android:scaleType="centerInside" + android:contentDescription="@null" /> + + <EditText + android:id="@android:id/title" + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_weight="1" + android:singleLine="true" + android:selectAllOnFocus="true" /> + + <Button + android:id="@android:id/button1" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:background="?android:attr/selectableItemBackground" + android:text="@string/menu_save" + android:textAllCaps="true" + android:textAppearance="?android:attr/textAppearanceSmall" + android:padding="8dp" /> + + </LinearLayout> </LinearLayout> diff --git a/packages/DocumentsUI/res/values-sw720dp/dimens.xml b/packages/DocumentsUI/res/values-sw720dp/dimens.xml index 3be243a..3a75dfa 100644 --- a/packages/DocumentsUI/res/values-sw720dp/dimens.xml +++ b/packages/DocumentsUI/res/values-sw720dp/dimens.xml @@ -19,4 +19,6 @@ <item type="dimen" name="dialog_width">85%</item> <item type="dimen" name="dialog_height">90%</item> + + <dimen name="grid_padding_horiz">20dp</dimen> </resources> diff --git a/packages/DocumentsUI/res/values/colors.xml b/packages/DocumentsUI/res/values/colors.xml index 6d62759..adeff77 100644 --- a/packages/DocumentsUI/res/values/colors.xml +++ b/packages/DocumentsUI/res/values/colors.xml @@ -16,5 +16,6 @@ <resources> <color name="chip">#ddd</color> - <color name="item_root_activated">#cccccc</color> + <color name="item_root_pressed">#33cccccc</color> + <color name="item_root_focused">#66cccccc</color> </resources> diff --git a/packages/DocumentsUI/res/values/dimens.xml b/packages/DocumentsUI/res/values/dimens.xml index 25b0f84..4a93cdb 100644 --- a/packages/DocumentsUI/res/values/dimens.xml +++ b/packages/DocumentsUI/res/values/dimens.xml @@ -20,6 +20,9 @@ <dimen name="grid_width">180dp</dimen> <dimen name="grid_height">180dp</dimen> + <dimen name="grid_padding">4dp</dimen> + <dimen name="grid_padding_horiz">4dp</dimen> + <bool name="show_as_dialog">false</bool> <bool name="always_show_summary">false</bool> </resources> diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java index 911e9ed..de1f130 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java @@ -17,6 +17,7 @@ package com.android.documentsui; import static com.android.documentsui.DocumentsActivity.TAG; +import static com.android.documentsui.DocumentsActivity.State.ACTION_CREATE; import static com.android.documentsui.DocumentsActivity.State.ACTION_MANAGE; import static com.android.documentsui.DocumentsActivity.State.MODE_GRID; import static com.android.documentsui.DocumentsActivity.State.MODE_LIST; @@ -39,6 +40,7 @@ import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.Point; import android.graphics.drawable.Drawable; +import android.graphics.drawable.InsetDrawable; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; @@ -64,6 +66,7 @@ import android.widget.AbsListView.RecyclerListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; +import android.widget.FrameLayout; import android.widget.GridView; import android.widget.ImageView; import android.widget.ListView; @@ -657,7 +660,7 @@ public class DirectoryFragment extends Fragment { if (extras != null) { final String info = extras.getString(DocumentsContract.EXTRA_INFO); if (info != null) { - mFooters.add(new MessageFooter(2, R.drawable.ic_dialog_alert, info)); + mFooters.add(new MessageFooter(2, R.drawable.ic_dialog_info, info)); } final String error = extras.getString(DocumentsContract.EXTRA_ERROR); if (error != null) { @@ -707,6 +710,13 @@ public class DirectoryFragment extends Fragment { convertView = inflater.inflate(R.layout.item_doc_list, parent, false); } else if (state.derivedMode == MODE_GRID) { convertView = inflater.inflate(R.layout.item_doc_grid, parent, false); + + // Apply padding to grid items + final FrameLayout grid = (FrameLayout) convertView; + final int gridPadding = getResources() + .getDimensionPixelSize(R.dimen.grid_padding); + grid.setForeground(new InsetDrawable(grid.getForeground(), gridPadding)); + grid.setBackground(new InsetDrawable(grid.getBackground(), gridPadding)); } else { throw new IllegalStateException(); } @@ -878,8 +888,14 @@ public class DirectoryFragment extends Fragment { line2.setVisibility(hasLine2 ? View.VISIBLE : View.GONE); } - final boolean enabled = Document.MIME_TYPE_DIR.equals(docMimeType) + boolean enabled = Document.MIME_TYPE_DIR.equals(docMimeType) || MimePredicate.mimeMatches(state.acceptMimes, docMimeType); + + // Read-only files aren't actually enabled when creating + if (state.action == ACTION_CREATE && (docFlags & Document.FLAG_SUPPORTS_WRITE) == 0) { + enabled = false; + } + if (enabled) { setEnabledRecursive(convertView, true); icon.setAlpha(1f); diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java index 34cb14f..28e2bd9 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java @@ -58,6 +58,5 @@ public class DirectoryView extends FrameLayout { public void setPosition(float position) { mPosition = position; setX((mWidth > 0) ? (mPosition * mWidth) : 0); - setAlpha(1f - position); } } diff --git a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java index 457bb19..6d5475d 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java @@ -87,8 +87,8 @@ import libcore.io.IoUtils; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.Collection; +import java.util.HashMap; import java.util.List; public class DocumentsActivity extends Activity { @@ -96,6 +96,8 @@ public class DocumentsActivity extends Activity { private static final String EXTRA_STATE = "state"; + private static final int CODE_FORWARD = 42; + private boolean mShowAsDialog; private SearchView mSearchView; @@ -169,7 +171,7 @@ public class DocumentsActivity extends Activity { mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, - R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close); + R.drawable.ic_drawer_glyph, R.string.drawer_open, R.string.drawer_close); mDrawerLayout.setDrawerListener(mDrawerListener); mDrawerLayout.setDrawerShadow(R.drawable.ic_drawer_shadow, GravityCompat.START); @@ -843,11 +845,24 @@ public class DocumentsActivity extends Activity { public void onAppPicked(ResolveInfo info) { final Intent intent = new Intent(getIntent()); - intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT); + intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_FORWARD_RESULT); intent.setComponent(new ComponentName( info.activityInfo.applicationInfo.packageName, info.activityInfo.name)); - startActivity(intent); - finish(); + startActivityForResult(intent, CODE_FORWARD); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + Log.d(TAG, "onActivityResult() code=" + resultCode); + + // Only relay back results when not canceled; otherwise stick around to + // let the user pick another app/backend. + if (requestCode == CODE_FORWARD && resultCode != RESULT_CANCELED) { + setResult(resultCode, data); + finish(); + } else { + super.onActivityResult(requestCode, resultCode, data); + } } public void onDocumentPicked(DocumentInfo doc) { diff --git a/packages/DocumentsUI/src/com/android/documentsui/RecentLoader.java b/packages/DocumentsUI/src/com/android/documentsui/RecentLoader.java index 3659c6e..e390456 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/RecentLoader.java +++ b/packages/DocumentsUI/src/com/android/documentsui/RecentLoader.java @@ -52,6 +52,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; public class RecentLoader extends AsyncTaskLoader<DirectoryResult> { + private static final boolean LOGD = true; public static final int MAX_OUTSTANDING_RECENTS = 2; @@ -63,7 +64,7 @@ public class RecentLoader extends AsyncTaskLoader<DirectoryResult> { /** * Maximum documents from a single root. */ - public static final int MAX_DOCS_FROM_ROOT = 24; + public static final int MAX_DOCS_FROM_ROOT = 64; private static final ExecutorService sExecutor = buildExecutor(); @@ -194,6 +195,11 @@ public class RecentLoader extends AsyncTaskLoader<DirectoryResult> { } } + if (LOGD) { + Log.d(TAG, "Found " + cursors.size() + " of " + mTasks.size() + " recent queries done"); + Log.d(TAG, sExecutor.toString()); + } + final DirectoryResult result = new DirectoryResult(); result.sortOrder = SORT_ORDER_LAST_MODIFIED; diff --git a/packages/DocumentsUI/src/com/android/documentsui/RecentsCreateFragment.java b/packages/DocumentsUI/src/com/android/documentsui/RecentsCreateFragment.java index 5076370..a396f79 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/RecentsCreateFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/RecentsCreateFragment.java @@ -195,12 +195,9 @@ public class RecentsCreateFragment extends Fragment { final SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(stack.root.title); - appendDrawable(builder, crumb); for (int i = stack.size() - 2; i >= 0; i--) { + appendDrawable(builder, crumb); builder.append(stack.get(i).displayName); - if (i > 0) { - appendDrawable(builder, crumb); - } } title.setText(builder); title.setEllipsize(TruncateAt.MIDDLE); diff --git a/packages/DocumentsUI/src/com/android/documentsui/RootsCache.java b/packages/DocumentsUI/src/com/android/documentsui/RootsCache.java index 52d6cc8..15af8aa 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/RootsCache.java +++ b/packages/DocumentsUI/src/com/android/documentsui/RootsCache.java @@ -179,6 +179,8 @@ public class RootsCache { final Multimap<String, RootInfo> roots = ArrayListMultimap.create(); final HashSet<String> stoppedAuthorities = Sets.newHashSet(); + roots.put(mRecentsRoot.authority, mRecentsRoot); + final ContentResolver resolver = mContext.getContentResolver(); final PackageManager pm = mContext.getPackageManager(); final List<ProviderInfo> providers = pm.queryContentProviders( diff --git a/packages/DocumentsUI/src/com/android/documentsui/RootsFragment.java b/packages/DocumentsUI/src/com/android/documentsui/RootsFragment.java index df9bce1..d602622 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/RootsFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/RootsFragment.java @@ -253,6 +253,7 @@ public class RootsFragment extends Fragment { } private static class SectionedRootsAdapter extends SectionedListAdapter { + private final RootsAdapter mRecent; private final RootsAdapter mServices; private final RootsAdapter mShortcuts; private final RootsAdapter mDevices; @@ -260,12 +261,18 @@ public class RootsFragment extends Fragment { public SectionedRootsAdapter( Context context, Collection<RootInfo> roots, Intent includeApps) { + mRecent = new RootsAdapter(context); mServices = new RootsAdapter(context); mShortcuts = new RootsAdapter(context); mDevices = new RootsAdapter(context); mApps = new AppsAdapter(context); for (RootInfo root : roots) { + if (root.authority == null) { + mRecent.add(root); + continue; + } + switch (root.rootType) { case Root.ROOT_TYPE_SERVICE: mServices.add(root); @@ -297,15 +304,18 @@ public class RootsFragment extends Fragment { mShortcuts.sort(comp); mDevices.sort(comp); + if (mRecent.getCount() > 0) { + addSection(mRecent); + } + if (mServices.getCount() > 0) { + addSection(mServices); + } if (mShortcuts.getCount() > 0) { addSection(mShortcuts); } if (mDevices.getCount() > 0) { addSection(mDevices); } - if (mServices.getCount() > 0) { - addSection(mServices); - } if (mApps.getCount() > 0) { addSection(mApps); } @@ -315,12 +325,6 @@ public class RootsFragment extends Fragment { public static class RootComparator implements Comparator<RootInfo> { @Override public int compare(RootInfo lhs, RootInfo rhs) { - if (lhs.authority == null) { - return -1; - } else if (rhs.authority == null) { - return 1; - } - final int score = DocumentInfo.compareToIgnoreCaseNullable(lhs.title, rhs.title); if (score != 0) { return score; diff --git a/packages/DocumentsUI/src/com/android/documentsui/SettingsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/SettingsActivity.java index a85f6a9..d423e3f 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/SettingsActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/SettingsActivity.java @@ -22,6 +22,7 @@ import android.content.Context; import android.os.Bundle; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; +import android.view.MenuItem; public class SettingsActivity extends Activity { private static final String KEY_ADVANCED_DEVICES = "advancedDevices"; @@ -47,9 +48,19 @@ public class SettingsActivity extends Activity { final ActionBar bar = getActionBar(); if (bar != null) { bar.setDisplayShowHomeEnabled(false); + bar.setDisplayHomeAsUpEnabled(true); } } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + public static class SettingsFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { diff --git a/packages/DocumentsUI/src/com/android/documentsui/model/DocumentInfo.java b/packages/DocumentsUI/src/com/android/documentsui/model/DocumentInfo.java index 681cc9b..08a8c13 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/model/DocumentInfo.java +++ b/packages/DocumentsUI/src/com/android/documentsui/model/DocumentInfo.java @@ -181,7 +181,7 @@ public class DocumentInfo implements Durable, Parcelable { @Override public String toString() { - return "Document{name=" + displayName + ", docId=" + documentId + "}"; + return "Document{docId=" + documentId + ", name=" + displayName + "}"; } public boolean isCreateSupported() { diff --git a/packages/DocumentsUI/src/com/android/documentsui/model/RootInfo.java b/packages/DocumentsUI/src/com/android/documentsui/model/RootInfo.java index a870c7b..014901a 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/model/RootInfo.java +++ b/packages/DocumentsUI/src/com/android/documentsui/model/RootInfo.java @@ -185,7 +185,7 @@ public class RootInfo implements Durable, Parcelable { @Override public String toString() { - return "Root{title=" + title + ", rootId=" + rootId + "}"; + return "Root{authority=" + authority + ", rootId=" + rootId + ", title=" + title + "}"; } public Drawable loadIcon(Context context) { diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java index f468abc..0ef5f56 100644 --- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java @@ -96,25 +96,6 @@ public class ExternalStorageProvider extends DocumentsProvider { throw new IllegalStateException(e); } - try { - final String rootId = "documents"; - final File path = Environment.getExternalStoragePublicDirectory( - Environment.DIRECTORY_DOCUMENTS); - mIdToPath.put(rootId, path); - - final RootInfo root = new RootInfo(); - root.rootId = rootId; - root.rootType = Root.ROOT_TYPE_SHORTCUT; - root.flags = Root.FLAG_SUPPORTS_CREATE | Root.FLAG_LOCAL_ONLY - | Root.FLAG_SUPPORTS_SEARCH; - root.title = getContext().getString(R.string.root_documents); - root.docId = getDocIdForFile(path); - mRoots.add(root); - mIdToRoot.put(rootId, root); - } catch (FileNotFoundException e) { - throw new IllegalStateException(e); - } - return true; } @@ -230,14 +211,23 @@ public class ExternalStorageProvider extends DocumentsProvider { public String createDocument(String docId, String mimeType, String displayName) throws FileNotFoundException { final File parent = getFileForDocId(docId); - displayName = validateDisplayName(mimeType, displayName); + File file; - final File file = new File(parent, displayName); if (Document.MIME_TYPE_DIR.equals(mimeType)) { + file = new File(parent, displayName); if (!file.mkdir()) { throw new IllegalStateException("Failed to mkdir " + file); } } else { + displayName = removeExtension(mimeType, displayName); + file = new File(parent, addExtension(mimeType, displayName)); + + // If conflicting file, try adding counter suffix + int n = 0; + while (file.exists() && n++ < 32) { + file = new File(parent, addExtension(mimeType, displayName + " (" + n + ")")); + } + try { if (!file.createNewFile()) { throw new IllegalStateException("Failed to touch " + file); @@ -354,20 +344,31 @@ public class ExternalStorageProvider extends DocumentsProvider { return "application/octet-stream"; } - private static String validateDisplayName(String mimeType, String displayName) { - if (Document.MIME_TYPE_DIR.equals(mimeType)) { - return displayName; - } else { - // Try appending meaningful extension if needed - if (!mimeType.equals(getTypeForName(displayName))) { - final String extension = MimeTypeMap.getSingleton() - .getExtensionFromMimeType(mimeType); - if (extension != null) { - displayName += "." + extension; - } + /** + * Remove file extension from name, but only if exact MIME type mapping + * exists. This means we can reapply the extension later. + */ + private static String removeExtension(String mimeType, String name) { + final int lastDot = name.lastIndexOf('.'); + if (lastDot >= 0) { + final String extension = name.substring(lastDot + 1); + final String nameMime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + if (mimeType.equals(nameMime)) { + return name.substring(0, lastDot); } + } + return name; + } - return displayName; + /** + * Add file extension to name, but only if exact MIME type mapping exists. + */ + private static String addExtension(String mimeType, String name) { + final String extension = MimeTypeMap.getSingleton() + .getExtensionFromMimeType(mimeType); + if (extension != null) { + return name + "." + extension; } + return name; } } diff --git a/packages/Keyguard/res/layout-land/keyguard_host_view.xml b/packages/Keyguard/res/layout-land/keyguard_host_view.xml index eeb9ee7..87b8b59 100644 --- a/packages/Keyguard/res/layout-land/keyguard_host_view.xml +++ b/packages/Keyguard/res/layout-land/keyguard_host_view.xml @@ -51,11 +51,6 @@ androidprv:layout_maxHeight="480dp" /> <include layout="@layout/keyguard_multi_user_selector"/> - <View android:layout_width="match_parent" - android:layout_height="match_parent" - androidprv:layout_childType="scrim" - android:background="#99000000" /> - <com.android.keyguard.KeyguardSecurityContainer android:id="@+id/keyguard_security_container" android:layout_width="wrap_content" diff --git a/packages/Keyguard/res/layout-port/keyguard_host_view.xml b/packages/Keyguard/res/layout-port/keyguard_host_view.xml index 8498dcf..355739e 100644 --- a/packages/Keyguard/res/layout-port/keyguard_host_view.xml +++ b/packages/Keyguard/res/layout-port/keyguard_host_view.xml @@ -55,11 +55,6 @@ android:layout_gravity="center"/> </FrameLayout> - <View android:layout_width="match_parent" - android:layout_height="match_parent" - androidprv:layout_childType="scrim" - android:background="#99000000" /> - <com.android.keyguard.KeyguardSecurityContainer android:id="@+id/keyguard_security_container" android:layout_width="wrap_content" diff --git a/packages/Keyguard/res/layout-sw600dp-port/keyguard_host_view.xml b/packages/Keyguard/res/layout-sw600dp-port/keyguard_host_view.xml index 77bc9b5..42dbe9d 100644 --- a/packages/Keyguard/res/layout-sw600dp-port/keyguard_host_view.xml +++ b/packages/Keyguard/res/layout-sw600dp-port/keyguard_host_view.xml @@ -52,11 +52,6 @@ <include layout="@layout/keyguard_multi_user_selector"/> - <View android:layout_width="match_parent" - android:layout_height="match_parent" - androidprv:layout_childType="scrim" - android:background="#99000000" /> - <com.android.keyguard.KeyguardSecurityContainer android:id="@+id/keyguard_security_container" android:layout_width="wrap_content" diff --git a/packages/Keyguard/res/values/alias.xml b/packages/Keyguard/res/values/alias.xml index 47291b2..c964391 100644 --- a/packages/Keyguard/res/values/alias.xml +++ b/packages/Keyguard/res/values/alias.xml @@ -46,6 +46,9 @@ <!-- Alias used to reference framework configuration for screen rotation. --> <item type="bool" name="config_enableLockScreenRotation">@*android:bool/config_enableLockScreenRotation</item> + <!-- Alias used to reference framework configuration for transparent bars. --> + <item type="bool" name="config_enableLockScreenTransparentBars">@*android:bool/config_enableLockScreenTransparentBars</item> + <!-- Alias used to reference framework activity duration. --> <item type="integer" name="config_activityDefaultDur">@*android:integer/config_activityDefaultDur</item> diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java index 0787286..aa43711 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java @@ -319,6 +319,7 @@ public class KeyguardHostView extends KeyguardViewBase { } private SlidingChallengeLayout mSlidingChallengeLayout; + private MultiPaneChallengeLayout mMultiPaneChallengeLayout; @Override public boolean onTouchEvent(MotionEvent ev) { @@ -372,8 +373,10 @@ public class KeyguardHostView extends KeyguardViewBase { mAppWidgetContainer.setViewStateManager(mViewStateManager); mAppWidgetContainer.setLockPatternUtils(mLockPatternUtils); + mMultiPaneChallengeLayout = + (MultiPaneChallengeLayout) findViewById(R.id.multi_pane_challenge); ChallengeLayout challenge = mSlidingChallengeLayout != null ? mSlidingChallengeLayout : - (ChallengeLayout) findViewById(R.id.multi_pane_challenge); + mMultiPaneChallengeLayout; challenge.setOnBouncerStateChangedListener(mViewStateManager); mAppWidgetContainer.setBouncerAnimationDuration(challenge.getBouncerAnimationDuration()); mViewStateManager.setPagedView(mAppWidgetContainer); @@ -399,6 +402,11 @@ public class KeyguardHostView extends KeyguardViewBase { updateSecurityViews(); } + public void setScrimView(View scrim) { + if (mSlidingChallengeLayout != null) mSlidingChallengeLayout.setScrimView(scrim); + if (mMultiPaneChallengeLayout != null) mMultiPaneChallengeLayout.setScrimView(scrim); + } + private void setBackButtonEnabled(boolean enabled) { if (mContext instanceof Activity) return; // always enabled in activity mode setSystemUiVisibility(enabled ? diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java index 893562e..bff1f93 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java @@ -18,11 +18,6 @@ package com.android.keyguard; import android.app.Activity; import android.content.Context; -import android.graphics.Canvas; -import android.graphics.ColorFilter; -import android.graphics.PixelFormat; -import android.graphics.PorterDuff; -import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.media.IAudioService; import android.os.RemoteException; @@ -45,7 +40,6 @@ import android.widget.FrameLayout; */ public abstract class KeyguardViewBase extends FrameLayout { - private static final int BACKGROUND_COLOR = 0x70000000; private AudioManager mAudioManager; private TelephonyManager mTelephonyManager = null; protected KeyguardViewMediator.ViewMediatorCallback mViewMediatorCallback; @@ -55,38 +49,12 @@ public abstract class KeyguardViewBase extends FrameLayout { // the audio service will bring up the volume dialog. private static final boolean KEYGUARD_MANAGES_VOLUME = true; - // This is a faster way to draw the background on devices without hardware acceleration - private static final Drawable mBackgroundDrawable = new Drawable() { - @Override - public void draw(Canvas canvas) { - canvas.drawColor(BACKGROUND_COLOR, PorterDuff.Mode.SRC); - } - - @Override - public void setAlpha(int alpha) { - } - - @Override - public void setColorFilter(ColorFilter cf) { - } - - @Override - public int getOpacity() { - return PixelFormat.TRANSLUCENT; - } - }; - public KeyguardViewBase(Context context) { this(context, null); } public KeyguardViewBase(Context context, AttributeSet attrs) { super(context, attrs); - resetBackground(); - } - - public void resetBackground() { - setBackground(mBackgroundDrawable); } /** diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java index 4837458..177e0f8 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java @@ -26,8 +26,12 @@ import android.content.Context; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.content.res.Resources; +import android.graphics.Canvas; +import android.graphics.ColorFilter; import android.graphics.PixelFormat; +import android.graphics.PorterDuff; import android.graphics.Rect; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.IBinder; import android.os.Parcelable; @@ -67,7 +71,7 @@ public class KeyguardViewManager { private WindowManager.LayoutParams mWindowLayoutParams; private boolean mNeedsInput = false; - private FrameLayout mKeyguardHost; + private ViewManagerHost mKeyguardHost; private KeyguardHostView mKeyguardView; private boolean mScreenOn = false; @@ -108,7 +112,11 @@ public class KeyguardViewManager { // useful on any keyguard screen but can be re-shown by dialogs or SHOW_WHEN_LOCKED // activities. Other disabled bits are handled by the KeyguardViewMediator talking // directly to the status bar service. - final int visFlags = View.STATUS_BAR_DISABLE_HOME; + int visFlags = View.STATUS_BAR_DISABLE_HOME; + if (shouldEnableTransparentBars()) { + visFlags |= View.SYSTEM_UI_FLAG_TRANSPARENT_STATUS + | View.SYSTEM_UI_FLAG_TRANSPARENT_NAVIGATION; + } if (DEBUG) Log.v(TAG, "show:setSystemUiVisibility(" + Integer.toHexString(visFlags)+")"); mKeyguardHost.setSystemUiVisibility(visFlags); @@ -124,16 +132,81 @@ public class KeyguardViewManager { || res.getBoolean(R.bool.config_enableLockScreenRotation); } + private boolean shouldEnableTransparentBars() { + Resources res = mContext.getResources(); + return res.getBoolean(R.bool.config_enableLockScreenTransparentBars); + } + class ViewManagerHost extends FrameLayout { - public ViewManagerHost(Context context) { + private static final int BACKGROUND_COLOR = 0x70000000; + // This is a faster way to draw the background on devices without hardware acceleration + private final Drawable mBackgroundDrawable = new Drawable() { + @Override + public void draw(Canvas canvas) { + canvas.drawColor(BACKGROUND_COLOR, PorterDuff.Mode.SRC); + } + + @Override + public void setAlpha(int alpha) { + } + + @Override + public void setColorFilter(ColorFilter cf) { + } + + @Override + public int getOpacity() { + return PixelFormat.TRANSLUCENT; + } + }; + private final View mScrimView; + private boolean mExtendIntoPadding; + public ViewManagerHost(Context context, boolean extendIntoPadding) { super(context); + mExtendIntoPadding = extendIntoPadding; setFitsSystemWindows(true); + setClipToPadding(!mExtendIntoPadding); + setBackground(mBackgroundDrawable); + + mScrimView = new View(context); + mScrimView.setVisibility(View.GONE); + mScrimView.setBackgroundColor(0x99000000); + addView(mScrimView); + } + + private boolean considerPadding(View child) { + return !mExtendIntoPadding || child instanceof KeyguardHostView; + } + + @Override + protected void measureChildWithMargins(View child, + int parentWidthMeasureSpec, int widthUsed, + int parentHeightMeasureSpec, int heightUsed) { + if (considerPadding(child)) { + // don't extend into padding (default behavior) + super.measureChildWithMargins(child, + parentWidthMeasureSpec, widthUsed, + parentHeightMeasureSpec, heightUsed); + } else { + // allowed to extend into padding (scrim / camera preview) + child.measure(parentWidthMeasureSpec, parentHeightMeasureSpec); + } } @Override - protected boolean fitSystemWindows(Rect insets) { - Log.v("TAG", "bug 7643792: fitSystemWindows(" + insets.toShortString() + ")"); - return super.fitSystemWindows(insets); + protected void onLayout(boolean changed, int l, int t, int r, int b) { + final int count = getChildCount(); + for (int i = 0; i < count; i++) { + final View child = getChildAt(i); + int cl = l, ct = t, cr = r, cb = b; + if (considerPadding(child)) { + cl += mPaddingLeft; + ct += mPaddingTop; + cr -= mPaddingRight; + cb -= mPaddingBottom; + } + child.layout(cl, ct, cr, cb); + } } @Override @@ -179,7 +252,7 @@ public class KeyguardViewManager { if (mKeyguardHost == null) { if (DEBUG) Log.d(TAG, "keyguard host is null, creating it..."); - mKeyguardHost = new ViewManagerHost(mContext); + mKeyguardHost = new ViewManagerHost(mContext, shouldEnableTransparentBars()); int flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR @@ -233,6 +306,7 @@ public class KeyguardViewManager { mKeyguardView.setViewMediatorCallback(mViewMediatorCallback); mKeyguardView.initializeSwitchingUserState(options != null && options.getBoolean(IS_SWITCHING_USER)); + mKeyguardView.setScrimView(mKeyguardHost.mScrimView); // HACK // The keyguard view will have set up window flags in onFinishInflate before we set diff --git a/packages/Keyguard/src/com/android/keyguard/MultiPaneChallengeLayout.java b/packages/Keyguard/src/com/android/keyguard/MultiPaneChallengeLayout.java index 8fd39c0..76a7fe3 100644 --- a/packages/Keyguard/src/com/android/keyguard/MultiPaneChallengeLayout.java +++ b/packages/Keyguard/src/com/android/keyguard/MultiPaneChallengeLayout.java @@ -172,10 +172,12 @@ public class MultiPaneChallengeLayout extends ViewGroup implements ChallengeLayo mScrimView.setOnClickListener(null); } mScrimView = scrim; - mScrimView.setAlpha(mIsBouncing ? 1.0f : 0.0f); - mScrimView.setVisibility(mIsBouncing ? VISIBLE : INVISIBLE); - mScrimView.setFocusable(true); - mScrimView.setOnClickListener(mScrimClickListener); + if (mScrimView != null) { + mScrimView.setAlpha(mIsBouncing ? 1.0f : 0.0f); + mScrimView.setVisibility(mIsBouncing ? VISIBLE : INVISIBLE); + mScrimView.setFocusable(true); + mScrimView.setOnClickListener(mScrimClickListener); + } } private int getVirtualHeight(LayoutParams lp, int height, int heightUsed) { diff --git a/packages/Keyguard/src/com/android/keyguard/SlidingChallengeLayout.java b/packages/Keyguard/src/com/android/keyguard/SlidingChallengeLayout.java index 05b35a1..4a4e7fa 100644 --- a/packages/Keyguard/src/com/android/keyguard/SlidingChallengeLayout.java +++ b/packages/Keyguard/src/com/android/keyguard/SlidingChallengeLayout.java @@ -367,9 +367,11 @@ public class SlidingChallengeLayout extends ViewGroup implements ChallengeLayout mScrimView.setOnClickListener(null); } mScrimView = scrim; - mScrimView.setVisibility(mIsBouncing ? VISIBLE : GONE); - mScrimView.setFocusable(true); - mScrimView.setOnClickListener(mScrimClickListener); + if (mScrimView != null) { + mScrimView.setVisibility(mIsBouncing ? VISIBLE : GONE); + mScrimView.setFocusable(true); + mScrimView.setOnClickListener(mScrimClickListener); + } } /** diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java index 26db681..3a6da5d4 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java @@ -444,6 +444,10 @@ public class PrintJobConfigActivity extends Activity { // the requested pages, then nothing else to do. if (!infoChanged && !layoutChanged && PageRangeUtils.contains(mDocument.pages, mRequestedPages)) { + // Nothing interesting changed and we have all requested pages. + // Then update the print jobs's pages as we will not do a write + // and we usually update the pages in the write complete callback. + updatePrintJobPages(mDocument.pages, mRequestedPages); if (mEditor.isDone()) { requestCreatePdfFileOrFinish(); } @@ -499,36 +503,44 @@ public class PrintJobConfigActivity extends Activity { + " and got: " + Arrays.toString(mDocument.pages)); } + updatePrintJobPages(mDocument.pages, mRequestedPages); + + if (mEditor.isDone()) { + requestCreatePdfFileOrFinish(); + } + } + + private void updatePrintJobPages(PageRange[] writtenPages, PageRange[] requestedPages) { // Adjust the print job pages based on what was requested and written. // The cases are ordered in the most expected to the least expected. - if (Arrays.equals(mDocument.pages, mRequestedPages)) { + if (Arrays.equals(writtenPages, requestedPages)) { // We got a document with exactly the pages we wanted. Hence, // the printer has to print all pages in the data. PrintSpoolerService.peekInstance().setPrintJobPagesNoPersistence(mPrintJobId, ALL_PAGES_ARRAY); - } else if (Arrays.equals(mDocument.pages, ALL_PAGES_ARRAY)) { + } else if (Arrays.equals(writtenPages, ALL_PAGES_ARRAY)) { // We requested specific pages but got all of them. Hence, // the printer has to print only the requested pages. PrintSpoolerService.peekInstance().setPrintJobPagesNoPersistence(mPrintJobId, - mRequestedPages); - } else if (PageRangeUtils.contains(mDocument.pages, mRequestedPages)) { + requestedPages); + } else if (PageRangeUtils.contains(writtenPages, requestedPages)) { // We requested specific pages and got more but not all pages. // Hence, we have to offset appropriately the printed pages to - // exclude the pages we did not request. Note that pages is - // guaranteed to be not null and not empty. - final int offset = mDocument.pages[0].getStart() - pages[0].getStart(); - PageRange[] offsetPages = Arrays.copyOf(mDocument.pages, mDocument.pages.length); - PageRangeUtils.offsetStart(offsetPages, offset); + // be based off the start of the written ones instead of zero. + // The written pages are always non-null and not empty. + final int offset = -writtenPages[0].getStart(); + PageRange[] offsetPages = Arrays.copyOf(requestedPages, requestedPages.length); + PageRangeUtils.offset(offsetPages, offset); PrintSpoolerService.peekInstance().setPrintJobPagesNoPersistence(mPrintJobId, offsetPages); - } else if (Arrays.equals(mRequestedPages, ALL_PAGES_ARRAY) - && mDocument.pages.length == 1 && mDocument.pages[0].getStart() == 0 - && mDocument.pages[0].getEnd() == mDocument.info.getPageCount() - 1) { + } else if (Arrays.equals(requestedPages, ALL_PAGES_ARRAY) + && writtenPages.length == 1 && writtenPages[0].getStart() == 0 + && writtenPages[0].getEnd() == mDocument.info.getPageCount() - 1) { // We requested all pages via the special constant and got all // of them as an explicit enumeration. Hence, the printer has // to print only the requested pages. PrintSpoolerService.peekInstance().setPrintJobPagesNoPersistence(mPrintJobId, - mDocument.pages); + writtenPages); } else { // We did not get the pages we requested, then the application // misbehaves, so we fail quickly. @@ -537,10 +549,6 @@ public class PrintJobConfigActivity extends Activity { Log.e(LOG_TAG, "Received invalid pages from the app"); PrintJobConfigActivity.this.finish(); } - - if (mEditor.isDone()) { - requestCreatePdfFileOrFinish(); - } } private void requestCreatePdfFileOrFinish() { @@ -2192,38 +2200,39 @@ public class PrintJobConfigActivity extends Activity { throw new UnsupportedOperationException(); } - public static boolean contains(PageRange[] ourPageRanges, PageRange[] otherPageRanges) { - if (ourPageRanges == null || otherPageRanges == null) { + public static boolean contains(PageRange[] ourRanges, PageRange[] otherRanges) { + if (ourRanges == null || otherRanges == null) { return false; } - if (ourPageRanges.length == 1 - && PageRange.ALL_PAGES.equals(ourPageRanges[0])) { + if (ourRanges.length == 1 + && PageRange.ALL_PAGES.equals(ourRanges[0])) { return true; } - otherPageRanges = normalize(otherPageRanges); - - int otherPageIdx = 0; - final int myPageCount = ourPageRanges.length; - final int otherPageCount = otherPageRanges.length; - for (int i= 0; i < myPageCount; i++) { - PageRange myPage = ourPageRanges[i]; - for (; otherPageIdx < otherPageCount; otherPageIdx++) { - PageRange otherPage = otherPageRanges[otherPageIdx]; - if (otherPage.getStart() > myPage.getStart()) { + ourRanges = normalize(ourRanges); + otherRanges = normalize(otherRanges); + + // Note that the code below relies on the ranges being normalized + // which is they contain monotonically increasing non-intersecting + // subranges whose start is less that or equal to the end. + int otherRangeIdx = 0; + final int ourRangeCount = ourRanges.length; + final int otherRangeCount = otherRanges.length; + for (int ourRangeIdx = 0; ourRangeIdx < ourRangeCount; ourRangeIdx++) { + PageRange ourRange = ourRanges[ourRangeIdx]; + for (; otherRangeIdx < otherRangeCount; otherRangeIdx++) { + PageRange otherRange = otherRanges[otherRangeIdx]; + if (otherRange.getStart() > ourRange.getEnd()) { break; } - if ((otherPage.getStart() < myPage.getStart() - && otherPage.getEnd() > myPage.getStart()) - || (otherPage.getEnd() > myPage.getEnd() - && otherPage.getStart() < myPage.getEnd()) - || (otherPage.getEnd() < myPage.getStart())) { + if (otherRange.getStart() < ourRange.getStart() + || otherRange.getEnd() > ourRange.getEnd()) { return false; } } } - if (otherPageIdx < otherPageCount) { + if (otherRangeIdx < otherRangeCount) { return false; } return true; @@ -2257,7 +2266,7 @@ public class PrintJobConfigActivity extends Activity { oldRangeCount); } - public static void offsetStart(PageRange[] pageRanges, int offset) { + public static void offset(PageRange[] pageRanges, int offset) { if (offset == 0) { return; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index a600aae..e77b420 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; +import android.app.StatusBarManager; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; @@ -111,6 +112,10 @@ public class StatusBarWindowView extends FrameLayout if (!handled) { handled = super.onTouchEvent(ev); } + final int action = ev.getAction(); + if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { + mService.setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false); + } return handled; } diff --git a/services/java/com/android/server/BootReceiver.java b/services/java/com/android/server/BootReceiver.java index 3dade37..da1b254 100644 --- a/services/java/com/android/server/BootReceiver.java +++ b/services/java/com/android/server/BootReceiver.java @@ -127,6 +127,7 @@ public class BootReceiver extends BroadcastReceiver { addFileToDropBox(db, prefs, headers, "/data/dontpanic/apanic_threads", -LOG_SIZE, "APANIC_THREADS"); addAuditErrorsToDropBox(db, prefs, headers, -LOG_SIZE, "SYSTEM_AUDIT"); + addFsckErrorsToDropBox(db, prefs, headers, -LOG_SIZE, "SYSTEM_FSCK"); } else { if (db != null) db.addText("SYSTEM_RESTART", headers); } @@ -203,4 +204,31 @@ public class BootReceiver extends BroadcastReceiver { Slog.i(TAG, "Copied " + sb.toString().length() + " worth of audits to DropBox"); db.addText(tag, headers + sb.toString()); } + + private static void addFsckErrorsToDropBox(DropBoxManager db, SharedPreferences prefs, + String headers, int maxSize, String tag) throws IOException { + boolean upload_needed = false; + if (db == null || !db.isTagEnabled(tag)) return; // Logging disabled + Slog.i(TAG, "Checking for fsck errors"); + + File file = new File("/dev/fscklogs/log"); + long fileTime = file.lastModified(); + if (fileTime <= 0) return; // File does not exist + + String log = FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n"); + StringBuilder sb = new StringBuilder(); + for (String line : log.split("\n")) { + if (line.contains("FILE SYSTEM WAS MODIFIED")) { + upload_needed = true; + break; + } + } + + if (upload_needed) { + addFileToDropBox(db, prefs, headers, "/dev/fscklogs/log", maxSize, tag); + } + + // Remove the file so we don't re-upload if the runtime restarts. + file.delete(); + } } diff --git a/services/java/com/android/server/IntentResolver.java b/services/java/com/android/server/IntentResolver.java index 3a35f3f..54aa50c 100644 --- a/services/java/com/android/server/IntentResolver.java +++ b/services/java/com/android/server/IntentResolver.java @@ -18,6 +18,7 @@ package com.android.server; import java.io.PrintWriter; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; @@ -248,26 +249,28 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> { // Not a wild card, so we can just look for all filters that // completely match or wildcards whose base type matches. firstTypeCut = mTypeToFilter.get(resolvedType); - if (debug) Slog.v(TAG, "First type cut: " + firstTypeCut); + if (debug) Slog.v(TAG, "First type cut: " + Arrays.toString(firstTypeCut)); secondTypeCut = mWildTypeToFilter.get(baseType); - if (debug) Slog.v(TAG, "Second type cut: " + secondTypeCut); + if (debug) Slog.v(TAG, "Second type cut: " + + Arrays.toString(secondTypeCut)); } else { // We can match anything with our base type. firstTypeCut = mBaseTypeToFilter.get(baseType); - if (debug) Slog.v(TAG, "First type cut: " + firstTypeCut); + if (debug) Slog.v(TAG, "First type cut: " + Arrays.toString(firstTypeCut)); secondTypeCut = mWildTypeToFilter.get(baseType); - if (debug) Slog.v(TAG, "Second type cut: " + secondTypeCut); + if (debug) Slog.v(TAG, "Second type cut: " + + Arrays.toString(secondTypeCut)); } // Any */* types always apply, but we only need to do this // if the intent type was not already */*. thirdTypeCut = mWildTypeToFilter.get("*"); - if (debug) Slog.v(TAG, "Third type cut: " + thirdTypeCut); + if (debug) Slog.v(TAG, "Third type cut: " + Arrays.toString(thirdTypeCut)); } else if (intent.getAction() != null) { // The intent specified any type ({@literal *}/*). This // can be a whole heck of a lot of things, so as a first // cut let's use the action instead. firstTypeCut = mTypedActionToFilter.get(intent.getAction()); - if (debug) Slog.v(TAG, "Typed Action list: " + firstTypeCut); + if (debug) Slog.v(TAG, "Typed Action list: " + Arrays.toString(firstTypeCut)); } } } @@ -277,7 +280,7 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> { // on the authority and path by directly matching each resulting filter). if (scheme != null) { schemeCut = mSchemeToFilter.get(scheme); - if (debug) Slog.v(TAG, "Scheme list: " + schemeCut); + if (debug) Slog.v(TAG, "Scheme list: " + Arrays.toString(schemeCut)); } // If the intent does not specify any data -- either a MIME type or @@ -285,7 +288,7 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> { // data. if (resolvedType == null && scheme == null && intent.getAction() != null) { firstTypeCut = mActionToFilter.get(intent.getAction()); - if (debug) Slog.v(TAG, "Action list: " + firstTypeCut); + if (debug) Slog.v(TAG, "Action list: " + Arrays.toString(firstTypeCut)); } FastImmutableArraySet<String> categories = getFastIntentCategories(intent); diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index b6ccce7..3e8770e 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -223,8 +223,9 @@ public class LocationManagerService extends ILocationManager.Stub { mGeofenceManager = new GeofenceManager(mContext, mBlacklist); // Monitor for app ops mode changes. - AppOpsManager.Callback callback = new AppOpsManager.Callback() { - public void opChanged(int op, String packageName) { + AppOpsManager.OnOpChangedListener callback + = new AppOpsManager.OnOpChangedInternalListener() { + public void onOpChanged(int op, String packageName) { synchronized (mLock) { for (Receiver receiver : mReceivers.values()) { receiver.updateMonitoring(true); diff --git a/services/java/com/android/server/am/ActiveServices.java b/services/java/com/android/server/am/ActiveServices.java index 4379c70..fa1769f 100644 --- a/services/java/com/android/server/am/ActiveServices.java +++ b/services/java/com/android/server/am/ActiveServices.java @@ -1009,23 +1009,15 @@ public final class ActiveServices { stracker.setExecuting(true, mAm.mProcessStats.getMemFactorLocked(), now); } if (r.app != null) { - if (r.app.executingServices.size() == 0) { - Message msg = mAm.mHandler.obtainMessage( - ActivityManagerService.SERVICE_TIMEOUT_MSG); - msg.obj = r.app; - mAm.mHandler.sendMessageAtTime(msg, - fg ? (now+SERVICE_TIMEOUT) : (now+ SERVICE_BACKGROUND_TIMEOUT)); - } r.app.executingServices.add(r); r.app.execServicesFg |= fg; + if (r.app.executingServices.size() == 1) { + scheduleServiceTimeoutLocked(r.app); + } } } else if (r.app != null && fg && !r.app.execServicesFg) { - mAm.mHandler.removeMessages(ActivityManagerService.SERVICE_TIMEOUT_MSG); - Message msg = mAm.mHandler.obtainMessage( - ActivityManagerService.SERVICE_TIMEOUT_MSG); - msg.obj = r.app; - mAm.mHandler.sendMessageAtTime(msg,now+SERVICE_TIMEOUT); r.app.execServicesFg = true; + scheduleServiceTimeoutLocked(r.app); } r.executeFg |= fg; r.executeNesting++; @@ -2144,7 +2136,7 @@ public final class ActiveServices { ActivityManagerService.SERVICE_TIMEOUT_MSG); msg.obj = proc; mAm.mHandler.sendMessageAtTime(msg, proc.execServicesFg - ? (nextTime+SERVICE_TIMEOUT) : (nextTime+ SERVICE_BACKGROUND_TIMEOUT)); + ? (nextTime+SERVICE_TIMEOUT) : (nextTime + SERVICE_BACKGROUND_TIMEOUT)); } } @@ -2153,6 +2145,18 @@ public final class ActiveServices { } } + void scheduleServiceTimeoutLocked(ProcessRecord proc) { + if (proc.executingServices.size() == 0 || proc.thread == null) { + return; + } + long now = SystemClock.uptimeMillis(); + Message msg = mAm.mHandler.obtainMessage( + ActivityManagerService.SERVICE_TIMEOUT_MSG); + msg.obj = proc; + mAm.mHandler.sendMessageAtTime(msg, + proc.execServicesFg ? (now+SERVICE_TIMEOUT) : (now+ SERVICE_BACKGROUND_TIMEOUT)); + } + /** * Prints a list of ServiceRecords (dumpsys activity services) */ diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 47297c0..808bf88 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -2230,7 +2230,8 @@ public final class ActivityManagerService extends ActivityManagerNative mHandler.sendMessage(msg); } - private final int updateLruProcessInternalLocked(ProcessRecord app, long now, int index) { + private final int updateLruProcessInternalLocked(ProcessRecord app, long now, int index, + String what, Object obj, ProcessRecord srcApp) { app.lastActivityTime = now; if (app.activities.size() > 0) { @@ -2240,8 +2241,9 @@ public final class ActivityManagerService extends ActivityManagerNative int lrui = mLruProcesses.lastIndexOf(app); if (lrui < 0) { - throw new IllegalStateException("Adding dependent process " + app - + " not on LRU list!"); + Log.wtf(TAG, "Adding dependent process " + app + " not on LRU list: " + + what + " " + obj + " from " + srcApp); + return index; } if (lrui >= mLruProcessActivityStart) { @@ -2306,16 +2308,18 @@ public final class ActivityManagerService extends ActivityManagerNative // bump those processes as well. for (int j=app.connections.size()-1; j>=0; j--) { ConnectionRecord cr = app.connections.valueAt(j); - if (cr.binding != null && cr.binding.service != null + if (cr.binding != null && !cr.serviceDead && cr.binding.service != null && cr.binding.service.app != null && cr.binding.service.app.lruSeq != mLruSeq) { - nextIndex = updateLruProcessInternalLocked(cr.binding.service.app, now, nextIndex); + nextIndex = updateLruProcessInternalLocked(cr.binding.service.app, now, nextIndex, + "service connection", cr, app); } } for (int j=app.conProviders.size()-1; j>=0; j--) { ContentProviderRecord cpr = app.conProviders.get(j).provider; if (cpr.proc != null && cpr.proc.lruSeq != mLruSeq) { - nextIndex = updateLruProcessInternalLocked(cpr.proc, now, nextIndex); + nextIndex = updateLruProcessInternalLocked(cpr.proc, now, nextIndex, + "provider reference", cpr, app); } } @@ -3025,6 +3029,8 @@ public final class ActivityManagerService extends ActivityManagerNative // And we are resetting to find the next component... intent.setComponent(null); + final boolean debug = ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0); + ActivityInfo aInfo = null; try { List<ResolveInfo> resolves = @@ -3045,6 +3051,12 @@ public final class ActivityManagerService extends ActivityManagerNative if (i<N) { aInfo = resolves.get(i).activityInfo; } + if (debug) { + Slog.v(TAG, "Next matching activity: found current " + r.packageName + + "/" + r.info.name); + Slog.v(TAG, "Next matching activity: next is " + aInfo.packageName + + "/" + aInfo.name); + } break; } } @@ -3054,6 +3066,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (aInfo == null) { // Nobody who is next! ActivityOptions.abort(options); + if (debug) Slog.d(TAG, "Next matching activity: nothing found"); return false; } @@ -3863,7 +3876,13 @@ public final class ActivityManagerService extends ActivityManagerNative // 0 == show dialog, 1 = keep waiting, -1 = kill process immediately int res = mController.appNotResponding(app.processName, app.pid, info.toString()); if (res != 0) { - if (res < 0 && app.pid != MY_PID) Process.killProcess(app.pid); + if (res < 0 && app.pid != MY_PID) { + Process.killProcess(app.pid); + } else { + synchronized (this) { + mServices.scheduleServiceTimeoutLocked(app); + } + } return; } } catch (RemoteException e) { diff --git a/services/java/com/android/server/am/ActivityStackSupervisor.java b/services/java/com/android/server/am/ActivityStackSupervisor.java index 9549e0a..4c65a8a 100644 --- a/services/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/java/com/android/server/am/ActivityStackSupervisor.java @@ -1246,8 +1246,9 @@ public final class ActivityStackSupervisor { mService.doPendingActivityLaunchesLocked(false); err = startActivityUncheckedLocked(r, sourceRecord, startFlags, true, options); - if (stack.mPausingActivity == null) { - // Someone asked to have the keyguard dismissed on the next + + if (allPausedActivitiesComplete()) { + // If someone asked to have the keyguard dismissed on the next // activity start, but we are not actually doing an activity // switch... just dismiss the keyguard now, because we // probably want to see whatever is behind it. @@ -2150,9 +2151,6 @@ public final class ActivityStackSupervisor { for (int stackNdx = mStacks.size() - 1; stackNdx >= 0; --stackNdx) { final ActivityStack stack = mStacks.get(stackNdx); stack.awakeFromSleepingLocked(); - if (isFrontStack(stack)) { - resumeTopActivitiesLocked(); - } } mGoingToSleepActivities.clear(); } diff --git a/services/java/com/android/server/am/AppNotRespondingDialog.java b/services/java/com/android/server/am/AppNotRespondingDialog.java index b5e0715..d0a0441 100644 --- a/services/java/com/android/server/am/AppNotRespondingDialog.java +++ b/services/java/com/android/server/am/AppNotRespondingDialog.java @@ -128,6 +128,7 @@ final class AppNotRespondingDialog extends BaseErrorDialog { if (app.anrDialog == AppNotRespondingDialog.this) { app.anrDialog = null; } + mService.mServices.scheduleServiceTimeoutLocked(app); } break; } diff --git a/services/java/com/android/server/am/ProcessStatsService.java b/services/java/com/android/server/am/ProcessStatsService.java index 0a1685c..be08973 100644 --- a/services/java/com/android/server/am/ProcessStatsService.java +++ b/services/java/com/android/server/am/ProcessStatsService.java @@ -56,12 +56,12 @@ public final class ProcessStatsService extends IProcessStats.Stub { // exists in and the offset into the array to find it. The constants below // define the encoding of that data in an integer. - static final int MAX_HISTORIC_STATES = 6; // Maximum number of historic states we will keep. + static final int MAX_HISTORIC_STATES = 8; // Maximum number of historic states we will keep. static final String STATE_FILE_PREFIX = "state-"; // Prefix to use for state filenames. static final String STATE_FILE_SUFFIX = ".bin"; // Suffix to use for state filenames. static final String STATE_FILE_CHECKIN_SUFFIX = ".ci"; // State files that have checked in. static long WRITE_PERIOD = 30*60*1000; // Write file every 30 minutes or so. - static long COMMIT_PERIOD = 12*60*60*1000; // Commit current stats every 12 hours. + static long COMMIT_PERIOD = 3*60*60*1000; // Commit current stats every 3 hours. final ActivityManagerService mAm; final File mBaseDir; diff --git a/services/java/com/android/server/am/ServiceRecord.java b/services/java/com/android/server/am/ServiceRecord.java index 448117e..ac14da9 100644 --- a/services/java/com/android/server/am/ServiceRecord.java +++ b/services/java/com/android/server/am/ServiceRecord.java @@ -253,6 +253,7 @@ final class ServiceRecord extends Binder { pw.print(" executeFg="); pw.print(executeFg); pw.print(" executingStart="); TimeUtils.formatDuration(executingStart, now, pw); + pw.println(); } if (crashCount != 0 || restartCount != 0 || restartDelay != 0 || nextRestartTime != 0) { diff --git a/services/java/com/android/server/content/SyncManager.java b/services/java/com/android/server/content/SyncManager.java index 9a41166..635ba5c 100644 --- a/services/java/com/android/server/content/SyncManager.java +++ b/services/java/com/android/server/content/SyncManager.java @@ -315,7 +315,9 @@ public class SyncManager { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Reconnection detected: clearing all backoffs"); } - mSyncStorageEngine.clearAllBackoffs(mSyncQueue); + synchronized(mSyncQueue) { + mSyncStorageEngine.clearAllBackoffsLocked(mSyncQueue); + } } sendCheckAlarmsMessage(); } diff --git a/services/java/com/android/server/content/SyncStorageEngine.java b/services/java/com/android/server/content/SyncStorageEngine.java index 1b9ed98..d51c2d7 100644 --- a/services/java/com/android/server/content/SyncStorageEngine.java +++ b/services/java/com/android/server/content/SyncStorageEngine.java @@ -710,28 +710,31 @@ public class SyncStorageEngine extends Handler { } } - public void clearAllBackoffs(SyncQueue syncQueue) { + /** + * Callers of this function need to hold a lock for syncQueue object passed in. Bear in mind + * this function grabs the lock for {@link #mAuthorities} + * @param syncQueue queue containing pending sync operations. + */ + public void clearAllBackoffsLocked(SyncQueue syncQueue) { boolean changed = false; synchronized (mAuthorities) { - synchronized (syncQueue) { - for (AccountInfo accountInfo : mAccounts.values()) { - for (AuthorityInfo authorityInfo : accountInfo.authorities.values()) { - if (authorityInfo.backoffTime != NOT_IN_BACKOFF_MODE - || authorityInfo.backoffDelay != NOT_IN_BACKOFF_MODE) { - if (DEBUG) { - Log.v(TAG, "clearAllBackoffs:" - + " authority:" + authorityInfo.authority - + " account:" + accountInfo.accountAndUser.account.name - + " user:" + accountInfo.accountAndUser.userId - + " backoffTime was: " + authorityInfo.backoffTime - + " backoffDelay was: " + authorityInfo.backoffDelay); - } - authorityInfo.backoffTime = NOT_IN_BACKOFF_MODE; - authorityInfo.backoffDelay = NOT_IN_BACKOFF_MODE; - syncQueue.onBackoffChanged(accountInfo.accountAndUser.account, - accountInfo.accountAndUser.userId, authorityInfo.authority, 0); - changed = true; + for (AccountInfo accountInfo : mAccounts.values()) { + for (AuthorityInfo authorityInfo : accountInfo.authorities.values()) { + if (authorityInfo.backoffTime != NOT_IN_BACKOFF_MODE + || authorityInfo.backoffDelay != NOT_IN_BACKOFF_MODE) { + if (DEBUG) { + Log.v(TAG, "clearAllBackoffs:" + + " authority:" + authorityInfo.authority + + " account:" + accountInfo.accountAndUser.account.name + + " user:" + accountInfo.accountAndUser.userId + + " backoffTime was: " + authorityInfo.backoffTime + + " backoffDelay was: " + authorityInfo.backoffDelay); } + authorityInfo.backoffTime = NOT_IN_BACKOFF_MODE; + authorityInfo.backoffDelay = NOT_IN_BACKOFF_MODE; + syncQueue.onBackoffChanged(accountInfo.accountAndUser.account, + accountInfo.accountAndUser.userId, authorityInfo.authority, 0); + changed = true; } } } diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index d1ca35e..f221598 100755 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -2616,7 +2616,7 @@ public class PackageManagerService extends IPackageManager.Stub { List<ResolveInfo> query = queryIntentActivities(intent, resolvedType, flags, userId); // Find any earlier preferred or last chosen entries and nuke them findPreferredActivity(intent, resolvedType, - flags, query, 0, false, true, userId); + flags, query, 0, false, true, false, userId); // Add the new activity as the last chosen for this filter addPreferredActivityInternal(filter, match, null, activity, false, userId); } @@ -2627,7 +2627,7 @@ public class PackageManagerService extends IPackageManager.Stub { if (DEBUG_PREFERRED) Log.v(TAG, "Querying last chosen activity for " + intent); List<ResolveInfo> query = queryIntentActivities(intent, resolvedType, flags, userId); return findPreferredActivity(intent, resolvedType, flags, query, 0, - false, false, userId); + false, false, false, userId); } private ResolveInfo chooseBestActivity(Intent intent, String resolvedType, @@ -2637,12 +2637,13 @@ public class PackageManagerService extends IPackageManager.Stub { if (N == 1) { return query.get(0); } else if (N > 1) { + final boolean debug = ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0); // If there is more than one activity with the same priority, // then let the user decide between them. ResolveInfo r0 = query.get(0); ResolveInfo r1 = query.get(1); - if (DEBUG_INTENT_MATCHING) { - Log.d(TAG, r0.activityInfo.name + "=" + r0.priority + " vs " + if (DEBUG_INTENT_MATCHING || debug) { + Slog.v(TAG, r0.activityInfo.name + "=" + r0.priority + " vs " + r1.activityInfo.name + "=" + r1.priority); } // If the first activity has a higher priority, or a different @@ -2655,7 +2656,7 @@ public class PackageManagerService extends IPackageManager.Stub { // If we have saved a preference for a preferred activity for // this Intent, use that. ResolveInfo ri = findPreferredActivity(intent, resolvedType, - flags, query, r0.priority, true, false, userId); + flags, query, r0.priority, true, false, debug, userId); if (ri != null) { return ri; } @@ -2676,7 +2677,7 @@ public class PackageManagerService extends IPackageManager.Stub { ResolveInfo findPreferredActivity(Intent intent, String resolvedType, int flags, List<ResolveInfo> query, int priority, boolean always, - boolean removeMatches, int userId) { + boolean removeMatches, boolean debug, int userId) { if (!sUserManager.exists(userId)) return null; // writer synchronized (mPackages) { @@ -2686,6 +2687,7 @@ public class PackageManagerService extends IPackageManager.Stub { if (DEBUG_PREFERRED) intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION); PreferredIntentResolver pir = mSettings.mPreferredActivities.get(userId); // Get the list of preferred activities that handle the intent + if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Looking for preferred activities..."); List<PreferredActivity> prefs = pir != null ? pir.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId) @@ -2696,59 +2698,50 @@ public class PackageManagerService extends IPackageManager.Stub { // from the same match quality. int match = 0; - if (DEBUG_PREFERRED) { - Log.v(TAG, "Figuring out best match..."); - } + if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Figuring out best match..."); final int N = query.size(); for (int j=0; j<N; j++) { final ResolveInfo ri = query.get(j); - if (DEBUG_PREFERRED) { - Log.v(TAG, "Match for " + ri.activityInfo + ": 0x" - + Integer.toHexString(match)); - } + if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Match for " + ri.activityInfo + + ": 0x" + Integer.toHexString(match)); if (ri.match > match) { match = ri.match; } } - if (DEBUG_PREFERRED) { - Log.v(TAG, "Best match: 0x" + Integer.toHexString(match)); - } + if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Best match: 0x" + + Integer.toHexString(match)); match &= IntentFilter.MATCH_CATEGORY_MASK; final int M = prefs.size(); for (int i=0; i<M; i++) { final PreferredActivity pa = prefs.get(i); - if (DEBUG_PREFERRED) { - Log.v(TAG, "Checking PreferredActivity ds=" + if (DEBUG_PREFERRED || debug) { + Slog.v(TAG, "Checking PreferredActivity ds=" + (pa.countDataSchemes() > 0 ? pa.getDataScheme(0) : "<none>") + "\n component=" + pa.mPref.mComponent); - pa.dump(new PrintStreamPrinter(System.out), " "); + pa.dump(new LogPrinter(Log.VERBOSE, TAG, Log.LOG_ID_SYSTEM), " "); } if (pa.mPref.mMatch != match) { - if (DEBUG_PREFERRED) { - Log.v(TAG, "Skipping bad match " - + Integer.toHexString(pa.mPref.mMatch)); - } + if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Skipping bad match " + + Integer.toHexString(pa.mPref.mMatch)); continue; } // If it's not an "always" type preferred activity and that's what we're // looking for, skip it. if (always && !pa.mPref.mAlways) { - if (DEBUG_PREFERRED) { - Log.v(TAG, "Skipping lastChosen entry"); - } + if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Skipping mAlways=false entry"); continue; } final ActivityInfo ai = getActivityInfo(pa.mPref.mComponent, flags | PackageManager.GET_DISABLED_COMPONENTS, userId); - if (DEBUG_PREFERRED) { - Log.v(TAG, "Got preferred activity:"); + if (DEBUG_PREFERRED || debug) { + Slog.v(TAG, "Found preferred activity:"); if (ai != null) { - ai.dump(new LogPrinter(Log.VERBOSE, TAG), " "); + ai.dump(new LogPrinter(Log.VERBOSE, TAG, Log.LOG_ID_SYSTEM), " "); } else { - Log.v(TAG, " null"); + Slog.v(TAG, " null"); } } if (ai == null) { @@ -2775,7 +2768,7 @@ public class PackageManagerService extends IPackageManager.Stub { if (removeMatches) { pir.removeFilter(pa); if (DEBUG_PREFERRED) { - Log.v(TAG, "Removing match " + pa.mPref.mComponent); + Slog.v(TAG, "Removing match " + pa.mPref.mComponent); } break; } @@ -2788,7 +2781,7 @@ public class PackageManagerService extends IPackageManager.Stub { Slog.i(TAG, "Result set changed, dropping preferred activity for " + intent + " type " + resolvedType); if (DEBUG_PREFERRED) { - Log.v(TAG, "Removing preferred activity since set changed " + Slog.v(TAG, "Removing preferred activity since set changed " + pa.mPref.mComponent); } pir.removeFilter(pa); @@ -2801,6 +2794,8 @@ public class PackageManagerService extends IPackageManager.Stub { } // Yay! Either the set matched or we're looking for the last chosen + if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Returning preferred activity: " + + ri.activityInfo.packageName + "/" + ri.activityInfo.name); mSettings.writePackageRestrictionsLPr(userId); return ri; } @@ -2808,6 +2803,7 @@ public class PackageManagerService extends IPackageManager.Stub { } mSettings.writePackageRestrictionsLPr(userId); } + if (DEBUG_PREFERRED || debug) Slog.v(TAG, "No preferred activity to return"); return null; } @@ -9886,7 +9882,7 @@ public class PackageManagerService extends IPackageManager.Stub { List<ResolveInfo> list = queryIntentActivities(intent, null, PackageManager.GET_META_DATA, callingUserId); ResolveInfo preferred = findPreferredActivity(intent, null, 0, list, 0, - true, false, callingUserId); + true, false, false, callingUserId); allHomeCandidates.clear(); if (list != null) { diff --git a/services/java/com/android/server/pm/PreferredActivity.java b/services/java/com/android/server/pm/PreferredActivity.java index 963cbe4..f93ba2f 100644 --- a/services/java/com/android/server/pm/PreferredActivity.java +++ b/services/java/com/android/server/pm/PreferredActivity.java @@ -71,4 +71,10 @@ class PreferredActivity extends IntentFilter implements PreferredComponent.Callb } return true; } + + @Override + public String toString() { + return "PreferredActivity{0x" + Integer.toHexString(System.identityHashCode(this)) + + " " + mPref.mComponent.flattenToShortString() + "}"; + } } diff --git a/services/java/com/android/server/wifi/WifiService.java b/services/java/com/android/server/wifi/WifiService.java index a604d3f..f93a45b 100644 --- a/services/java/com/android/server/wifi/WifiService.java +++ b/services/java/com/android/server/wifi/WifiService.java @@ -455,9 +455,7 @@ public final class WifiService extends IWifiManager.Stub { private void resolveBatchedScannersLocked() { BatchedScanSettings setting = new BatchedScanSettings(); - setting.scanIntervalSec = BatchedScanSettings.DEFAULT_INTERVAL_SEC; int responsibleUid = 0; - setting.channelSet = new ArrayList<String>(); if (mBatchedScanners.size() == 0) { mWifiStateMachine.setBatchedScanSettings(null, 0); @@ -472,7 +470,7 @@ public final class WifiService extends IWifiManager.Stub { } if (s.maxApPerScan != BatchedScanSettings.UNSPECIFIED && (setting.maxApPerScan == BatchedScanSettings.UNSPECIFIED || - s.maxApPerScan > setting.maxApPerScan)) { + s.maxApPerScan > setting.maxApPerScan)) { setting.maxApPerScan = s.maxApPerScan; } if (s.scanIntervalSec != BatchedScanSettings.UNSPECIFIED && @@ -481,31 +479,25 @@ public final class WifiService extends IWifiManager.Stub { responsibleUid = r.uid; } if (s.maxApForDistance != BatchedScanSettings.UNSPECIFIED && - s.maxApForDistance > setting.maxApForDistance) { + (setting.maxApForDistance == BatchedScanSettings.UNSPECIFIED || + s.maxApForDistance > setting.maxApForDistance)) { setting.maxApForDistance = s.maxApForDistance; } - if (s.channelSet != null) { - for (String i : s.channelSet) { - if (setting.channelSet.contains(i) == false) setting.channelSet.add(i); + if (s.channelSet != null && s.channelSet.size() != 0) { + if (setting.channelSet == null || setting.channelSet.size() != 0) { + if (setting.channelSet == null) setting.channelSet = new ArrayList<String>(); + for (String i : s.channelSet) { + if (setting.channelSet.contains(i) == false) setting.channelSet.add(i); + } + } // else, ignore the constraint - we already use all channels + } else { + if (setting.channelSet == null || setting.channelSet.size() != 0) { + setting.channelSet = new ArrayList<String>(); } } } - if (setting.channelSet.size() == 0) setting.channelSet = null; - if (setting.scanIntervalSec < BatchedScanSettings.MIN_INTERVAL_SEC) { - setting.scanIntervalSec = BatchedScanSettings.MIN_INTERVAL_SEC; - } - if (setting.maxScansPerBatch == BatchedScanSettings.UNSPECIFIED) { - setting.maxScansPerBatch = BatchedScanSettings.DEFAULT_SCANS_PER_BATCH; - } - if (setting.maxApPerScan == BatchedScanSettings.UNSPECIFIED) { - setting.maxApPerScan = BatchedScanSettings.DEFAULT_AP_PER_SCAN; - } - if (setting.scanIntervalSec == BatchedScanSettings.UNSPECIFIED) { - setting.scanIntervalSec = BatchedScanSettings.DEFAULT_INTERVAL_SEC; - } - if (setting.maxApForDistance == BatchedScanSettings.UNSPECIFIED) { - setting.maxApForDistance = BatchedScanSettings.DEFAULT_AP_FOR_DISTANCE; - } + + setting.constrain(); mWifiStateMachine.setBatchedScanSettings(setting, responsibleUid); } diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index d063db5..e4f5c7c 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -754,9 +754,9 @@ public class WindowManagerService extends IWindowManager.Stub mBatteryStats = BatteryStatsService.getService(); mAppOps = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); mAppOps.startWatchingMode(AppOpsManager.OP_SYSTEM_ALERT_WINDOW, null, - new AppOpsManager.Callback() { + new AppOpsManager.OnOpChangedInternalListener() { @Override - public void opChanged(int op, String packageName) { + public void onOpChanged(int op, String packageName) { updateAppOpsState(); } } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 9650b99..923fef2 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -262,6 +262,7 @@ cat include/telephony/ril.h | \ int RIL_REQUEST_VOICE_RADIO_TECH = 108; int RIL_REQUEST_GET_CELL_INFO_LIST = 109; int RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE = 110; + int RIL_REQUEST_SET_INITIAL_ATTACH_APN = 111; int RIL_UNSOL_RESPONSE_BASE = 1000; int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000; int RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED = 1001; diff --git a/wifi/java/android/net/wifi/BatchedScanSettings.java b/wifi/java/android/net/wifi/BatchedScanSettings.java index 44a2ab4..f7ebc17 100644 --- a/wifi/java/android/net/wifi/BatchedScanSettings.java +++ b/wifi/java/android/net/wifi/BatchedScanSettings.java @@ -135,6 +135,42 @@ public class BatchedScanSettings implements Parcelable { return false; } + /** @hide */ + public void constrain() { + if (scanIntervalSec == UNSPECIFIED) { + scanIntervalSec = DEFAULT_INTERVAL_SEC; + } else if (scanIntervalSec < MIN_INTERVAL_SEC) { + scanIntervalSec = MIN_INTERVAL_SEC; + } else if (scanIntervalSec > MAX_INTERVAL_SEC) { + scanIntervalSec = MAX_INTERVAL_SEC; + } + + if (maxScansPerBatch == UNSPECIFIED) { + maxScansPerBatch = DEFAULT_SCANS_PER_BATCH; + } else if (maxScansPerBatch < MIN_SCANS_PER_BATCH) { + maxScansPerBatch = MIN_SCANS_PER_BATCH; + } else if (maxScansPerBatch > MAX_SCANS_PER_BATCH) { + maxScansPerBatch = MAX_SCANS_PER_BATCH; + } + + if (maxApPerScan == UNSPECIFIED) { + maxApPerScan = DEFAULT_AP_PER_SCAN; + } else if (maxApPerScan < MIN_AP_PER_SCAN) { + maxApPerScan = MIN_AP_PER_SCAN; + } else if (maxApPerScan > MAX_AP_PER_SCAN) { + maxApPerScan = MAX_AP_PER_SCAN; + } + + if (maxApForDistance == UNSPECIFIED) { + maxApForDistance = DEFAULT_AP_FOR_DISTANCE; + } else if (maxApForDistance < MIN_AP_FOR_DISTANCE) { + maxApForDistance = MIN_AP_FOR_DISTANCE; + } else if (maxApForDistance > MAX_AP_FOR_DISTANCE) { + maxApForDistance = MAX_AP_FOR_DISTANCE; + } + } + + @Override public boolean equals(Object obj) { if (obj instanceof BatchedScanSettings == false) return false; diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 4c84f17..87afa88 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -361,7 +361,8 @@ public class WifiConfiguration implements Parcelable { if (allowedKeyManagement.get(KeyMgmt.WPA_EAP) == false) { return false; } - if (allowedKeyManagement.get(KeyMgmt.IEEE8021X) == false) { + if ((allowedKeyManagement.get(KeyMgmt.IEEE8021X) == false) + && (allowedKeyManagement.get(KeyMgmt.WPA_PSK) == false)) { return false; } } |