Merge "If the panels are disabled, don't go opaque on interaction." into klp-dev
diff --git a/api/current.txt b/api/current.txt
index dc21e90..68a4f50 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5974,7 +5974,6 @@
     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 @@
     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.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 50401bd..fe079bc 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -2371,6 +2371,7 @@
      *
      * @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 9f6c2a9..c619984 100644
--- a/core/java/android/hardware/camera2/package.html
+++ b/core/java/android/hardware/camera2/package.html
@@ -80,5 +80,7 @@
 asynchronously relative to the output CaptureResult, sometimes
 substantially later.</p>
 
+{@hide}
+
 </BODY>
 </HTML>
diff --git a/core/java/android/print/PrintDocumentInfo.java b/core/java/android/print/PrintDocumentInfo.java
index f094962..b721ef4 100644
--- a/core/java/android/print/PrintDocumentInfo.java
+++ b/core/java/android/print/PrintDocumentInfo.java
@@ -193,7 +193,7 @@
         builder.append("name=").append(mName);
         builder.append(", pageCount=").append(mPageCount);
         builder.append(", contentType=").append(contentTyepToString(mContentType));
-        builder.append(", size=").append(mDataSize);
+        builder.append(", dataSize=").append(mDataSize);
         builder.append("}");
         return builder.toString();
     }
diff --git a/core/java/android/print/PrintJobInfo.java b/core/java/android/print/PrintJobInfo.java
index 4693556..9f935c8 100644
--- a/core/java/android/print/PrintJobInfo.java
+++ b/core/java/android/print/PrintJobInfo.java
@@ -48,6 +48,14 @@
     public static final int STATE_ANY_ACTIVE = -3;
 
     /**
+     * Constant for matching any scheduled, i.e. delivered to a print
+     * service, print job state.
+     *
+     * @hide
+     */
+    public static final int STATE_ANY_SCHEDULED = -4;
+
+    /**
      * Print job state: The print job is being created but not yet
      * ready to be printed.
      * <p>
@@ -123,7 +131,7 @@
     /** The name of the printer - internally used */
     private String mPrinterName;
 
-    /** The status of the print job. */
+    /** The state of the print job. */
     private int mState;
 
     /** The id of the app that created the job. */
@@ -547,7 +555,7 @@
         builder.append("PrintJobInfo{");
         builder.append("label: ").append(mLabel);
         builder.append(", id: ").append(mId);
-        builder.append(", status: ").append(stateToString(mState));
+        builder.append(", state: ").append(stateToString(mState));
         builder.append(", printer: " + mPrinterId);
         builder.append(", tag: ").append(mTag);
         builder.append(", creationTime: " + mCreationTime);
@@ -575,6 +583,9 @@
             case STATE_STARTED: {
                 return "STATE_STARTED";
             }
+            case STATE_BLOCKED: {
+                return "STATE_BLOCKED";
+            }
             case STATE_FAILED: {
                 return "STATE_FAILED";
             }
diff --git a/core/java/android/print/PrintManager.java b/core/java/android/print/PrintManager.java
index 1233da2..dbd8278 100644
--- a/core/java/android/print/PrintManager.java
+++ b/core/java/android/print/PrintManager.java
@@ -146,11 +146,14 @@
                 switch (message.what) {
                     case MSG_NOTIFY_PRINT_JOB_STATE_CHANGED: {
                         SomeArgs args = (SomeArgs) message.obj;
-                        PrintJobStateChangeListener listener =
-                                (PrintJobStateChangeListener) args.arg1;
-                        PrintJobId printJobId = (PrintJobId) args.arg2;
+                        PrintJobStateChangeListenerWrapper wrapper =
+                                (PrintJobStateChangeListenerWrapper) args.arg1;
+                        PrintJobStateChangeListener listener = wrapper.getListener();
+                        if (listener != null) {
+                            PrintJobId printJobId = (PrintJobId) args.arg2;
+                            listener.onPrintJobStateChanged(printJobId);
+                        }
                         args.recycle();
-                        listener.onPrintJobStateChanged(printJobId);
                     } break;
                 }
             }
@@ -217,6 +220,7 @@
         if (mPrintJobStateChangeListeners.isEmpty()) {
             mPrintJobStateChangeListeners = null;
         }
+        wrappedListener.destroy();
         try {
             mService.removePrintJobStateChangeListener(wrappedListener, mUserId);
         } catch (RemoteException re) {
@@ -769,12 +773,19 @@
             PrintJobStateChangeListener listener = mWeakListener.get();
             if (handler != null && listener != null) {
                 SomeArgs args = SomeArgs.obtain();
-                args.arg1 = listener;
+                args.arg1 = this;
                 args.arg2 = printJobId;
                 handler.obtainMessage(MSG_NOTIFY_PRINT_JOB_STATE_CHANGED,
                         args).sendToTarget();
             }
         }
-    }
 
+        public void destroy() {
+            mWeakListener.clear();
+        }
+
+        public PrintJobStateChangeListener getListener() {
+            return mWeakListener.get();
+        }
+    }
 }
diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java
index a70bcdb..01a848f 100644
--- a/core/java/android/widget/FastScroller.java
+++ b/core/java/android/widget/FastScroller.java
@@ -42,7 +42,6 @@
 import android.view.ViewGroup.LayoutParams;
 import android.view.ViewGroupOverlay;
 import android.widget.AbsListView.OnScrollListener;
-
 import com.android.internal.R;
 
 /**
@@ -1381,7 +1380,10 @@
     }
 
     private boolean isPointInsideY(float y) {
-        return y >= mThumbImage.getTop() && y <= mThumbImage.getBottom();
+        final float offset = mThumbImage.getTranslationY();
+        final float top = mThumbImage.getTop() + offset;
+        final float bottom = mThumbImage.getBottom() + offset;
+        return y >= top && y <= bottom;
     }
 
     /**
diff --git a/core/java/com/android/internal/app/PlatLogoActivity.java b/core/java/com/android/internal/app/PlatLogoActivity.java
index 43bd735..40a705c 100644
--- a/core/java/com/android/internal/app/PlatLogoActivity.java
+++ b/core/java/com/android/internal/app/PlatLogoActivity.java
@@ -79,7 +79,7 @@
         letter.setTextSize(300);
         letter.setTextColor(0xFFFFFFFF);
         letter.setGravity(Gravity.CENTER);
-        letter.setText(String.valueOf(Build.VERSION.RELEASE).substring(0, 1));
+        letter.setText(String.valueOf(Build.ID).substring(0, 1));
 
         final int p = (int)(4 * metrics.density);
 
diff --git a/core/res/res/drawable-hdpi/cling_arrow_up.png b/core/res/res/drawable-hdpi/cling_arrow_up.png
new file mode 100644
index 0000000..8ef2050
--- /dev/null
+++ b/core/res/res/drawable-hdpi/cling_arrow_up.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/cling_bg.9.png b/core/res/res/drawable-hdpi/cling_bg.9.png
new file mode 100644
index 0000000..36fbfc8
--- /dev/null
+++ b/core/res/res/drawable-hdpi/cling_bg.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/cling_button_normal.9.png b/core/res/res/drawable-hdpi/cling_button_normal.9.png
new file mode 100644
index 0000000..e308382
--- /dev/null
+++ b/core/res/res/drawable-hdpi/cling_button_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/cling_button_pressed.9.png b/core/res/res/drawable-hdpi/cling_button_pressed.9.png
new file mode 100644
index 0000000..4f9ca6f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/stat_sys_adb_am.png b/core/res/res/drawable-hdpi/stat_sys_adb_am.png
index 382557e..dad614c 100644
--- a/core/res/res/drawable-hdpi/stat_sys_adb_am.png
+++ b/core/res/res/drawable-hdpi/stat_sys_adb_am.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/cling_arrow_up.png b/core/res/res/drawable-mdpi/cling_arrow_up.png
new file mode 100644
index 0000000..ee6c378
--- /dev/null
+++ b/core/res/res/drawable-mdpi/cling_arrow_up.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/cling_bg.9.png b/core/res/res/drawable-mdpi/cling_bg.9.png
new file mode 100644
index 0000000..4c0f139
--- /dev/null
+++ b/core/res/res/drawable-mdpi/cling_bg.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/cling_button_normal.9.png b/core/res/res/drawable-mdpi/cling_button_normal.9.png
new file mode 100644
index 0000000..a0b6f97
--- /dev/null
+++ b/core/res/res/drawable-mdpi/cling_button_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/cling_button_pressed.9.png b/core/res/res/drawable-mdpi/cling_button_pressed.9.png
new file mode 100644
index 0000000..986e669
--- /dev/null
+++ b/core/res/res/drawable-mdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/stat_sys_adb_am.png b/core/res/res/drawable-mdpi/stat_sys_adb_am.png
index 4380035..5482f34 100644
--- a/core/res/res/drawable-mdpi/stat_sys_adb_am.png
+++ b/core/res/res/drawable-mdpi/stat_sys_adb_am.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/cling_arrow_up.png b/core/res/res/drawable-xhdpi/cling_arrow_up.png
new file mode 100644
index 0000000..2803155
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/cling_arrow_up.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/cling_bg.9.png b/core/res/res/drawable-xhdpi/cling_bg.9.png
new file mode 100644
index 0000000..1cb4681
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/cling_bg.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/cling_button_normal.9.png b/core/res/res/drawable-xhdpi/cling_button_normal.9.png
new file mode 100644
index 0000000..4192563
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/cling_button_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/cling_button_pressed.9.png b/core/res/res/drawable-xhdpi/cling_button_pressed.9.png
new file mode 100644
index 0000000..d3ce469
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/stat_sys_adb_am.png b/core/res/res/drawable-xhdpi/stat_sys_adb_am.png
index 3222a76..e53f498 100644
--- a/core/res/res/drawable-xhdpi/stat_sys_adb_am.png
+++ b/core/res/res/drawable-xhdpi/stat_sys_adb_am.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/cling_arrow_up.png b/core/res/res/drawable-xxhdpi/cling_arrow_up.png
new file mode 100644
index 0000000..1983f13
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/cling_arrow_up.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/cling_bg.9.png b/core/res/res/drawable-xxhdpi/cling_bg.9.png
new file mode 100644
index 0000000..7beae03
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/cling_bg.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/cling_button_normal.9.png b/core/res/res/drawable-xxhdpi/cling_button_normal.9.png
new file mode 100644
index 0000000..e412876
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/cling_button_normal.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/cling_button_pressed.9.png b/core/res/res/drawable-xxhdpi/cling_button_pressed.9.png
new file mode 100644
index 0000000..55e89da
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/stat_sys_adb_am.png b/core/res/res/drawable-xxhdpi/stat_sys_adb_am.png
index e01ad386..d6018dd 100644
--- a/core/res/res/drawable-xxhdpi/stat_sys_adb_am.png
+++ b/core/res/res/drawable-xxhdpi/stat_sys_adb_am.png
Binary files differ
diff --git a/core/res/res/drawable/cling_button.xml b/core/res/res/drawable/cling_button.xml
new file mode 100644
index 0000000..9ce191c
--- /dev/null
+++ b/core/res/res/drawable/cling_button.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true"
+          android:drawable="@drawable/cling_button_pressed" />
+    <item
+          android:drawable="@drawable/cling_button_normal" />
+</selector>
diff --git a/core/res/res/layout/transient_navigation_cling.xml b/core/res/res/layout/transient_navigation_cling.xml
new file mode 100644
index 0000000..d33d965
--- /dev/null
+++ b/core/res/res/layout/transient_navigation_cling.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:padding="12dp"
+    >
+    <LinearLayout
+        android:id="@+id/text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:layout_marginTop="4dp"
+        android:padding="1dp"
+        >
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:src="@drawable/cling_arrow_up"
+            />
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/cling_bg"
+            android:paddingLeft="14dp"
+            android:paddingRight="14dp"
+            android:paddingTop="24dp"
+            android:paddingBottom="24dp">
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/transient_navigation_confirmation"
+                android:textColor="#80000000"
+                android:textSize="16sp"
+                />
+        </FrameLayout>
+    </LinearLayout>
+
+    <Button
+        android:id="@+id/ok"
+        android:layout_width="160sp"
+        android:layout_height="wrap_content"
+        android:layout_gravity="right"
+        android:layout_marginTop="18dp"
+        android:gravity="center"
+        android:text="@string/ok"
+        android:background="@drawable/cling_button"
+        />
+
+</LinearLayout>
+
+
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index d57c232..92a6e52 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -4486,7 +4486,7 @@
     <!-- PIN entry dialog tells the user to not enter a PIN for a while. [CHAR LIMIT=none] -->
     <string name="restr_pin_try_later">Try again later</string>
 
-    <!-- Toast bar message when hiding the transient navigation bar [CHAR LIMIT=45] -->
-    <string name="transient_navigation_confirmation">Swipe down from the top to exit full screen</string>
+    <!-- Cling help message when hiding the transient navigation bar [CHAR LIMIT=none] -->
+    <string name="transient_navigation_confirmation">Swipe down from the top to exit full screen.</string>
 
 </resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index cc1cfd3..675fe21 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1094,6 +1094,9 @@
   <java-symbol type="drawable" name="notification_template_icon_low_bg" />
   <java-symbol type="drawable" name="ic_media_route_on_holo_dark" />
   <java-symbol type="drawable" name="ic_media_route_disabled_holo_dark" />
+  <java-symbol type="drawable" name="cling_button" />
+  <java-symbol type="drawable" name="cling_arrow_up" />
+  <java-symbol type="drawable" name="cling_bg" />
 
   <java-symbol type="layout" name="action_bar_home" />
   <java-symbol type="layout" name="action_bar_title_item" />
@@ -1197,6 +1200,7 @@
   <java-symbol type="layout" name="app_not_authorized" />
   <java-symbol type="layout" name="restrictions_pin_challenge" />
   <java-symbol type="layout" name="restrictions_pin_setup" />
+  <java-symbol type="layout" name="transient_navigation_cling" />
 
   <java-symbol type="anim" name="slide_in_child_bottom" />
   <java-symbol type="anim" name="slide_in_right" />
diff --git a/docs/html/training/basics/intents/filters.jd b/docs/html/training/basics/intents/filters.jd
index 0090c98..9b6a111 100644
--- a/docs/html/training/basics/intents/filters.jd
+++ b/docs/html/training/basics/intents/filters.jd
@@ -20,7 +20,8 @@
 
 <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 @@
 
 <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 8876a33..59ba11f 100644
--- a/docs/html/training/basics/intents/index.jd
+++ b/docs/html/training/basics/intents/index.jd
@@ -19,7 +19,8 @@
 
 <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 @@
 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 @@
   <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 24ecc46..64fbb8b 100644
--- a/docs/html/training/basics/intents/result.jd
+++ b/docs/html/training/basics/intents/result.jd
@@ -21,7 +21,8 @@
 
 <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 @@
 
 <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 aba3896..79c017b 100644
--- a/docs/html/training/basics/intents/sending.jd
+++ b/docs/html/training/basics/intents/sending.jd
@@ -22,7 +22,7 @@
 
 <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 @@
 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 0000000..52298c3
--- /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 0000000..19a1042
--- /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 0000000..116701d
--- /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 0000000..4a2b7d8
--- /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 0000000..d1ab993
--- /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 0000000..6c52770
--- /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 2aa22b6..06d42fc 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 @@
 </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> 
-    <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> 
+<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 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 7ec3def..8c5f862 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 @@
 </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 @@
 &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 @@
 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 ed9e12e..f5da68f 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 @@
 </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 @@
 </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 @@
 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 @@
 
 <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 873f6145..ee811da 100644
--- a/docs/html/training/sharing/shareaction.jd
+++ b/docs/html/training/sharing/shareaction.jd
@@ -3,7 +3,7 @@
 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 @@
 </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 @@
 
 <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 @@
 }
 </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 27e7004..a66b773 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -192,33 +192,91 @@
         </ul>
       </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 Content</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>
-        </ul>
-      </li>
     </ul>
   </li><!-- end getting started -->
-
+    <li class="nav-section">
+        <div class="nav-section-header">
+            <a href="<?cs var:toroot ?>training/building-content-sharing.html">
+            <span class="small">Building Apps with</span><br/>Content Sharing
+            </a>
+        </div>
+        <ul>
+            <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>
 
 
 
@@ -423,22 +481,6 @@
           </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 e08ed50..1bcfc18 100644
--- a/graphics/java/android/graphics/ImageFormat.java
+++ b/graphics/java/android/graphics/ImageFormat.java
@@ -187,10 +187,6 @@
      * == {@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 @@
      * 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 a346e17..23abce7 100644
--- a/media/java/android/media/Image.java
+++ b/media/java/android/media/Image.java
@@ -21,8 +21,7 @@
 
 /**
  * <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 @@
      *     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 1bd32c4..d454c42 100644
--- a/media/java/android/media/ImageReader.java
+++ b/media/java/android/media/ImageReader.java
@@ -32,8 +32,7 @@
  * 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/FusedLocation/src/com/android/location/fused/FusionEngine.java b/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
index 4ba6c34..7cee066 100644
--- a/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
+++ b/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
@@ -131,14 +131,16 @@
     private void enableProvider(String name, long minTime) {
         ProviderStats stats = mStats.get(name);
 
-        if (!stats.requested) {
-            stats.requestTime = SystemClock.elapsedRealtime();
-            stats.requested = true;
-            stats.minTime = minTime;
-            mLocationManager.requestLocationUpdates(name, minTime, 0, this, mLooper);
-        } else if (stats.minTime != minTime) {
-            stats.minTime = minTime;
-            mLocationManager.requestLocationUpdates(name, minTime, 0, this, mLooper);
+        if (stats.available) {
+            if (!stats.requested) {
+                stats.requestTime = SystemClock.elapsedRealtime();
+                stats.requested = true;
+                stats.minTime = minTime;
+                mLocationManager.requestLocationUpdates(name, minTime, 0, this, mLooper);
+            } else if (stats.minTime != minTime) {
+                stats.minTime = minTime;
+                mLocationManager.requestLocationUpdates(name, minTime, 0, this, mLooper);
+            }
         }
     }
 
diff --git a/packages/Keyguard/res/layout/keyguard_transport_control_view.xml b/packages/Keyguard/res/layout/keyguard_transport_control_view.xml
index a0b59a7..da82e40 100644
--- a/packages/Keyguard/res/layout/keyguard_transport_control_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_transport_control_view.xml
@@ -94,67 +94,12 @@
                     android:textAppearance="?android:attr/textAppearanceSmall"
                     android:textSize="12dp" />
             </RelativeLayout>
-            <LinearLayout
-                android:id="@+id/transient_rating"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center"
-                android:visibility="invisible">
-                <RatingBar
-                    android:id="@+id/transient_rating_bar_stars"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
-                <LinearLayout
-                    android:id="@+id/transient_rating_thumbs"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
-                    <FrameLayout
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_weight="1">
-                        <ImageButton
-                            android:id="@+id/btn_thumbs_up"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_gravity="center"
-                            android:src="@drawable/ic_media_previous"
-                            android:background="?android:attr/selectableItemBackground"
-                            android:minWidth="48dp"
-                            android:minHeight="48dp"
-                            android:contentDescription="@string/keyguard_accessibility_transport_thumbs_up_description"/>
-                    </FrameLayout>
-                    <FrameLayout
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_weight="1">
-                        <ImageButton
-                            android:id="@+id/btn_thumbs_down"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_gravity="center"
-                            android:src="@drawable/ic_media_next"
-                            android:background="?android:attr/selectableItemBackground"
-                            android:minWidth="48dp"
-                            android:minHeight="48dp"
-                            android:contentDescription="@string/keyguard_accessibility_transport_thumbs_down_description"/>
-                    </FrameLayout>
-                </LinearLayout>
-                <ToggleButton
-                    android:id="@+id/transient_rating_heart"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:visibility="invisible"
-                    android:minWidth="48dp"
-                    android:minHeight="48dp"
-                    android:contentDescription="@string/keyguard_accessibility_transport_heart_description" />
-            </LinearLayout>
         </FrameLayout>
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:layout_marginTop="5dip">
+            android:layout_marginTop="4dp"
+            android:orientation="horizontal">
             <FrameLayout
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
diff --git a/packages/Keyguard/res/values-sw720dp/dimens.xml b/packages/Keyguard/res/values-sw720dp/dimens.xml
index 0790b79..4853a7b 100644
--- a/packages/Keyguard/res/values-sw720dp/dimens.xml
+++ b/packages/Keyguard/res/values-sw720dp/dimens.xml
@@ -60,4 +60,8 @@
 
     <!-- Height of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
     <dimen name="keyguard_security_height">420dp</dimen>
+
+    <!-- Default clock parameters -->
+    <dimen name="widget_label_font_size">19dp</dimen>
+
 </resources>
diff --git a/packages/Keyguard/res/values/dimens.xml b/packages/Keyguard/res/values/dimens.xml
index 8039b09..a1ad120 100644
--- a/packages/Keyguard/res/values/dimens.xml
+++ b/packages/Keyguard/res/values/dimens.xml
@@ -149,11 +149,11 @@
     used on tablets; on phones, this size is determined by the space left by the
     security mode. -->
     <dimen name="kg_small_widget_height">160dp</dimen>
-    
+
     <!-- Default clock parameters -->
     <dimen name="bottom_text_spacing_digital">-8dp</dimen>
     <dimen name="label_font_size">14dp</dimen>
-    <dimen name="widget_label_font_size">12dp</dimen>
+    <dimen name="widget_label_font_size">14dp</dimen>
     <dimen name="widget_big_font_size">80dp</dimen>
     <dimen name="big_font_size">120dp</dimen>
 
diff --git a/packages/Keyguard/res/values/styles.xml b/packages/Keyguard/res/values/styles.xml
index 9fd8f31..d4f98af 100644
--- a/packages/Keyguard/res/values/styles.xml
+++ b/packages/Keyguard/res/values/styles.xml
@@ -52,13 +52,13 @@
         <item name="android:windowEnterAnimation">@anim/lock_screen_enter</item>
         <item name="android:windowExitAnimation">@anim/lock_screen_exit</item>
     </style>
-    
+
     <!-- Built-in clock widget stuff -->
     <style name="widget_label">
         <item name="android:textStyle">bold</item>
         <item name="android:textAllCaps">true</item>
         <item name="android:fontFamily">sans-serif-condensed</item>
-        <item name="android:textSize">@dimen/kg_status_line_font_size</item>
+        <item name="android:textSize">@dimen/widget_label_font_size</item>
     </style>
     <style name="big_thin">
         <item name="android:textSize">@dimen/big_font_size</item>
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
index ca4892d..b7720ef 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
@@ -511,7 +511,7 @@
         if ((flags & flag) != 0) {
             view.setVisibility(View.VISIBLE);
         } else {
-            view.setVisibility(View.GONE);
+            view.setVisibility(View.INVISIBLE);
         }
     }
 
diff --git a/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java b/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
index 8aa290c..0601467 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/FusedPrintersProvider.java
@@ -254,6 +254,9 @@
         if (isStarted() && mDiscoverySession != null
                 && mDiscoverySession.isPrinterDiscoveryStarted()) {
             if (mTrackedPrinter != null) {
+                if (mTrackedPrinter.equals(printerId)) {
+                    return;
+                }
                 mDiscoverySession.stopPrinterStateTracking(mTrackedPrinter);
             }
             mTrackedPrinter = printerId;
diff --git a/packages/PrintSpooler/src/com/android/printspooler/NotificationController.java b/packages/PrintSpooler/src/com/android/printspooler/NotificationController.java
index 4aa8686..968a8bf 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/NotificationController.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/NotificationController.java
@@ -189,7 +189,7 @@
             if (i == printJobCount - 1) {
                 builder.setLargeIcon(((BitmapDrawable) mContext.getResources().getDrawable(
                         computeNotificationIcon(printJob))).getBitmap());
-                builder.setSmallIcon(com.android.internal.R.drawable.ic_print);
+                builder.setSmallIcon(computeNotificationIcon(printJob));
                 builder.setContentTitle(computeNotificationTitle(printJob));
                 builder.setContentText(printJob.getPrinterName());
             }
diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
index 135bc03..22a9950 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java
@@ -760,6 +760,7 @@
                         public void run() {
                             mEditor.initialize();
                             mEditor.bindUi();
+                            mEditor.reselectCurrentPrinter();
                             mEditor.updateUi();
                         }
                     });
diff --git a/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java b/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java
index a4d557f..636e245 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/PrintSpoolerService.java
@@ -268,7 +268,9 @@
                         || (state == PrintJobInfo.STATE_ANY_VISIBLE_TO_CLIENTS
                             && isStateVisibleToUser(printJob.getState()))
                         || (state == PrintJobInfo.STATE_ANY_ACTIVE
-                            && isActiveState(printJob.getState()));
+                            && isActiveState(printJob.getState()))
+                        || (state == PrintJobInfo.STATE_ANY_SCHEDULED
+                            && isScheduledState(printJob.getState()));
                 if (sameComponent && sameAppId && sameState) {
                     if (foundPrintJobs == null) {
                         foundPrintJobs = new ArrayList<PrintJobInfo>();
@@ -554,6 +556,12 @@
                 || printJobState == PrintJobInfo.STATE_QUEUED);
     }
 
+    private boolean isScheduledState(int printJobState) {
+        return printJobState == PrintJobInfo.STATE_QUEUED
+                || printJobState == PrintJobInfo.STATE_STARTED
+                || printJobState == PrintJobInfo.STATE_BLOCKED;
+    }
+
     private boolean isActiveState(int printJobState) {
         return printJobState == PrintJobInfo.STATE_CREATED
                 || printJobState == PrintJobInfo.STATE_QUEUED
@@ -722,6 +730,7 @@
         private static final String ATTR_NAME = "name";
         private static final String ATTR_PAGE_COUNT = "pageCount";
         private static final String ATTR_CONTENT_TYPE = "contentType";
+        private static final String ATTR_DATA_SIZE = "dataSize";
 
         private final AtomicFile mStatePersistFile;
 
@@ -885,6 +894,8 @@
                                 documentInfo.getContentType()));
                         serializer.attribute(null, ATTR_PAGE_COUNT, String.valueOf(
                                 documentInfo.getPageCount()));
+                        serializer.attribute(null, ATTR_DATA_SIZE, String.valueOf(
+                                documentInfo.getDataSize()));
                         serializer.endTag(null, TAG_DOCUMENT_INFO);
                     }
 
@@ -1103,10 +1114,13 @@
                         ATTR_PAGE_COUNT));
                 final int contentType = Integer.parseInt(parser.getAttributeValue(null,
                         ATTR_CONTENT_TYPE));
+                final int dataSize = Integer.parseInt(parser.getAttributeValue(null,
+                        ATTR_DATA_SIZE));
                 PrintDocumentInfo info = new PrintDocumentInfo.Builder(name)
                         .setPageCount(pageCount)
                         .setContentType(contentType).build();
                 printJob.setDocumentInfo(info);
+                info.setDataSize(dataSize);
                 parser.next();
                 skipEmptyTextTags(parser);
                 expect(parser, XmlPullParser.END_TAG, TAG_DOCUMENT_INFO);
diff --git a/policy/src/com/android/internal/policy/impl/TransientNavigationConfirmation.java b/policy/src/com/android/internal/policy/impl/TransientNavigationConfirmation.java
index 8613088..a6381a7 100644
--- a/policy/src/com/android/internal/policy/impl/TransientNavigationConfirmation.java
+++ b/policy/src/com/android/internal/policy/impl/TransientNavigationConfirmation.java
@@ -16,18 +16,31 @@
 
 package com.android.internal.policy.impl;
 
+import android.animation.Animator;
+import android.animation.ArgbEvaluator;
+import android.animation.ValueAnimator;
+import android.app.ActivityManager;
 import android.content.Context;
+import android.graphics.PixelFormat;
+import android.graphics.drawable.ColorDrawable;
 import android.os.Handler;
 import android.os.Message;
 import android.os.UserHandle;
 import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.ArraySet;
+import android.util.DisplayMetrics;
 import android.util.Slog;
+import android.view.Gravity;
+import android.view.MotionEvent;
 import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
-import android.widget.Toast;
+import android.view.animation.DecelerateInterpolator;
+import android.widget.Button;
+import android.widget.FrameLayout;
 
 import com.android.internal.R;
 
@@ -40,6 +53,7 @@
 public class TransientNavigationConfirmation {
     private static final String TAG = "TransientNavigationConfirmation";
     private static final boolean DEBUG = false;
+    private static final boolean DEBUG_SHOW_EVERY_TIME = false; // super annoying, use with caution
 
     private final Context mContext;
     private final H mHandler;
@@ -47,11 +61,12 @@
     private final long mShowDelayMs;
     private final long mPanicThresholdMs;
 
-    private Toast mToast;
+    private ClingWindowView mClingWindow;
     private String mLastPackage;
     private String mPromptPackage;
     private long mPanicTime;
     private String mPanicPackage;
+    private WindowManager mWindowManager;
 
     public TransientNavigationConfirmation(Context context) {
         mContext = context;
@@ -59,6 +74,8 @@
         mShowDelayMs = getNavBarExitDuration() * 3;
         mPanicThresholdMs = context.getResources()
                 .getInteger(R.integer.config_transient_navigation_confirmation_panic);
+        mWindowManager = (WindowManager)
+                mContext.getSystemService(Context.WINDOW_SERVICE);
     }
 
     private long getNavBarExitDuration() {
@@ -104,7 +121,7 @@
         mHandler.removeMessages(H.SHOW);
         if (isNavTransient) {
             mLastPackage = pkg;
-            if (!mConfirmedPackages.contains(pkg)) {
+            if (DEBUG_SHOW_EVERY_TIME || !mConfirmedPackages.contains(pkg)) {
                 mHandler.sendMessageDelayed(mHandler.obtainMessage(H.SHOW, pkg), mShowDelayMs);
             }
         } else {
@@ -141,11 +158,90 @@
     }
 
     private void handleHide() {
-        if (mToast != null) {
+        if (mClingWindow != null) {
             if (DEBUG) Slog.d(TAG,
                     "Hiding transient navigation confirmation for " + mPromptPackage);
-            mToast.cancel();
-            mToast = null;
+            mWindowManager.removeView(mClingWindow);
+            mClingWindow = null;
+        }
+    }
+
+    private class ClingWindowView extends FrameLayout {
+        private static final int BGCOLOR = 0x80000000;
+        private static final int OFFSET_DP = 48;
+
+        private final ColorDrawable mColor = new ColorDrawable(0);
+        private ValueAnimator mColorAnim;
+
+        public ClingWindowView(Context context) {
+            super(context);
+            setClickable(true);
+            setBackground(mColor);
+        }
+
+        @Override
+        public void onAttachedToWindow() {
+            super.onAttachedToWindow();
+
+            DisplayMetrics metrics = new DisplayMetrics();
+            mWindowManager.getDefaultDisplay().getMetrics(metrics);
+            float density = metrics.density;
+
+            // create the confirmation cling
+            final ViewGroup clingLayout = (ViewGroup)
+                    View.inflate(getContext(), R.layout.transient_navigation_cling, null);
+
+            final Button ok = (Button) clingLayout.findViewById(R.id.ok);
+            ok.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    handleHide();
+                }
+            });
+            addView(clingLayout, new FrameLayout.LayoutParams(
+                    FrameLayout.LayoutParams.MATCH_PARENT,
+                    FrameLayout.LayoutParams.WRAP_CONTENT
+            ));
+
+            if (ActivityManager.isHighEndGfx()) {
+                final View bubble = clingLayout.findViewById(R.id.text);
+                bubble.setAlpha(0f);
+                bubble.setTranslationY(-OFFSET_DP*density);
+                bubble.animate()
+                        .alpha(1f)
+                        .translationY(0)
+                        .setDuration(300)
+                        .setInterpolator(new DecelerateInterpolator())
+                        .start();
+
+                ok.setAlpha(0f);
+                ok.setTranslationY(-OFFSET_DP*density);
+                ok.animate().alpha(1f)
+                        .translationY(0)
+                        .setDuration(300)
+                        .setStartDelay(200)
+                        .setInterpolator(new DecelerateInterpolator())
+                        .start();
+
+                mColorAnim = ValueAnimator.ofObject(new ArgbEvaluator(), 0, BGCOLOR);
+                mColorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                    @Override
+                    public void onAnimationUpdate(ValueAnimator animation) {
+                        final int c = (Integer) animation.getAnimatedValue();
+                        mColor.setColor(c);
+                    }
+                });
+                mColorAnim.setDuration(1000);
+                mColorAnim.start();
+            } else {
+                mColor.setColor(BGCOLOR);
+            }
+        }
+
+        @Override
+        public boolean onTouchEvent(MotionEvent motion) {
+            Slog.v(TAG, "ClingWindowView.onTouchEvent");
+            return true;
         }
     }
 
@@ -153,16 +249,28 @@
         mPromptPackage = pkg;
         if (DEBUG) Slog.d(TAG, "Showing transient navigation confirmation for " + pkg);
 
-        // create the confirmation toast bar
-        final int msg = R.string.transient_navigation_confirmation;
-        mToast = Toast.makeBar(mContext, msg, Toast.LENGTH_INFINITE);
-        mToast.setAction(R.string.ok, confirmAction(pkg));
+        mClingWindow = new ClingWindowView(mContext);
 
         // we will be hiding the nav bar, so layout as if it's already hidden
-        mToast.getView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
+        mClingWindow.setSystemUiVisibility(
+                View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+              | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
 
         // show the confirmation
-        mToast.show();
+        WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
+                ViewGroup.LayoutParams.MATCH_PARENT,
+                ViewGroup.LayoutParams.MATCH_PARENT,
+                WindowManager.LayoutParams.TYPE_TOAST,
+                0
+                        | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
+                        | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
+                        | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED
+                ,
+                PixelFormat.TRANSLUCENT);
+        lp.setTitle("TransientNavigationConfirmation");
+        lp.windowAnimations = com.android.internal.R.style.Animation_RecentApplications;
+        lp.gravity = Gravity.FILL;
+        mWindowManager.addView(mClingWindow, lp);
     }
 
     private Runnable confirmAction(final String pkg) {
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 3e8770e..8f480dd 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -1473,7 +1473,7 @@
                 + " " + name + " " + request + " from " + packageName + "(" + uid + ")");
         LocationProviderInterface provider = mProvidersByName.get(name);
         if (provider == null) {
-            throw new IllegalArgumentException("provider doesn't exist: " + provider);
+            throw new IllegalArgumentException("provider doesn't exist: " + name);
         }
 
         UpdateRecord record = new UpdateRecord(name, request, receiver);
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 525b7e1..d1c313a 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -2628,10 +2628,10 @@
         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/print/PrintManagerService.java b/services/java/com/android/server/print/PrintManagerService.java
index 7538caf..edd6b25 100644
--- a/services/java/com/android/server/print/PrintManagerService.java
+++ b/services/java/com/android/server/print/PrintManagerService.java
@@ -474,7 +474,8 @@
                     ComponentName component = new ComponentName(serviceInfo.packageName,
                             serviceInfo.name);
                     String label = serviceInfo.loadLabel(mContext.getPackageManager()).toString();
-                    showEnableInstalledPrintServiceNotification(component, label);
+                    showEnableInstalledPrintServiceNotification(component, label,
+                            getChangingUserId());
                 }
             }
 
@@ -622,12 +623,14 @@
     }
 
     private void showEnableInstalledPrintServiceNotification(ComponentName component,
-            String label) {
+            String label, int userId) {
+        UserHandle userHandle = new UserHandle(userId);
+
         Intent intent = new Intent(Settings.ACTION_PRINT_SETTINGS);
         intent.putExtra(EXTRA_PRINT_SERVICE_COMPONENT_NAME, component.flattenToString());
 
-        PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent,
-                PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_CANCEL_CURRENT, null);
+        PendingIntent pendingIntent = PendingIntent.getActivityAsUser(mContext, 0, intent,
+                PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_CANCEL_CURRENT, null, userHandle);
 
         Notification.Builder builder = new Notification.Builder(mContext)
                 .setSmallIcon(R.drawable.ic_print)
@@ -642,6 +645,7 @@
                 .getSystemService(Context.NOTIFICATION_SERVICE);
 
         String notificationTag = getClass().getName() + ":" + component.flattenToString();
-        notificationManager.notify(notificationTag, 0, builder.build());
+        notificationManager.notifyAsUser(notificationTag, 0, builder.build(),
+                userHandle);
     }
 }
diff --git a/services/java/com/android/server/print/RemotePrintService.java b/services/java/com/android/server/print/RemotePrintService.java
index 5b9dc28..1bb61d2 100644
--- a/services/java/com/android/server/print/RemotePrintService.java
+++ b/services/java/com/android/server/print/RemotePrintService.java
@@ -682,7 +682,7 @@
                 final long identity = Binder.clearCallingIdentity();
                 try {
                     return service.mSpooler.getPrintJobInfos(service.mComponentName,
-                            PrintJobInfo.STATE_ANY_VISIBLE_TO_CLIENTS, PrintManager.APP_ID_ANY);
+                            PrintJobInfo.STATE_ANY_SCHEDULED, PrintManager.APP_ID_ANY);
                 } finally {
                     Binder.restoreCallingIdentity(identity);
                 }
diff --git a/services/java/com/android/server/print/UserState.java b/services/java/com/android/server/print/UserState.java
index 1b373ed..b69dcee 100644
--- a/services/java/com/android/server/print/UserState.java
+++ b/services/java/com/android/server/print/UserState.java
@@ -37,6 +37,7 @@
 import android.os.Message;
 import android.os.RemoteCallbackList;
 import android.os.RemoteException;
+import android.os.UserHandle;
 import android.print.IPrintDocumentAdapter;
 import android.print.IPrintJobStateChangeListener;
 import android.print.IPrinterDiscoveryObserver;
@@ -199,9 +200,10 @@
             intent.putExtra(PrintManager.EXTRA_PRINT_JOB, printJob);
             intent.putExtra(DocumentsContract.EXTRA_PACKAGE_NAME, packageName);
 
-            IntentSender intentSender = PendingIntent.getActivity(
+            IntentSender intentSender = PendingIntent.getActivityAsUser(
                     mContext, 0, intent, PendingIntent.FLAG_ONE_SHOT
-                    | PendingIntent.FLAG_CANCEL_CURRENT).getIntentSender();
+                    | PendingIntent.FLAG_CANCEL_CURRENT, null, new UserHandle(mUserId))
+                    .getIntentSender();
 
             Bundle result = new Bundle();
             result.putParcelable(PrintManager.EXTRA_PRINT_JOB, printJob);
@@ -798,17 +800,17 @@
             BackgroundThread.getHandler().post(new Runnable() {
                 @Override
                 public void run() {
-                    failActivePrintJobsForServiceInternal(serviceName);
+                    failScheduledPrintJobsForServiceInternal(serviceName);
                 }
             });
         } else {
-            failActivePrintJobsForServiceInternal(serviceName);
+            failScheduledPrintJobsForServiceInternal(serviceName);
         }
     }
 
-    private void failActivePrintJobsForServiceInternal(ComponentName serviceName) {
+    private void failScheduledPrintJobsForServiceInternal(ComponentName serviceName) {
         List<PrintJobInfo> printJobs = mSpooler.getPrintJobInfos(serviceName,
-                PrintJobInfo.STATE_ANY_ACTIVE, PrintManager.APP_ID_ANY);
+                PrintJobInfo.STATE_ANY_SCHEDULED, PrintManager.APP_ID_ANY);
         if (printJobs == null) {
             return;
         }
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 8216769..b2b0164 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -1855,10 +1855,10 @@
                 // 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 @@
                 }
             }
         }
-        // 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;
     }