summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt402
-rw-r--r--core/java/android/content/Context.java1
-rw-r--r--core/java/android/hardware/camera2/package.html2
-rw-r--r--docs/html/training/basics/intents/filters.jd5
-rw-r--r--docs/html/training/basics/intents/index.jd7
-rw-r--r--docs/html/training/basics/intents/result.jd5
-rw-r--r--docs/html/training/basics/intents/sending.jd4
-rw-r--r--docs/html/training/building-content-sharing.jd8
-rw-r--r--docs/html/training/secure-file-sharing/index.jd80
-rw-r--r--docs/html/training/secure-file-sharing/request-file.jd147
-rw-r--r--docs/html/training/secure-file-sharing/retrieve-info.jd110
-rw-r--r--docs/html/training/secure-file-sharing/setup-sharing.jd136
-rw-r--r--docs/html/training/secure-file-sharing/share-file.jd298
-rw-r--r--docs/html/training/sharing/index.jd30
-rw-r--r--docs/html/training/sharing/receive.jd48
-rw-r--r--docs/html/training/sharing/send.jd66
-rw-r--r--docs/html/training/sharing/shareaction.jd58
-rw-r--r--docs/html/training/training_toc.cs120
-rw-r--r--graphics/java/android/graphics/ImageFormat.java6
-rw-r--r--media/java/android/media/Image.java12
-rw-r--r--media/java/android/media/ImageReader.java3
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java2
-rw-r--r--services/java/com/android/server/am/ActivityStack.java4
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java11
24 files changed, 991 insertions, 574 deletions
diff --git a/api/current.txt b/api/current.txt
index dc21e90a5c89..68a4f50d7d5f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5974,7 +5974,6 @@ package android.content {
field public static final int BIND_NOT_FOREGROUND = 4; // 0x4
field public static final int BIND_WAIVE_PRIORITY = 32; // 0x20
field public static final java.lang.String BLUETOOTH_SERVICE = "bluetooth";
- field public static final java.lang.String CAMERA_SERVICE = "camera";
field public static final java.lang.String CAPTIONING_SERVICE = "captioning";
field public static final java.lang.String CLIPBOARD_SERVICE = "clipboard";
field public static final java.lang.String CONNECTIVITY_SERVICE = "connectivity";
@@ -9248,7 +9247,6 @@ package android.graphics {
field public static final int JPEG = 256; // 0x100
field public static final int NV16 = 16; // 0x10
field public static final int NV21 = 17; // 0x11
- field public static final int RAW_SENSOR = 32; // 0x20
field public static final int RGB_565 = 4; // 0x4
field public static final int UNKNOWN = 0; // 0x0
field public static final int YUV_420_888 = 35; // 0x23
@@ -10856,406 +10854,6 @@ package android.hardware {
}
-package android.hardware.camera2 {
-
- public class CameraAccessException extends android.util.AndroidException {
- ctor public CameraAccessException(int);
- ctor public CameraAccessException(int, java.lang.String);
- ctor public CameraAccessException(int, java.lang.String, java.lang.Throwable);
- ctor public CameraAccessException(int, java.lang.Throwable);
- method public final int getReason();
- field public static final int CAMERA_DISABLED = 1; // 0x1
- field public static final int CAMERA_DISCONNECTED = 2; // 0x2
- 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 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 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
- field public static final int TEMPLATE_RECORD = 3; // 0x3
- field public static final int TEMPLATE_STILL_CAPTURE = 2; // 0x2
- field public static final int TEMPLATE_VIDEO_SNAPSHOT = 4; // 0x4
- }
-
- 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, 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);
- }
-
- public static abstract class CameraDevice.StateListener {
- ctor public CameraDevice.StateListener();
- method public void onActive(android.hardware.camera2.CameraDevice);
- method public void onBusy(android.hardware.camera2.CameraDevice);
- method public void onClosed(android.hardware.camera2.CameraDevice);
- method public abstract void onDisconnected(android.hardware.camera2.CameraDevice);
- method public abstract void onError(android.hardware.camera2.CameraDevice, int);
- method public void onIdle(android.hardware.camera2.CameraDevice);
- method public abstract void onOpened(android.hardware.camera2.CameraDevice);
- method public void onUnconfigured(android.hardware.camera2.CameraDevice);
- field public static final int ERROR_CAMERA_DEVICE = 4; // 0x4
- field public static final int ERROR_CAMERA_DISABLED = 3; // 0x3
- field public static final int ERROR_CAMERA_IN_USE = 1; // 0x1
- field public static final int ERROR_CAMERA_SERVICE = 5; // 0x5
- field public static final int ERROR_MAX_CAMERAS_IN_USE = 2; // 0x2
- }
-
- 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 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);
- }
-
- public static abstract class CameraManager.AvailabilityListener {
- ctor public CameraManager.AvailabilityListener();
- method public void onCameraAvailable(java.lang.String);
- method public void onCameraUnavailable(java.lang.String);
- }
-
- public abstract class CameraMetadata {
- method public abstract T get(android.hardware.camera2.CameraMetadata.Key<T>);
- method public java.util.List<android.hardware.camera2.CameraMetadata.Key<?>> getKeys();
- field public static final int COLOR_CORRECTION_MODE_FAST = 1; // 0x1
- field public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2; // 0x2
- field public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0; // 0x0
- field public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1; // 0x1
- field public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2; // 0x2
- field public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3; // 0x3
- field public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0; // 0x0
- field public static final int CONTROL_AE_MODE_OFF = 0; // 0x0
- field public static final int CONTROL_AE_MODE_ON = 1; // 0x1
- field public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3; // 0x3
- field public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2; // 0x2
- field public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4; // 0x4
- field public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0; // 0x0
- field public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1; // 0x1
- field public static final int CONTROL_AE_STATE_CONVERGED = 2; // 0x2
- field public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4; // 0x4
- field public static final int CONTROL_AE_STATE_INACTIVE = 0; // 0x0
- field public static final int CONTROL_AE_STATE_LOCKED = 3; // 0x3
- field public static final int CONTROL_AE_STATE_PRECAPTURE = 5; // 0x5
- field public static final int CONTROL_AE_STATE_SEARCHING = 1; // 0x1
- field public static final int CONTROL_AF_MODE_AUTO = 1; // 0x1
- field public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4; // 0x4
- field public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3; // 0x3
- field public static final int CONTROL_AF_MODE_EDOF = 5; // 0x5
- field public static final int CONTROL_AF_MODE_MACRO = 2; // 0x2
- field public static final int CONTROL_AF_MODE_OFF = 0; // 0x0
- field public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3; // 0x3
- field public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4; // 0x4
- field public static final int CONTROL_AF_STATE_INACTIVE = 0; // 0x0
- field public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5; // 0x5
- field public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2; // 0x2
- field public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1; // 0x1
- field public static final int CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6; // 0x6
- field public static final int CONTROL_AF_TRIGGER_CANCEL = 2; // 0x2
- field public static final int CONTROL_AF_TRIGGER_IDLE = 0; // 0x0
- field public static final int CONTROL_AF_TRIGGER_START = 1; // 0x1
- field public static final int CONTROL_AWB_MODE_AUTO = 1; // 0x1
- field public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6; // 0x6
- field public static final int CONTROL_AWB_MODE_DAYLIGHT = 5; // 0x5
- field public static final int CONTROL_AWB_MODE_FLUORESCENT = 3; // 0x3
- field public static final int CONTROL_AWB_MODE_INCANDESCENT = 2; // 0x2
- field public static final int CONTROL_AWB_MODE_OFF = 0; // 0x0
- field public static final int CONTROL_AWB_MODE_SHADE = 8; // 0x8
- field public static final int CONTROL_AWB_MODE_TWILIGHT = 7; // 0x7
- field public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4; // 0x4
- field public static final int CONTROL_AWB_STATE_CONVERGED = 2; // 0x2
- field public static final int CONTROL_AWB_STATE_INACTIVE = 0; // 0x0
- field public static final int CONTROL_AWB_STATE_LOCKED = 3; // 0x3
- field public static final int CONTROL_AWB_STATE_SEARCHING = 1; // 0x1
- field public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0; // 0x0
- field public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1; // 0x1
- field public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2; // 0x2
- field public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3; // 0x3
- field public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4; // 0x4
- field public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5; // 0x5
- field public static final int CONTROL_EFFECT_MODE_AQUA = 8; // 0x8
- field public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7; // 0x7
- field public static final int CONTROL_EFFECT_MODE_MONO = 1; // 0x1
- field public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2; // 0x2
- field public static final int CONTROL_EFFECT_MODE_OFF = 0; // 0x0
- field public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5; // 0x5
- field public static final int CONTROL_EFFECT_MODE_SEPIA = 4; // 0x4
- field public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3; // 0x3
- field public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6; // 0x6
- field public static final int CONTROL_MODE_AUTO = 1; // 0x1
- field public static final int CONTROL_MODE_OFF = 0; // 0x0
- field public static final int CONTROL_MODE_USE_SCENE_MODE = 2; // 0x2
- field public static final int CONTROL_SCENE_MODE_ACTION = 2; // 0x2
- field public static final int CONTROL_SCENE_MODE_BARCODE = 16; // 0x10
- field public static final int CONTROL_SCENE_MODE_BEACH = 8; // 0x8
- field public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15; // 0xf
- field public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1; // 0x1
- field public static final int CONTROL_SCENE_MODE_FIREWORKS = 12; // 0xc
- field public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4; // 0x4
- field public static final int CONTROL_SCENE_MODE_NIGHT = 5; // 0x5
- field public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6; // 0x6
- field public static final int CONTROL_SCENE_MODE_PARTY = 14; // 0xe
- field public static final int CONTROL_SCENE_MODE_PORTRAIT = 3; // 0x3
- field public static final int CONTROL_SCENE_MODE_SNOW = 9; // 0x9
- field public static final int CONTROL_SCENE_MODE_SPORTS = 13; // 0xd
- field public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11; // 0xb
- field public static final int CONTROL_SCENE_MODE_SUNSET = 10; // 0xa
- field public static final int CONTROL_SCENE_MODE_THEATRE = 7; // 0x7
- field public static final int CONTROL_SCENE_MODE_UNSUPPORTED = 0; // 0x0
- field public static final int EDGE_MODE_FAST = 1; // 0x1
- field public static final int EDGE_MODE_HIGH_QUALITY = 2; // 0x2
- field public static final int EDGE_MODE_OFF = 0; // 0x0
- field public static final int FLASH_MODE_OFF = 0; // 0x0
- field public static final int FLASH_MODE_SINGLE = 1; // 0x1
- field public static final int FLASH_MODE_TORCH = 2; // 0x2
- field public static final int FLASH_STATE_CHARGING = 1; // 0x1
- field public static final int FLASH_STATE_FIRED = 3; // 0x3
- field public static final int FLASH_STATE_READY = 2; // 0x2
- field public static final int FLASH_STATE_UNAVAILABLE = 0; // 0x0
- field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; // 0x1
- field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; // 0x0
- field public static final int LENS_FACING_BACK = 1; // 0x1
- field public static final int LENS_FACING_FRONT = 0; // 0x0
- field public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0; // 0x0
- field public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1; // 0x1
- field public static final int LENS_STATE_MOVING = 1; // 0x1
- field public static final int LENS_STATE_STATIONARY = 0; // 0x0
- field public static final int NOISE_REDUCTION_MODE_FAST = 1; // 0x1
- field public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2; // 0x2
- field public static final int NOISE_REDUCTION_MODE_OFF = 0; // 0x0
- field public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2; // 0x2
- field public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0; // 0x0
- field public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1; // 0x1
- field public static final int STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0; // 0x0
- field public static final int STATISTICS_LENS_SHADING_MAP_MODE_ON = 1; // 0x1
- field public static final int STATISTICS_SCENE_FLICKER_50HZ = 1; // 0x1
- field public static final int STATISTICS_SCENE_FLICKER_60HZ = 2; // 0x2
- field public static final int STATISTICS_SCENE_FLICKER_NONE = 0; // 0x0
- field public static final int TONEMAP_MODE_CONTRAST_CURVE = 0; // 0x0
- field public static final int TONEMAP_MODE_FAST = 1; // 0x1
- field public static final int TONEMAP_MODE_HIGH_QUALITY = 2; // 0x2
- }
-
- public static class CameraMetadata.Key {
- method public final boolean equals(java.lang.Object);
- method public final java.lang.String getName();
- method public final int hashCode();
- }
-
- 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 {
- method public int describeContents();
- method public T get(android.hardware.camera2.CameraMetadata.Key<T>);
- method public java.lang.Object getTag();
- method public void writeToParcel(android.os.Parcel, int);
- 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_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_TRANSFORM;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_ANTIBANDING_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_EXPOSURE_COMPENSATION;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_LOCK;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_PRECAPTURE_TRIGGER;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_REGIONS;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_TARGET_FPS_RANGE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_REGIONS;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_TRIGGER;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_LOCK;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_REGIONS;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_CAPTURE_INTENT;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_EFFECT_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_SCENE_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_VIDEO_STABILIZATION_MODE;
- field public static final android.os.Parcelable.Creator CREATOR;
- field public static final android.hardware.camera2.CameraMetadata.Key EDGE_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key FLASH_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_COORDINATES;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_PROCESSING_METHOD;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_TIMESTAMP;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_ORIENTATION;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_QUALITY;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_THUMBNAIL_QUALITY;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_THUMBNAIL_SIZE;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_APERTURE;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_FILTER_DENSITY;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCAL_LENGTH;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCUS_DISTANCE;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_OPTICAL_STABILIZATION_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key NOISE_REDUCTION_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key SCALER_CROP_REGION;
- field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_EXPOSURE_TIME;
- field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_FRAME_DURATION;
- field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_SENSITIVITY;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_DETECT_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_LENS_SHADING_MAP_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_BLUE;
- field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_GREEN;
- field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_RED;
- field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_MODE;
- }
-
- public static final class CaptureRequest.Builder {
- method public void addTarget(android.view.Surface);
- method public android.hardware.camera2.CaptureRequest build();
- method public T get(android.hardware.camera2.CameraMetadata.Key<T>);
- method public void removeTarget(android.view.Surface);
- method public void set(android.hardware.camera2.CameraMetadata.Key<T>, T);
- method public void setTag(java.lang.Object);
- }
-
- 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;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_REGIONS;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_STATE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_REGIONS;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_STATE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_REGIONS;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_STATE;
- field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key EDGE_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key FLASH_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key FLASH_STATE;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_COORDINATES;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_PROCESSING_METHOD;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_TIMESTAMP;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_ORIENTATION;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_QUALITY;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_THUMBNAIL_QUALITY;
- field public static final android.hardware.camera2.CameraMetadata.Key JPEG_THUMBNAIL_SIZE;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_APERTURE;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_FILTER_DENSITY;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCAL_LENGTH;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCUS_DISTANCE;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCUS_RANGE;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_OPTICAL_STABILIZATION_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key LENS_STATE;
- field public static final android.hardware.camera2.CameraMetadata.Key NOISE_REDUCTION_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_FRAME_COUNT;
- field public static final android.hardware.camera2.CameraMetadata.Key SCALER_CROP_REGION;
- field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_EXPOSURE_TIME;
- field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_FRAME_DURATION;
- field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_SENSITIVITY;
- field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_TEMPERATURE;
- field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_TIMESTAMP;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACES;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_DETECT_MODE;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_IDS;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_LANDMARKS;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_RECTANGLES;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_SCORES;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_LENS_SHADING_MAP;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_PREDICTED_COLOR_GAINS;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_PREDICTED_COLOR_TRANSFORM;
- field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_SCENE_FLICKER;
- field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_BLUE;
- field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_GREEN;
- field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_RED;
- field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_MODE;
- }
-
- public final class Face {
- method public android.graphics.Rect getBounds();
- method public int getId();
- method public android.graphics.Point getLeftEyePosition();
- method public android.graphics.Point getMouthPosition();
- method public android.graphics.Point getRightEyePosition();
- method public int getScore();
- field public static final int ID_UNSUPPORTED = -1; // 0xffffffff
- field public static final int SCORE_MAX = 100; // 0x64
- field public static final int SCORE_MIN = 1; // 0x1
- }
-
- public final class Rational {
- ctor public Rational(int, int);
- method public int getDenominator();
- method public int getNumerator();
- }
-
- public final class Size {
- ctor public Size(int, int);
- method public final int getHeight();
- method public final int getWidth();
- }
-
-}
-
package android.hardware.display {
public final class DisplayManager {
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 50401bd9c902..fe079bcc65ca 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -2371,6 +2371,7 @@ public abstract class Context {
*
* @see #getSystemService
* @see android.hardware.camera2.CameraManager
+ * @hide
*/
public static final String CAMERA_SERVICE = "camera";
diff --git a/core/java/android/hardware/camera2/package.html b/core/java/android/hardware/camera2/package.html
index 9f6c2a9b618c..c61998403c8e 100644
--- a/core/java/android/hardware/camera2/package.html
+++ b/core/java/android/hardware/camera2/package.html
@@ -80,5 +80,7 @@ output streams included in the request. These are produced
asynchronously relative to the output CaptureResult, sometimes
substantially later.</p>
+{@hide}
+
</BODY>
</HTML>
diff --git a/docs/html/training/basics/intents/filters.jd b/docs/html/training/basics/intents/filters.jd
index 0090c985fadf..9b6a1114b3bd 100644
--- a/docs/html/training/basics/intents/filters.jd
+++ b/docs/html/training/basics/intents/filters.jd
@@ -20,7 +20,8 @@ previous.link=result.html
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}training/sharing/index.html">Sharing Content</a></li>
+ <li><a href="{@docRoot}training/sharing/index.html">Sharing Simple Data</a></li>
+ <li><a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a>
</ul>
</div>
</div>
@@ -152,7 +153,7 @@ implicit intents will resolve to your activity.</p>
<p>For more information about sending and receiving {@link android.content.Intent#ACTION_SEND}
intents that perform social sharing behaviors, see the lesson about <a
-href="{@docRoot}training/sharing/receive.html">Receiving Content from Other Apps</a>.</p>
+href="{@docRoot}training/sharing/receive.html">Receiving Simple Data from Other Apps</a>.</p>
<h2 id="HandleIntent">Handle the Intent in Your Activity</h2>
diff --git a/docs/html/training/basics/intents/index.jd b/docs/html/training/basics/intents/index.jd
index 8876a331914f..59ba11f75b1d 100644
--- a/docs/html/training/basics/intents/index.jd
+++ b/docs/html/training/basics/intents/index.jd
@@ -19,7 +19,8 @@ Lifecycle</a>)</li>
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}training/sharing/index.html">Sharing Content</a></li>
+ <li><a href="{@docRoot}training/sharing/index.html">Sharing Simple Data</a></li>
+ <li><a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a>
<li><a
href="http://android-developers.blogspot.com/2009/11/integrating-application-with-intents.html">
Integrating Application with Intents (blog post)</a></li>
@@ -49,7 +50,7 @@ interactions with other apps, such as start another app, receive a result from t
make your app able to respond to intents from other apps.</p>
<h2>Lessons</h2>
-
+
<dl>
<dt><b><a href="sending.html">Sending the User to Another App</a></b></dt>
<dd>Shows how you can create implicit intents to launch other apps that can perform an
@@ -59,5 +60,5 @@ action.</dd>
<dt><b><a href="filters.html">Allowing Other Apps to Start Your Activity</a></b></dt>
<dd>Shows how to make activities in your app open for use by other apps by defining
intent filters that declare the implicit intents your app accepts.</dd>
-</dl>
+</dl>
diff --git a/docs/html/training/basics/intents/result.jd b/docs/html/training/basics/intents/result.jd
index 24ecc46f5819..64fbb8b40710 100644
--- a/docs/html/training/basics/intents/result.jd
+++ b/docs/html/training/basics/intents/result.jd
@@ -21,7 +21,8 @@ next.link=filters.html
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}training/sharing/index.html">Sharing Content</a></li>
+ <li><a href="{@docRoot}training/sharing/index.html">Sharing Simple Data</a></li>
+ <li><a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a>
</ul>
</div>
@@ -71,7 +72,7 @@ private void pickContact() {
<h2 id="ReceiveResult">Receive the Result</h2>
-<p>When the user is done with the subsequent activity and returns, the system calls your activity's
+<p>When the user is done with the subsequent activity and returns, the system calls your activity's
{@link android.app.Activity#onActivityResult onActivityResult()} method. This method includes three
arguments:</p>
diff --git a/docs/html/training/basics/intents/sending.jd b/docs/html/training/basics/intents/sending.jd
index aba3896825b1..79c017b3ae9f 100644
--- a/docs/html/training/basics/intents/sending.jd
+++ b/docs/html/training/basics/intents/sending.jd
@@ -22,7 +22,7 @@ next.link=result.html
<h2>You should also read</h2>
<ul>
- <li><a href="{@docRoot}training/sharing/index.html">Sharing Content</a></li>
+ <li><a href="{@docRoot}training/sharing/index.html">Sharing Simple Data</a></li>
</ul>
</div>
@@ -200,7 +200,7 @@ Intent mapIntent = new Intent(Intent.ACTION_VIEW, location);
PackageManager packageManager = {@link android.content.Context#getPackageManager()};
List&lt;ResolveInfo> activities = packageManager.queryIntentActivities(mapIntent, 0);
boolean isIntentSafe = activities.size() > 0;
-
+
// Start an activity if it's safe
if (isIntentSafe) {
startActivity(mapIntent);
diff --git a/docs/html/training/building-content-sharing.jd b/docs/html/training/building-content-sharing.jd
new file mode 100644
index 000000000000..52298c375be1
--- /dev/null
+++ b/docs/html/training/building-content-sharing.jd
@@ -0,0 +1,8 @@
+page.title=Building Apps with Content Sharing
+page.trainingcourse=true
+
+@jd:body
+
+
+
+<p>These classes teach you how to create apps that share data between apps and devices.</p>
diff --git a/docs/html/training/secure-file-sharing/index.jd b/docs/html/training/secure-file-sharing/index.jd
new file mode 100644
index 000000000000..19a10428176d
--- /dev/null
+++ b/docs/html/training/secure-file-sharing/index.jd
@@ -0,0 +1,80 @@
+page.title=Sharing Files
+
+trainingnavtop=true
+startpage=true
+
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>Dependencies and prerequisites</h2>
+<ul>
+ <li>Android 1.6 (API Level 4) or higher</li>
+ <li>Familiarity with file operations such as opening, reading, and writing files</li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/data/data-storage.html">Storage Options</a></li>
+ <li><a href="{@docRoot}training/basics/data-storage/files.html">Saving Files</a>
+ <li><a href="{@docRoot}training/sharing/index.html">Sharing Simple Data</a></li>
+</ul>
+
+</div>
+</div>
+
+<p>
+ Apps often have a need to offer one or more of their files to another app. For example, an image
+ gallery may want to offer files to image editors, or a file management app may want to allow
+ users to copy and paste files between areas in external storage. One way a sending app can
+ share a file is to respond to a request from the receiving app.
+</p>
+<p>
+ In all cases, the only secure way to offer a file from your app to another app is to send the
+ receiving app the file's content URI and grant temporary access permissions to that URI.
+ Content URIs with temporary URI access permissions are secure because they apply only to the
+ app that receives the URI, and they expire automatically. The Android
+ {@link android.support.v4.content.FileProvider} component provides the method
+ {@link android.support.v4.content.FileProvider#getUriForFile getUriForFile()} for
+ generating a file's content URI.
+</p>
+<p>
+ If you want to share small amounts of text or numeric data between apps, you should send an
+ {@link android.content.Intent} that contains the data. To learn how to send simple data with an
+ {@link android.content.Intent}, see the training class
+ <a href="{@docRoot}training/sharing/index.html">Sharing Simple Data</a>.
+</p>
+<p>
+ This class explains how to securely share files from your app to another app using content URIs
+ generated by the Android {@link android.support.v4.content.FileProvider} component and
+ temporary permissions that you grant to the receiving app for the content URI.
+</p>
+<h2>Lessons</h2>
+<dl>
+ <dt><b><a href="setup-sharing.html">Setting Up File Sharing</a></b></dt>
+ <dd>
+ Learn how to set up your app to share files.
+ </dd>
+ <dt><b><a href="share-file.html">Sharing a File</a></b></dt>
+ <dd>
+ Learn how to offer a file to another app by generating a content URI for the file,
+ granting access permissions to the URI, and sending the URI to the app.
+ </dd>
+ <dt><b><a href="request-file.html">Requesting a Shared File</a></b></dt>
+ <dd>
+ Learn how to request a file shared by another app, receive the content URI for the file,
+ and use the content URI to open the file.
+ </dd>
+ <dt>
+ <b><a href="retrieve-info.html">Retrieving File Information</a></b>
+ </dt>
+ <dd>
+ Learn how an app can use a content URI generated by a
+ {@link android.support.v4.content.FileProvider} to retrieve file information including
+ MIME type and file size.
+ </dd>
+</dl>
+
+
diff --git a/docs/html/training/secure-file-sharing/request-file.jd b/docs/html/training/secure-file-sharing/request-file.jd
new file mode 100644
index 000000000000..116701dcddc2
--- /dev/null
+++ b/docs/html/training/secure-file-sharing/request-file.jd
@@ -0,0 +1,147 @@
+page.title=Requesting a Shared File
+
+trainingnavtop=true
+@jd:body
+
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#SendRequest">Send a Request for the File</a></li>
+ <li><a href="#OpenFile">Access the Requested File</a>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li>
+ <a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
+ </li>
+ <li>
+ <a href="{@docRoot}guide/topics/providers/content-provider-basics.html#SimpleQuery"
+ >Retrieving Data from the Provider</a>
+ </li>
+</ul>
+
+</div>
+</div>
+
+<p>
+ When an app wants to access a file shared by another app, the requesting app (the client)
+ usually sends a request to the app sharing the files (the server). In most cases, the request
+ starts an {@link android.app.Activity} in the server app that displays the files it can share.
+ The user picks a file, after which the server app returns the file's content URI to the
+ client app.
+</p>
+<p>
+ This lesson shows you how a client app requests a file from a server app, receives the file's
+ content URI from the server app, and opens the file using the content URI.
+</p>
+
+<h2 id="SendRequest">Send a Request for the File</h2>
+<p>
+ To request a file from the server app, the client app calls
+ {@link android.app.Activity#startActivityForResult startActivityForResult} with an
+ {@link android.content.Intent} containing the action such as
+ {@link android.content.Intent#ACTION_PICK ACTION_PICK} and a MIME type that the client app
+ can handle.
+</p>
+<p>
+ For example, the following code snippet demonstrates how to send an
+ {@link android.content.Intent} to a server app in order to start the
+ {@link android.app.Activity} described in <a href="share-file.html#SendURI"
+ >Sharing a File</a>:
+</p>
+<pre>
+public class MainActivity extends Activity {
+ private Intent mRequestFileIntent;
+ private ParcelFileDescriptor mInputPFD;
+ ...
+ &#64;Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ mRequestFileIntent = new Intent(Intent.ACTION_PICK);
+ mRequestFileIntent.setType("image/jpg");
+ ...
+ }
+ ...
+ protected void requestFile() {
+ /**
+ * When the user requests a file, send an Intent to the
+ * server app.
+ * files.
+ */
+ startActivityForResult(mRequestFileIntent, 0);
+ ...
+ }
+ ...
+}
+</pre>
+<h2 id="OpenFile">Access the Requested File</h2>
+<p>
+ The server app sends the file's content URI back to the client app in an
+ {@link android.content.Intent}. This {@link android.content.Intent} is passed to the client
+ app in its override of {@link android.app.Activity#onActivityResult onActivityResult()}. Once
+ the client app has the file's content URI, it can access the file by getting its
+ {@link java.io.FileDescriptor}.
+</p>
+<p>
+<p>
+ File security is preserved in this process because the content URI is the only piece of data
+ that the client app receives. Since this URI doesn't contain a directory path, the client app
+ can't discover and open any other files in the server app. Only the client app gets access to
+ the file, and only for the permissions granted by the server app. The permissions are temporary,
+ so once the client app's task stack is finished, the file is no longer accessible outside the
+ server app.
+</p>
+<p>
+ The next snippet demonstrates how the client app handles the
+ {@link android.content.Intent} sent from the server app, and how the client app gets the
+ {@link java.io.FileDescriptor} using the content URI:
+</p>
+<pre>
+ /*
+ * When the Activity of the app that hosts files sets a result and calls
+ * finish(), this method is invoked. The returned Intent contains the
+ * content URI of a selected file. The result code indicates if the
+ * selection worked or not.
+ */
+ &#64;Override
+ public void onActivityResult(int requestCode, int resultCode,
+ Intent returnIntent) {
+ // If the selection didn't work
+ if (resultCode != RESULT_OK) {
+ // Exit without doing anything else
+ return;
+ } else {
+ // Get the file's content URI from the incoming Intent
+ Uri returnUri = returnIntent.getData();
+ /*
+ * Try to open the file for "read" access using the
+ * returned URI. If the file isn't found, write to the
+ * error log and return.
+ */
+ try {
+ /*
+ * Get the content resolver instance for this context, and use it
+ * to get a ParcelFileDescriptor for the file.
+ */
+ mInputPFD = getContentResolver().openFileDescriptor(returnUri, "r");
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ Log.e("MainActivity", "File not found.");
+ return;
+ }
+ // Get a regular file descriptor for the file
+ FileDescriptor fd = mInputPFD.getFileDescriptor();
+ ...
+ }
+ }
+</pre>
+<p>
+ The method {@link android.content.ContentResolver#openFileDescriptor openFileDescriptor()}
+ returns a {@link android.os.ParcelFileDescriptor} for the file. From this object, the client
+ app gets a {@link java.io.FileDescriptor} object, which it can then use to read the file.
+</p>
diff --git a/docs/html/training/secure-file-sharing/retrieve-info.jd b/docs/html/training/secure-file-sharing/retrieve-info.jd
new file mode 100644
index 000000000000..4a2b7d86b4a0
--- /dev/null
+++ b/docs/html/training/secure-file-sharing/retrieve-info.jd
@@ -0,0 +1,110 @@
+page.title=Retrieving File Information
+
+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="#RetrieveMimeType">Retrieve a File's MIME Type</a></li>
+ <li><a href="#RetrieveFileInfo">Retrieve a File's Name and Size</a></li>
+</ol>
+
+<!-- other docs (NOT javadocs) -->
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/providers/content-provider-basics.html#SimpleQuery"
+ >Retrieving Data from the Provider</a></li>
+</ul>
+
+</div>
+</div>
+<p>
+ Before a client app tries to work with a file for which it has a content URI, the app can
+ request information about the file from the server app, including the file's data type and
+ file size. The data type helps the client app to determine if it can handle the file, and the
+ file size helps the client app set up buffering and caching for the file.
+</p>
+<p>
+ This lesson demonstrates how to query the server app's
+ {@link android.support.v4.content.FileProvider} to retrieve a file's MIME type and size.
+</p>
+<h2 id="RetrieveMimeType">Retrieve a File's MIME Type</h2>
+<p>
+ A file's data type indicates to the client app how it should handle the file's contents. To get
+ the data type of a shared file given its content URI, the client app calls
+ {@link android.content.ContentResolver#getType ContentResolver.getType()}. This method returns
+ the file's MIME type. By default, a
+ {@link android.support.v4.content.FileProvider} determines the file's MIME type from its
+ filename extension.
+</p>
+<p>
+ The following code snippet demonstrates how a client app retrieves the MIME type of a file once
+ the server app has returned the content URI to the client:
+</p>
+<pre>
+ ...
+ /*
+ * Get the file's content URI from the incoming Intent, then
+ * get the file's MIME type
+ */
+ Uri returnUri = returnIntent.getData();
+ String mimeType = getContentResolver().getType(returnUri);
+ ...
+</pre>
+<h2 id="RetrieveFileInfo">Retrieve a File's Name and Size</h2>
+<p>
+ The {@link android.support.v4.content.FileProvider} class has a default implementation of the
+ {@link android.support.v4.content.FileProvider#query query()} method that returns the
+ name and size of the file associated with a content URI in a
+ {@link android.database.Cursor}. The default implementation returns two columns:
+</p>
+<dl>
+ <dt>{@link android.provider.OpenableColumns#DISPLAY_NAME DISPLAY_NAME}</dt>
+ <dd>
+ The file's name, as a {@link java.lang.String}. This value is the same as the value returned
+ by {@link java.io.File#getName File.getName()}.
+ </dd>
+ <dt>{@link android.provider.OpenableColumns#SIZE SIZE}</dt>
+ <dd>
+ The size of the file in bytes, as a {@code long} This value is the same as the value
+ returned by {@link java.io.File#length File.length()}
+ </dd>
+</dl>
+<p>
+ The client app can get both the {@link android.provider.OpenableColumns#DISPLAY_NAME
+ DISPLAY_NAME} and {@link android.provider.OpenableColumns#SIZE SIZE} for a file by setting all
+ of the arguments of {@link android.support.v4.content.FileProvider#query query()} to
+ {@code null} except for the content URI. For example, this code snippet retrieves a file's
+ {@link android.provider.OpenableColumns#DISPLAY_NAME DISPLAY_NAME} and
+ {@link android.provider.OpenableColumns#SIZE SIZE} and displays each one in separate
+ {@link android.widget.TextView}:
+</p>
+<pre>
+ ...
+ /*
+ * Get the file's content URI from the incoming Intent,
+ * then query the server app to get the file's display name
+ * and size.
+ */
+ Uri returnUri = returnIntent.getData();
+ Cursor returnCursor =
+ getContentResolver().query(returnUri, null, null, null, null);
+ /*
+ * Get the column indexes of the data in the Cursor,
+ * move to the first row in the Cursor, get the data,
+ * and display it.
+ */
+ int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
+ int sizeIndex = returnCursor.getColumnIndex(OpenableColumns.SIZE);
+ returnCursor.moveToFirst();
+ TextView nameView = (TextView) findViewById(R.id.filename_text);
+ TextView sizeView = (TextView) findViewById(R.id.filesize_text);
+ nameView.setText(returnCursor.getString(nameIndex));
+ sizeView.setText(Long.toString(returnCursor.getLong(sizeIndex)));
+ ...
+</pre>
diff --git a/docs/html/training/secure-file-sharing/setup-sharing.jd b/docs/html/training/secure-file-sharing/setup-sharing.jd
new file mode 100644
index 000000000000..d1ab99317ea9
--- /dev/null
+++ b/docs/html/training/secure-file-sharing/setup-sharing.jd
@@ -0,0 +1,136 @@
+page.title=Setting Up File Sharing
+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="#DefineProvider">Specify the FileProvider</a></li>
+ <li><a href="#DefineMetaData">Specify Sharable Directories</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li><a href="{@docRoot}guide/topics/data/data-storage.html">Storage Options</a></li>
+ <li><a href="{@docRoot}training/basics/data-storage/files.html">Saving Files</a>
+</ul>
+
+</div>
+</div>
+
+<p>
+ To securely offer a file from your app to another app, you need to configure your app to offer
+ a secure handle to the file, in the form of a content URI. The Android
+ {@link android.support.v4.content.FileProvider} component generates content URIs for
+ files, based on specifications you provide in XML. This lesson shows you how to add the default
+ implementation of {@link android.support.v4.content.FileProvider} to your app, and how to
+ specify the files you want to offer to other apps.
+</p>
+<h2 id="DefineProvider">Specify the FileProvider</h2>
+<p>
+ Defining a {@link android.support.v4.content.FileProvider} for your app requires an entry in
+ your manifest. This entry specifies the authority to use in generating content URIs, as well as
+ the name of an XML file that specifies the directories your app can share.
+</p>
+<p>
+ The following snippet shows you how to add to your manifest the
+ <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"
+ >&lt;provider&gt;</a></code> element that specifies the
+ {@link android.support.v4.content.FileProvider} class, the authority, and the
+ XML file name:
+</p>
+<pre>
+&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.myapp"&gt;
+ &lt;application
+ ...&gt;
+ &lt;provider
+ android:name="android.support.v4.content.FileProvider"
+ android:authorities="com.example.myapp.fileprovider"
+ android:grantUriPermissions="true"
+ android:exported="false"&gt;
+ &lt;meta-data
+ android:name="android.support.FILE_PROVIDER_PATHS"
+ android:resource="&#64;xml/filepaths" /&gt;
+ &lt;/provider&gt;
+ ...
+ &lt;/application&gt;
+&lt;/manifest&gt;</pre>
+<p>
+ In this example, the <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#auth"
+ >android:authorities</a></code> attribute specifies the URI authority
+ that you want to use for content URIs generated by the
+ {@link android.support.v4.content.FileProvider}.
+ In the example, the authority is <code>com.example.myapp.fileprovider</code>. For your own
+ app, specify an authority consisting of the app's
+ <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html#package"
+ >android:package</a></code> value with the string "fileprovider" appended to it. To learn more
+ about the authority value, see the topic
+ <a href="{@docRoot}guide/topics/providers/content-provider-basics.html#ContentURIs"
+ >Content URIs</a> and the documentation for the
+ <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#auth"
+ >android:authorities</a></code> attribute.
+</p>
+<p>
+ The <code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html"
+ >&lt;meta-data&gt;</a></code> child element of the
+ <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"
+ >&lt;provider&gt;</a></code> points to an XML file that specifies the directories you want to
+ share. The <code>android:resource</code> attribute is the path and name of the file, without
+ the <code>.xml</code> extension.The contents of this file are described in the next section.
+</p>
+<h2 id="DefineMetaData">Specify Sharable Directories</h2>
+<p>
+ Once you have added the {@link android.support.v4.content.FileProvider} to your app manifest,
+ you need to specify the directories that contain the files you want to share. To specify the
+ directories, start by creating the file <code>filepaths.xml</code> in the <code>res/xml/</code>
+ subdirectory of your project. In this file, specify the directories by adding an XML element for
+ each directory. The following snippet shows you an example of the contents of
+ <code>res/xml/filepaths.xml</code>. The snippet also demonstrates how to share a subdirectory
+ of the <code>files/</code> directory in your internal storage area:
+</p>
+<pre>
+&lt;paths&gt;
+ &lt;files-path path="images/" name="myimages" /&gt;
+&lt;/paths&gt;</pre>
+<p>
+ In this example, the <code>&lt;files-path&gt;</code> tag shares directories within the
+ <code>files/</code> directory of your app's internal storage. The <code>path</code> attribute
+ shares the <code>images/</code> subdirectory of <code>files/</code>. The <code>name</code>
+ attribute tells the {@link android.support.v4.content.FileProvider} to add the path segment
+ <code>myimages</code> to content URIs for files in the <code>files/images/</code> subdirectory.
+</p>
+<p>
+ The <code>&lt;paths&gt;</code> element can have multiple children, each specifying a different
+ directory to share. In addition to the <code>&lt;files-path&gt;</code> element, you can
+ use the <code>&lt;external-path&gt;</code> element to share directories in external storage, and
+ the <code>&lt;cache-path&gt;</code> element to share directories in your internal cache
+ directory. To learn more about the child elements that specify shared directories, see the
+ {@link android.support.v4.content.FileProvider} reference documentation.
+</p>
+<p class="note">
+ <strong>Note:</strong> The XML file is the only way you can specify the directories you want to
+ share; you can't programmatically add a directory.
+</p>
+<p>
+ You now have a complete specification of a {@link android.support.v4.content.FileProvider}
+ that generates content URIs for files in the <code>files/</code> directory of your app's
+ internal storage or for files in subdirectories of <code>files/</code>. When your app generates
+ a content URI for a file, it contains the authority specified in the
+ <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"
+ >&lt;provider&gt;</a></code> element (<code>com.example.myapp.fileprovider</code>),
+ the path <code>myimages/</code>, and the name of the file.
+</p>
+<p>
+ For example, if you define a {@link android.support.v4.content.FileProvider} according to the
+ snippets in this lesson, and you request a content URI for the file
+ <code>default_image.jpg</code>, {@link android.support.v4.content.FileProvider} returns the
+ following URI:
+</p>
+<pre>
+content://com.example.myapp.fileprovider/myimages/default_image.jpg</pre>
+
diff --git a/docs/html/training/secure-file-sharing/share-file.jd b/docs/html/training/secure-file-sharing/share-file.jd
new file mode 100644
index 000000000000..6c52770a0fda
--- /dev/null
+++ b/docs/html/training/secure-file-sharing/share-file.jd
@@ -0,0 +1,298 @@
+page.title=Sharing a File
+
+trainingnavtop=true
+@jd:body
+
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+ <li><a href="#ReceiveRequests">Receive File Requests</a></li>
+ <li><a href="#CreateFileSelection">Create a File Selection Activity</a></li>
+ <li><a href="#RespondToRequest">Respond to a File Selection</a></li>
+ <li><a href="#GrantPermissions">Grant Permissions for the File</a></li>
+ <li><a href="#ShareFile">Share the File with the Requesting App</a>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+ <li>
+ <a href="{@docRoot}guide/topics/providers/content-provider-creating.html#ContentURI"
+ >Designing Content URIs</a>
+ </li>
+ <li>
+ <a href="{@docRoot}guide/topics/providers/content-provider-creating.html#Permissions"
+ >Implementing Content Provider Permissions</a>
+ </li>
+ <li>
+ <a href="{@docRoot}guide/topics/security/permissions.html">Permissions</a>
+ </li>
+ <li>
+ <a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>
+ </li>
+</ul>
+
+</div>
+</div>
+<p>
+ Once you have set up your app to share files using content URIs, you can respond to other apps'
+ requests for those files. One way to respond to these requests is to provide a file selection
+ interface from the server app that other applications can invoke. This approach allows a client
+ application to let users select a file from the server app and then receive the selected file's
+ content URI.
+</p>
+<p>
+ This lesson shows you how to create a file selection {@link android.app.Activity} in your app
+ that responds to requests for files.
+</p>
+<h2 id="ReceiveRequests">Receive File Requests</h2>
+<p>
+ To receive requests for files from client apps and respond with a content URI, your app should
+ provide a file selection {@link android.app.Activity}. Client apps start this
+ {@link android.app.Activity} by calling {@link android.app.Activity#startActivityForResult
+ startActivityForResult()} with an {@link android.content.Intent} containing the action
+ {@link android.content.Intent#ACTION_PICK ACTION_PICK}. When the client app calls
+ {@link android.app.Activity#startActivityForResult startActivityForResult()}, your app can
+ return a result to the client app, in the form of a content URI for the file the user selected.
+</p>
+<p>
+ To learn how to implement a request for a file in a client app, see the lesson
+ <a href="request-file.html">Requesting a Shared File</a>.
+</p>
+<h2 id="CreateFileSelection">Create a File Selection Activity</h2>
+<p>
+ To set up the file selection {@link android.app.Activity}, start by specifying the
+ {@link android.app.Activity} in your manifest, along with an intent filter
+ that matches the action {@link android.content.Intent#ACTION_PICK ACTION_PICK} and the
+ categories {@link android.content.Intent#CATEGORY_DEFAULT CATEGORY_DEFAULT} and
+ {@link android.content.Intent#CATEGORY_OPENABLE CATEGORY_OPENABLE}. Also add MIME type filters
+ for the files your app serves to other apps. The following snippet shows you how to specify the
+ new {@link android.app.Activity} and intent filter:
+</p>
+<pre>
+&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"&gt;
+ ...
+ &lt;application&gt;
+ ...
+ &lt;activity
+ android:name=".FileSelectActivity"
+ android:label="&#64;"File Selector" &gt;
+ &lt;intent-filter&gt;
+ &lt;action
+ android:name="android.intent.action.PICK"/&gt;
+ &lt;category
+ android:name="android.intent.category.DEFAULT"/&gt;
+ &lt;category
+ android:name="android.intent.category.OPENABLE"/&gt;
+ &lt;data android:mimeType="text/plain"/&gt;
+ &lt;data android:mimeType="image/*"/&gt;
+ &lt;/intent-filter&gt;
+ &lt;/activity&gt;</pre>
+<h3>Define the file selection Activity in code</h3>
+<p>
+ Next, define an {@link android.app.Activity} subclass that displays the files available from
+ your app's <code>files/images/</code> directory in internal storage and allows the user to pick
+ the desired file. The following snippet demonstrates how to define this
+ {@link android.app.Activity} and respond to the user's selection:
+</p>
+<pre>
+public class MainActivity extends Activity {
+ // The path to the root of this app's internal storage
+ private File mPrivateRootDir;
+ // The path to the "images" subdirectory
+ private File mImagesDir;
+ // Array of files in the images subdirectory
+ File[] mImageFiles;
+ // Array of filenames corresponding to mImageFiles
+ String[] mImageFilenames;
+ // Initialize the Activity
+ &#64;Override
+ protected void onCreate(Bundle savedInstanceState) {
+ ...
+ // Set up an Intent to send back to apps that request a file
+ mResultIntent =
+ new Intent("com.example.myapp.ACTION_RETURN_FILE");
+ // Get the files/ subdirectory of internal storage
+ mPrivateRootDir = getFilesDir();
+ // Get the files/images subdirectory;
+ mImagesDir = new File(mPrivateRootDir, "images");
+ // Get the files in the images subdirectory
+ mImageFiles = mImagesDir.listFiles();
+ // Set the Activity's result to null to begin with
+ setResult(Activity.RESULT_CANCELED, null);
+ /*
+ * Display the file names in the ListView mFileListView.
+ * Back the ListView with the array mImageFilenames, which
+ * you can create by iterating through mImageFiles and
+ * calling File.getAbsolutePath() for each File
+ */
+ ...
+ }
+ ...
+}</pre>
+<h2 id="RespondToRequest">Respond to a File Selection</h2>
+<p>
+ Once a user selects a shared file, your application must determine what file was selected and
+ then generate a content URI for the file. Since the {@link android.app.Activity} displays the
+ list of available files in a {@link android.widget.ListView}, when the user clicks a file name
+ the system calls the method {@link android.widget.AdapterView.OnItemClickListener#onItemClick
+ onItemClick()}, in which you can get the selected file.
+</p>
+<p>
+ In {@link android.widget.AdapterView.OnItemClickListener#onItemClick onItemClick()}, get a
+ {@link java.io.File} object for the file name of the selected file and pass it as an argument to
+ {@link android.support.v4.content.FileProvider#getUriForFile getUriForFile()}, along with the
+ authority that you specified in the
+ <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"
+ >&lt;provider&gt;</a></code> element for the {@link android.support.v4.content.FileProvider}.
+ The resulting content URI contains the authority, a path segment corresponding to the file's
+ directory (as specified in the XML meta-data), and the name of the file including its
+ extension. How {@link android.support.v4.content.FileProvider} maps directories to path
+ segments based on XML meta-data is described in the section
+ <a href="setup-sharing.html#DefineMetaData">Specify Sharable Directories</a>.
+</p>
+<p>
+ The following snippet shows you how to detect the selected file and get a content URI for it:
+</p>
+<pre>
+ protected void onCreate(Bundle savedInstanceState) {
+ ...
+ // Define a listener that responds to clicks on a file in the ListView
+ mFileListView.setOnItemClickListener(
+ new AdapterView.OnItemClickListener() {
+ &#64;Override
+ /*
+ * When a filename in the ListView is clicked, get its
+ * content URI and send it to the requesting app
+ */
+ public void onItemClick(AdapterView&lt;?&gt; adapterView,
+ View view,
+ int position,
+ long rowId) {
+ /*
+ * Get a File for the selected file name.
+ * Assume that the file names are in the
+ * mImageFilename array.
+ */
+ File requestFile = new File(mImageFilename[position]);
+ /*
+ * Most file-related method calls need to be in
+ * try-catch blocks.
+ */
+ // Use the FileProvider to get a content URI
+ try {
+ fileUri = FileProvider.getUriForFile(
+ MainActivity.this,
+ "com.example.myapp.fileprovider",
+ requestFile);
+ } catch (IllegalArgumentException e) {
+ Log.e("File Selector",
+ "The selected file can't be shared: " +
+ clickedFilename);
+ }
+ ...
+ }
+ });
+ ...
+ }</pre>
+<p>
+ Remember that you can only generate content URIs for files that reside in a directory
+ you've specified in the meta-data file that contains the <code>&lt;paths&gt;</code> element, as
+ described in the section <a href="setup-sharing.html#DefineMetaData"
+ >Specify Sharable Directories</a>. If you call
+ {@link android.support.v4.content.FileProvider#getUriForFile getUriForFile()} for a
+ {@link java.io.File} in a path that you haven't specified, you receive an
+ {@link java.lang.IllegalArgumentException}.
+</p>
+<h2 id="GrantPermissions">Grant Permissions for the File</h2>
+<p>
+ Now that you have a content URI for the file you want to share with another app, you need to
+ allow the client app to access the file. To allow access, grant permissions to the client app by
+ adding the content URI to an {@link android.content.Intent} and then setting permission flags on
+ the {@link android.content.Intent}. The permissions you grant are temporary and expire
+ automatically when the receiving app's task stack is finished.
+</p>
+<p>
+ The following code snippet shows you how to set read permission for the file:
+</p>
+<pre>
+ protected void onCreate(Bundle savedInstanceState) {
+ ...
+ // Define a listener that responds to clicks in the ListView
+ mFileListView.setOnItemClickListener(
+ new AdapterView.OnItemClickListener() {
+ &#64;Override
+ public void onItemClick(AdapterView&lt;?&gt; adapterView,
+ View view,
+ int position,
+ long rowId) {
+ ...
+ if (fileUri != null) {
+ // Grant temporary read permission to the content URI
+ mResultIntent.addFlags(
+ Intent.FLAG_GRANT_READ_URI_PERMISSION);
+ }
+ ...
+ }
+ ...
+ });
+ ...
+ }</pre>
+<p class="caution">
+ <strong>Caution:</strong> Calling {@link android.content.Intent#setFlags setFlags()} is the only
+ way to securely grant access to your files using temporary access permissions. Avoid calling
+ {@link android.content.Context#grantUriPermission Context.grantUriPermission()} method for a
+ file's content URI, since this method grants access that you can only revoke by
+ calling {@link android.content.Context#revokeUriPermission Context.revokeUriPermission()}.
+</p>
+<h2 id="ShareFile">Share the File with the Requesting App</h2>
+<p>
+ To share the file with the app that requested it, pass the {@link android.content.Intent}
+ containing the content URI and permissions to {@link android.app.Activity#setResult
+ setResult()}. When the {@link android.app.Activity} you have just defined is finished, the
+ system sends the {@link android.content.Intent} containing the content URI to the client app.
+ The following code snippet shows you how to do this:
+</p>
+<pre>
+ protected void onCreate(Bundle savedInstanceState) {
+ ...
+ // Define a listener that responds to clicks on a file in the ListView
+ mFileListView.setOnItemClickListener(
+ new AdapterView.OnItemClickListener() {
+ &#64;Override
+ public void onItemClick(AdapterView&lt;?&gt; adapterView,
+ View view,
+ int position,
+ long rowId) {
+ ...
+ if (fileUri != null) {
+ ...
+ // Put the Uri and MIME type in the result Intent
+ mResultIntent.setDataAndType(
+ fileUri,
+ getContentResolver().getType(fileUri));
+ // Set the result
+ MainActivity.this.setResult(Activity.RESULT_OK,
+ mResultIntent);
+ } else {
+ mResultIntent.setDataAndType(null, "");
+ MainActivity.this.setResult(RESULT_CANCELED,
+ mResultIntent);
+ }
+ }
+ });</pre>
+<p>
+ Provide users with an way to return immediately to the client app once they have chosen a file.
+ One way to do this is to provide a checkmark or <b>Done</b> button. Associate a method with
+ the button using the button's
+ <code><a href="{@docRoot}reference/android/view/View.html#attr_android:onClick"
+ >android:onClick</a></code> attribute. In the method, call
+ {@link android.app.Activity#finish finish()}. For example:
+</p>
+<pre>
+ public void onDoneClick(View v) {
+ // Associate a method with the Done button
+ finish();
+ }</pre>
diff --git a/docs/html/training/sharing/index.jd b/docs/html/training/sharing/index.jd
index 2aa22b6a0490..06d42fc81887 100644
--- a/docs/html/training/sharing/index.jd
+++ b/docs/html/training/sharing/index.jd
@@ -1,4 +1,4 @@
-page.title=Sharing Content
+page.title=Sharing Simple Data
page.tags="intents","share"
trainingnavtop=true
@@ -20,26 +20,26 @@ Intent Filters</a></li>
</div>
</div>
-
+
<p>One of the great things about Android applications is their ability to communicate and
integrate with each other. Why reinvent functionality that isn't core to your application when it
-already exists in another application?</p>
+already exists in another application?</p>
-<p>This class covers some common ways you can send and receive content between
+<p>This class covers some common ways you can send and receive simple data between
applications using {@link android.content.Intent} APIs and the {@link
android.view.ActionProvider} object.</p>
<h2>Lessons</h2>
-
-<dl>
- <dt><b><a href="send.html">Sending Content to Other Apps</a></b></dt>
+
+<dl>
+ <dt><b><a href="send.html">Sending Simple Data to Other Apps</a></b></dt>
<dd>Learn how to set up your application to be able to send text and binary data to other
-applications with intents.</dd>
-
- <dt><b><a href="receive.html">Receiving Content from Other Apps</a></b></dt>
- <dd>Learn how to set up your application to receive text and binary data from intents.</dd>
-
- <dt><b><a href="shareaction.html">Adding an Easy Share Action</a></b></dt>
- <dd>Learn how to add a "share" action item to your action bar.</dd>
-</dl>
+applications with intents.</dd>
+
+ <dt><b><a href="receive.html">Receiving Simple Data from Other Apps</a></b></dt>
+ <dd>Learn how to set up your application to receive text and binary data from intents.</dd>
+
+ <dt><b><a href="shareaction.html">Adding an Easy Share Action</a></b></dt>
+ <dd>Learn how to add a "share" action item to your action bar.</dd>
+</dl>
diff --git a/docs/html/training/sharing/receive.jd b/docs/html/training/sharing/receive.jd
index 7ec3defc9c4b..8c5f862164b5 100644
--- a/docs/html/training/sharing/receive.jd
+++ b/docs/html/training/sharing/receive.jd
@@ -1,5 +1,5 @@
-page.title=Receiving Content from Other Apps
-parent.title=Sharing Content
+page.title=Receiving Simple Data from Other Apps
+parent.title=Sharing Simple Data
parent.link=index.html
trainingnavtop=true
@@ -30,26 +30,26 @@ Intent Filters</a></li>
</div>
</div>
-<p>Just as your application can send data to other applications, so too can it easily receive data
-from applications. Think about how users interact with your application, and what data types you
-want to receive from other applications. For example, a social networking application would likely
-be interested in receiving text content, like an interesting web URL, from another app. The
+<p>Just as your application can send data to other applications, so too can it easily receive data
+from applications. Think about how users interact with your application, and what data types you
+want to receive from other applications. For example, a social networking application would likely
+be interested in receiving text content, like an interesting web URL, from another app. The
<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.plus">Google+ Android
-application</a>
-accepts both text <em>and</em> single or multiple images. With this app, a user can easily start a
+application</a>
+accepts both text <em>and</em> single or multiple images. With this app, a user can easily start a
new Google+ post with photos from the Android Gallery app.</p>
<h2 id="update-manifest">Update Your Manifest</h2>
-<p>Intent filters inform the system what intents an application component is willing to accept.
-Similar to how you constructed an intent with action {@link android.content.Intent#ACTION_SEND} in
-the <a href="{@docRoot}training/sharing/send.html">Send Content to Other Apps Using Intents</a>
-lesson, you create intent filters in order to be able to receive intents with this action. You
-define an intent filter in your manifest, using the
+<p>Intent filters inform the system what intents an application component is willing to accept.
+Similar to how you constructed an intent with action {@link android.content.Intent#ACTION_SEND} in
+the <a href="{@docRoot}training/sharing/send.html">Sending Simple Data to Other Apps</a>
+lesson, you create intent filters in order to be able to receive intents with this action. You
+define an intent filter in your manifest, using the
<code><a
-href="{@docRoot}guide/components/intents-filters.html#ifs">&lt;intent-filter&gt;</a></code>
-element. For example, if your application handles receiving text content, a single image of any
+href="{@docRoot}guide/components/intents-filters.html#ifs">&lt;intent-filter&gt;</a></code>
+element. For example, if your application handles receiving text content, a single image of any
type, or multiple images of any type, your manifest would look like:</p>
<pre>
@@ -72,24 +72,24 @@ type, or multiple images of any type, your manifest would look like:</p>
&lt;/activity&gt;
</pre>
-<p class="note"><strong>Note:</strong> For more information on intent filters and intent resolution
+<p class="note"><strong>Note:</strong> For more information on intent filters and intent resolution
please read <a href="{@docRoot}guide/components/intents-filters.html#ifs">Intents and Intent
Filters</a></p>
<p>When another application tries to share any of these things by constructing an intent and passing
it to {@link android.content.Context#startActivity(android.content.Intent) startActivity()}, your
-application will be listed as an option in the intent chooser. If the user selects your application,
-the corresponding activity (<code>.ui.MyActivity</code> in the example above) will be started. It
+application will be listed as an option in the intent chooser. If the user selects your application,
+the corresponding activity (<code>.ui.MyActivity</code> in the example above) will be started. It
is then up to you to handle the content appropriately within your code and UI.</p>
<h2 id="handling-content">Handle the Incoming Content</h2>
<p>To handle the content delivered by an {@link android.content.Intent}, start by calling {@link
-android.content.Intent#getIntent(String) getIntent()}
-to get {@link android.content.Intent} object. Once you have the object, you can examine its
-contents to determine what to do next. Keep in mind that if this activity can be started from other
-parts of the system, such as the launcher, then you will need to take this into consideration when
+android.content.Intent#getIntent(String) getIntent()}
+to get {@link android.content.Intent} object. Once you have the object, you can examine its
+contents to determine what to do next. Keep in mind that if this activity can be started from other
+parts of the system, such as the launcher, then you will need to take this into consideration when
examining the intent.</p>
<pre>
@@ -143,7 +143,7 @@ know what some other application may send you. For example, the wrong MIME type
image being sent might be extremely large. Also, remember to process binary data in a separate
thread rather than the main ("UI") thread.</p>
-<p>Updating the UI can be as simple as populating an {@link android.widget.EditText}, or it can
-be more complicated like applying an interesting photo filter to an image. It's really specific
+<p>Updating the UI can be as simple as populating an {@link android.widget.EditText}, or it can
+be more complicated like applying an interesting photo filter to an image. It's really specific
to your application what happens next.</p>
diff --git a/docs/html/training/sharing/send.jd b/docs/html/training/sharing/send.jd
index ed9e12ede4a2..f5da68feb934 100644
--- a/docs/html/training/sharing/send.jd
+++ b/docs/html/training/sharing/send.jd
@@ -1,9 +1,9 @@
-page.title=Sending Content to Other Apps
-parent.title=Sharing Content
+page.title=Sending Simple Data to Other Apps
+parent.title=Sharing Simple Data
parent.link=index.html
trainingnavtop=true
-next.title=Receiving Content from Other Apps
+next.title=Receiving Simple Data from Other Apps
next.link=receive.html
@jd:body
@@ -29,22 +29,22 @@ Intent Filters</a></li>
</div>
</div>
-<p>When you construct an intent, you must specify the action you want the intent to "trigger."
-Android defines several actions, including {@link android.content.Intent#ACTION_SEND} which, as
-you can probably guess, indicates that the intent is sending data from one activity to another,
-even across process boundaries. To send data to another activity, all you need to do is specify
-the data and its type, the system will identify compatible receiving activities and display them
-to the user (if there are multiple options) or immediately start the activity (if there is only
-one option). Similarly, you can advertise the data types that your activities support receiving
+<p>When you construct an intent, you must specify the action you want the intent to "trigger."
+Android defines several actions, including {@link android.content.Intent#ACTION_SEND} which, as
+you can probably guess, indicates that the intent is sending data from one activity to another,
+even across process boundaries. To send data to another activity, all you need to do is specify
+the data and its type, the system will identify compatible receiving activities and display them
+to the user (if there are multiple options) or immediately start the activity (if there is only
+one option). Similarly, you can advertise the data types that your activities support receiving
from other applications by specifying them in your manifest.</p>
-<p>Sending and receiving data between applications with intents is most commonly used for social
-sharing of content. Intents allow users to share information quickly and easily, using their
+<p>Sending and receiving data between applications with intents is most commonly used for social
+sharing of content. Intents allow users to share information quickly and easily, using their
favorite applications.</p>
-<p><strong>Note:</strong> The best way to add a share action item to an
-{@link android.app.ActionBar} is to use {@link android.widget.ShareActionProvider}, which became
-available in API level 14. {@link android.widget.ShareActionProvider} is discussed in the lesson
+<p><strong>Note:</strong> The best way to add a share action item to an
+{@link android.app.ActionBar} is to use {@link android.widget.ShareActionProvider}, which became
+available in API level 14. {@link android.widget.ShareActionProvider} is discussed in the lesson
about <a href="shareaction.html">Adding an Easy Share Action</a>.</p>
@@ -58,10 +58,10 @@ on a handset.
</p>
</div>
-<p>The most straightforward and common use of the {@link android.content.Intent#ACTION_SEND}
-action is sending text content from one activity to another. For example, the built-in Browser
-app can share the URL of the currently-displayed page as text with any application. This is useful
-for sharing an article or website with friends via email or social networking. Here is the code to
+<p>The most straightforward and common use of the {@link android.content.Intent#ACTION_SEND}
+action is sending text content from one activity to another. For example, the built-in Browser
+app can share the URL of the currently-displayed page as text with any application. This is useful
+for sharing an article or website with friends via email or social networking. Here is the code to
implement this type of sharing:</p>
<pre>
@@ -72,12 +72,12 @@ sendIntent.setType(&quot;text/plain&quot;);
startActivity(sendIntent);
</pre>
-<p>If there's an installed application with a filter that matches
-{@link android.content.Intent#ACTION_SEND} and MIME type text/plain, the Android system will run
-it; if more than one application matches, the system displays a disambiguation dialog (a "chooser")
-that allows the user to choose an app. If you call
+<p>If there's an installed application with a filter that matches
+{@link android.content.Intent#ACTION_SEND} and MIME type text/plain, the Android system will run
+it; if more than one application matches, the system displays a disambiguation dialog (a "chooser")
+that allows the user to choose an app. If you call
{@link android.content.Intent#createChooser(android.content.Intent, CharSequence)
-Intent.createChooser()}
+Intent.createChooser()}
for the intent, Android will <strong>always</strong> display the chooser. This has some
advantages:</p>
@@ -100,17 +100,17 @@ startActivity(<strong>Intent.createChooser(sendIntent, getResources().getText(R.
<p>The resulting dialog is shown in figure 1.</p>
-<p>Optionally, you can set some standard extras for the intent:
-{@link android.content.Intent#EXTRA_EMAIL}, {@link android.content.Intent#EXTRA_CC},
-{@link android.content.Intent#EXTRA_BCC}, {@link android.content.Intent#EXTRA_SUBJECT}. However,
-if the receiving application is not designed to use them, nothing will happen. You can use
-custom extras as well, but there's no effect unless the receiving application understands them.
+<p>Optionally, you can set some standard extras for the intent:
+{@link android.content.Intent#EXTRA_EMAIL}, {@link android.content.Intent#EXTRA_CC},
+{@link android.content.Intent#EXTRA_BCC}, {@link android.content.Intent#EXTRA_SUBJECT}. However,
+if the receiving application is not designed to use them, nothing will happen. You can use
+custom extras as well, but there's no effect unless the receiving application understands them.
Typically, you'd use custom extras defined by the receiving application itself.</p>
-<p class="note"><strong>Note:</strong> Some e-mail applications, such as Gmail, expect a
-{@link java.lang.String String[]} for extras like {@link android.content.Intent#EXTRA_EMAIL} and
-{@link android.content.Intent#EXTRA_CC}, use
-{@link android.content.Intent#putExtra(String,String[]) putExtra(String, String[])} to add these
+<p class="note"><strong>Note:</strong> Some e-mail applications, such as Gmail, expect a
+{@link java.lang.String String[]} for extras like {@link android.content.Intent#EXTRA_EMAIL} and
+{@link android.content.Intent#EXTRA_CC}, use
+{@link android.content.Intent#putExtra(String,String[]) putExtra(String, String[])} to add these
to your intent.</p>
diff --git a/docs/html/training/sharing/shareaction.jd b/docs/html/training/sharing/shareaction.jd
index 873f61457b69..ee811dabdc30 100644
--- a/docs/html/training/sharing/shareaction.jd
+++ b/docs/html/training/sharing/shareaction.jd
@@ -3,7 +3,7 @@ parent.title=Sharing Content
parent.link=index.html
trainingnavtop=true
-previous.title=Receiving Content from Other Apps
+previous.title=Receiving Simple Data from Other Apps
previous.link=receive.html
@jd:body
@@ -28,7 +28,7 @@ previous.link=receive.html
</div>
-<p>Implementing an effective and user friendly share action in your {@link android.app.ActionBar}
+<p>Implementing an effective and user friendly share action in your {@link android.app.ActionBar}
is made even easier with the introduction of {@link android.view.ActionProvider} in Android 4.0
(API Level 14). An {@link android.view.ActionProvider}, once attached to a menu item in the action
bar, handles both the appearance and behavior of that item. In the case of {@link
@@ -47,36 +47,48 @@ starting with API Level 14 and higher.</p>
<h2 id="update-menus">Update Menu Declarations</h2>
-<p>To get started with {@link android.widget.ShareActionProvider ShareActionProviders}, define the <code>android:actionProviderClass</code> attribute for the corresponding <code>&lt;item&gt;</code> in your <a href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a> file:</p>
+<p>
+ To get started with {@link android.widget.ShareActionProvider ShareActionProviders},
+ define the <code>android:actionProviderClass</code> attribute for the corresponding
+ <code>&lt;item&gt;</code> in your <a href="{@docRoot}guide/topics/resources/menu-resource.html"
+ >menu resource</a> file:</p>
<pre>
&lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
- &lt;item android:id=&quot;@+id/menu_item_share&quot;
- android:showAsAction=&quot;ifRoom&quot;
- android:title=&quot;Share&quot;
- <strong>android:actionProviderClass=&quot;android.widget.ShareActionProvider&quot;</strong> /&gt;
+ &lt;item
+ android:id=&quot;@+id/menu_item_share&quot;
+ android:showAsAction=&quot;ifRoom&quot;
+ android:title=&quot;Share&quot;
+ <b>android:actionProviderClass=
+ "android.widget.ShareActionProvider"</b> /&gt;
...
&lt;/menu&gt;
</pre>
-<p>This delegates responsibility for the item's appearance and function to
-{@link android.widget.ShareActionProvider}. However, you will need to tell the provider what you
-would like to share.</p>
+<p>
+ This delegates responsibility for the item's appearance and function to
+ {@link android.widget.ShareActionProvider}. However, you will need to tell the provider what you
+ would like to share.
+</p>
<h2 id="set-share-intent">Set the Share Intent</h2>
-<p>In order for {@link android.widget.ShareActionProvider} to function, you must provide it a share
-intent. This share intent should be the same as described in the <a
-href="{@docRoot}training/sharing/send.html">Sending Content to Other Apps</a>
-lesson, with action {@link android.content.Intent#ACTION_SEND} and additional data set via extras
-like {@link android.content.Intent#EXTRA_TEXT} and {@link android.content.Intent#EXTRA_STREAM}. To
-assign a share intent, first find the corresponding {@link android.view.MenuItem} while inflating
-your menu resource in your {@link android.app.Activity} or {@link android.app.Fragment}. Next, call
-{@link android.view.MenuItem#getActionProvider() MenuItem.getActionProvider()} to retreive an
-instance of {@link android.widget.ShareActionProvider}. Use {@link
-android.widget.ShareActionProvider#setShareIntent(android.content.Intent) setShareIntent()} to
-update the share intent associated with that action item. Here's an example:</p>
+<p>
+ In order for {@link android.widget.ShareActionProvider} to function, you must provide it a share
+ intent. This share intent should be the same as described in the
+ <a href="{@docRoot}training/sharing/send.html">Sending Simple Data to Other Apps</a> lesson,
+ with action {@link android.content.Intent#ACTION_SEND} and additional data set via extras
+ like {@link android.content.Intent#EXTRA_TEXT} and {@link android.content.Intent#EXTRA_STREAM}.
+ To assign a share intent, first find the corresponding {@link android.view.MenuItem} while
+ inflating your menu resource in your {@link android.app.Activity} or
+ {@link android.app.Fragment}. Next, call {@link android.view.MenuItem#getActionProvider
+ MenuItem.getActionProvider()} to retrieve an instance of
+ {@link android.widget.ShareActionProvider}. Use
+ {@link android.widget.ShareActionProvider#setShareIntent(android.content.Intent)
+ setShareIntent()} to update the share intent associated with that action item. Here's an
+ example:
+</p>
<pre>
private ShareActionProvider mShareActionProvider;
@@ -105,8 +117,8 @@ private void setShareIntent(Intent shareIntent) {
}
</pre>
-<p>You may only need to set the share intent once during the creation of your menus, or you may
-want to set it and then update it as the UI changes. For example, when you view photos full screen
+<p>You may only need to set the share intent once during the creation of your menus, or you may
+want to set it and then update it as the UI changes. For example, when you view photos full screen
in the Gallery app, the sharing intent changes as you flip between photos.</p>
<p>For further discussion about the {@link android.widget.ShareActionProvider} object, see the <a
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index 27e7004cadba..a66b7731da5d 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -192,33 +192,91 @@ include the action bar on devices running Android 2.1 or higher."
</ul>
</li>
- <li class="nav-section">
+ </ul>
+ </li><!-- end getting started -->
+ <li class="nav-section">
<div class="nav-section-header">
- <a href="<?cs var:toroot ?>training/sharing/index.html"
- description=
- "How to take your app interaction to the next level by sharing
- information with other apps, receive information back, and provide a simple and
- scalable way to perform Share actions with user content."
- >Sharing Content</a>
+ <a href="<?cs var:toroot ?>training/building-content-sharing.html">
+ <span class="small">Building Apps with</span><br/>Content Sharing
+ </a>
</div>
<ul>
- <li><a href="<?cs var:toroot ?>training/sharing/send.html">
- Sending Content to Other Apps
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/sharing/receive.html">
- Receiving Content from Other Apps
- </a>
- </li>
- <li><a href="<?cs var:toroot ?>training/sharing/shareaction.html">
- Adding an Easy Share Action
- </a>
- </li>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/sharing/index.html"
+ description=
+ "How to take your app interaction to the next level by sharing
+ information with other apps, receive information back, and provide a simple and
+ scalable way to perform Share actions with user content."
+ >Sharing Simple Data</a>
+ </div>
+ <ul>
+ <li>
+ <a href="<?cs var:toroot ?>training/sharing/send.html">
+ Sending Simple Data to Other Apps
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/sharing/receive.html">
+ Receiving Simple Data from Other Apps
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/sharing/shareaction.html">
+ Adding an Easy Share Action
+ </a>
+ </li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot?>training/secure-file-sharing/index.html"
+ description=
+ "How to provide secure access to a file associated with your app using a content
+ URI and temporary access permissions."
+ >Sharing Files</a>
+ </div>
+ <ul>
+ <li>
+ <a href="<?cs var:toroot ?>training/secure-file-sharing/setup-sharing.html">
+ Setting Up File Sharing
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/secure-file-sharing/share-file.html">
+ Sharing a File
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/secure-file-sharing/request-file.html">
+ Requesting a Shared File
+ </a>
+ </li>
+ <li>
+ <a href="<?cs var:toroot ?>training/secure-file-sharing/retrieve-info.html">
+ Retrieving File Information
+ </a>
+ </li>
+ </ul>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>training/beam-files/index.html"
+ description=
+ "How to transfer files between devices using the NFC Android Beam feature."
+ >Sharing Files with NFC</a>
+ </div>
+ <ul>
+ <li>
+ <a href="<?cs var:toroot ?>training/beam-files/send-files.html"
+ >Sending Files to Another Device</a>
+ </li>
+ <li><a href="<?cs var:toroot ?>training/beam-files/receive-files.html"
+ >Receiving Files from Another Device</a></li>
+ </ul>
+ </li>
</ul>
- </li>
- </ul>
- </li><!-- end getting started -->
-
+ </li>
@@ -423,22 +481,6 @@ include the action bar on devices running Android 2.1 or higher."
</li>
</ul>
</li>
- <li class="nav-section">
- <div class="nav-section-header">
- <a href="<?cs var:toroot ?>training/beam-files/index.html"
- description=
- "How to transfer files between devices using the NFC Android Beam feature."
- >Sharing Files with NFC</a>
- </div>
- <ul>
- <li>
- <a href="<?cs var:toroot ?>training/beam-files/send-files.html"
- >Sending Files to Another Device</a>
- </li>
- <li><a href="<?cs var:toroot ?>training/beam-files/receive-files.html"
- >Receiving Files from Another Device</a></li>
- </ul>
- </li>
<li class="nav-section">
<div class="nav-section-header">
<a href="<?cs var:toroot ?>training/basics/network-ops/index.html"
diff --git a/graphics/java/android/graphics/ImageFormat.java b/graphics/java/android/graphics/ImageFormat.java
index e08ed50b03b8..1bcfc18d22bf 100644
--- a/graphics/java/android/graphics/ImageFormat.java
+++ b/graphics/java/android/graphics/ImageFormat.java
@@ -187,10 +187,6 @@ public class ImageFormat {
* == {@link android.media.Image.Plane#getPixelStride() vPlane.getPixelStride()};
* ).</p>
*
- * <p>For example, the {@link android.media.Image} object can provide data
- * in this format from a {@link android.hardware.camera2.CameraDevice}
- * through a {@link android.media.ImageReader} object.</p>
- *
* @see android.media.Image
* @see android.media.ImageReader
* @see android.hardware.camera2.CameraDevice
@@ -207,6 +203,8 @@ public class ImageFormat {
* needed information to interpret a raw sensor image must be queried from
* the {@link android.hardware.camera2.CameraDevice} which produced the
* image.</p>
+ *
+ * @hide
*/
public static final int RAW_SENSOR = 0x20;
diff --git a/media/java/android/media/Image.java b/media/java/android/media/Image.java
index a346e176984e..23abce761e27 100644
--- a/media/java/android/media/Image.java
+++ b/media/java/android/media/Image.java
@@ -21,8 +21,7 @@ import java.lang.AutoCloseable;
/**
* <p>A single complete image buffer to use with a media source such as a
- * {@link MediaCodec} or a
- * {@link android.hardware.camera2.CameraDevice CameraDevice}.</p>
+ * {@link MediaCodec}.</p>
*
* <p>This class allows for efficient direct application access to the pixel
* data of the Image through one or more
@@ -83,15 +82,6 @@ public abstract class Image implements AutoCloseable {
* plane (4:2:0 subsampling). Each pixel sample in each plane has 8 bits.
* Each plane has its own row stride and pixel stride.</td>
* </tr>
- * <tr>
- * <td>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</td>
- * <td>1</td>
- * <td>A single plane of raw sensor image data, with 16 bits per color
- * sample. The details of the layout need to be queried from the source of
- * the raw sensor data, such as
- * {@link android.hardware.camera2.CameraDevice CameraDevice}.
- * </td>
- * </tr>
* </table>
*
* @see android.graphics.ImageFormat
diff --git a/media/java/android/media/ImageReader.java b/media/java/android/media/ImageReader.java
index 1bd32c4c976c..d454c42fced8 100644
--- a/media/java/android/media/ImageReader.java
+++ b/media/java/android/media/ImageReader.java
@@ -32,8 +32,7 @@ import java.nio.ByteOrder;
* rendered into a {@link android.view.Surface}</p>
*
* <p>Several Android media API classes accept Surface objects as targets to
- * render to, including {@link MediaPlayer}, {@link MediaCodec},
- * {@link android.hardware.camera2.CameraDevice}, and
+ * render to, including {@link MediaPlayer}, {@link MediaCodec}, and
* {@link android.renderscript.Allocation RenderScript Allocations}. The image
* sizes and formats that can be used with each source vary, and should be
* checked in the documentation for the specific API.</p>
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
index ca4892dee32f..b7720ef76f16 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
@@ -511,7 +511,7 @@ public class KeyguardTransportControlView extends FrameLayout {
if ((flags & flag) != 0) {
view.setVisibility(View.VISIBLE);
} else {
- view.setVisibility(View.GONE);
+ view.setVisibility(View.INVISIBLE);
}
}
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 525b7e12e196..d1c313a15f45 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -2628,10 +2628,10 @@ final class ActivityStack {
if (task != null && task.removeActivity(r)) {
if (DEBUG_STACK) Slog.i(TAG,
"removeActivityFromHistoryLocked: last activity removed from " + this);
- mStackSupervisor.removeTask(task);
- if (task.mOnTopOfHome) {
+ if (task == topTask() && task.mOnTopOfHome) {
mStackSupervisor.moveHomeToTop();
}
+ mStackSupervisor.removeTask(task);
}
r.takeFromHistory();
removeTimeoutsForActivityLocked(r);
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 821676987131..b2b01646dc7d 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -1855,10 +1855,10 @@ public class WindowManagerService extends IWindowManager.Stub
// Now stick it in.
if (DEBUG_WALLPAPER_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) {
Slog.v(TAG, "Moving wallpaper " + wallpaper
- + " from " + oldIndex + " to " + 0);
+ + " from " + oldIndex + " to " + foundI);
}
- windows.add(0, wallpaper);
+ windows.add(foundI, wallpaper);
mWindowsChanged = true;
changed |= ADJUST_WALLPAPER_LAYERS_CHANGED;
}
@@ -4671,13 +4671,6 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
}
- // Never put an app window underneath wallpaper.
- for (int pos = NW - 1; pos >= 0; pos--) {
- if (windows.get(pos).mIsWallpaper) {
- if (DEBUG_REORDER) Slog.v(TAG, "Found wallpaper @" + pos);
- return pos + 1;
- }
- }
return 0;
}