summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt38
-rw-r--r--api/system-current.txt38
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java2
-rw-r--r--core/java/android/app/backup/BackupTransport.java11
-rw-r--r--core/java/android/hardware/ICameraService.aidl2
-rw-r--r--core/java/android/hardware/camera2/CameraCaptureSession.java36
-rw-r--r--core/java/android/hardware/camera2/CameraCharacteristics.java19
-rw-r--r--core/java/android/hardware/camera2/CameraDevice.java55
-rw-r--r--core/java/android/hardware/camera2/CameraManager.java2
-rw-r--r--core/java/android/hardware/camera2/CameraMetadata.java24
-rw-r--r--core/java/android/hardware/camera2/CaptureRequest.java48
-rw-r--r--core/java/android/hardware/camera2/CaptureResult.java2
-rw-r--r--core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java10
-rw-r--r--core/java/android/hardware/camera2/impl/CameraDeviceImpl.java6
-rw-r--r--core/java/android/hardware/camera2/params/InputConfiguration.java6
-rw-r--r--core/java/android/os/UserManager.java21
-rw-r--r--core/java/android/view/TextureView.java8
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeInfo.java8
-rw-r--r--core/java/android/webkit/WebResourceError.java5
-rw-r--r--core/jni/android/graphics/SurfaceTexture.cpp7
-rw-r--r--core/res/res/values/attrs_manifest.xml2
-rw-r--r--graphics/java/android/graphics/SurfaceTexture.java9
-rw-r--r--graphics/java/android/graphics/drawable/AnimationDrawable.java4
-rw-r--r--graphics/java/android/graphics/drawable/Icon.java1
-rw-r--r--media/java/android/media/Image.java39
-rw-r--r--media/java/android/media/ImageReader.java123
-rw-r--r--media/java/android/media/ImageUtils.java16
-rw-r--r--media/java/android/media/ImageWriter.java93
-rw-r--r--media/java/android/media/MediaDataSource.java21
-rw-r--r--media/java/android/media/MediaPlayer.java34
-rw-r--r--media/java/android/media/MediaSync.java118
-rw-r--r--media/java/android/media/MediaTimestamp.java24
-rw-r--r--media/jni/android_media_ImageReader.cpp18
-rw-r--r--media/jni/android_media_MediaDataSource.cpp15
-rw-r--r--media/jni/android_media_MediaExtractor.cpp5
-rw-r--r--packages/Keyguard/res/layout/keyguard_status_area.xml4
-rw-r--r--packages/Keyguard/res/layout/keyguard_status_view.xml1
-rw-r--r--packages/Keyguard/res/values-h650dp/dimens.xml2
-rw-r--r--packages/Keyguard/res/values-sw600dp/dimens.xml2
-rw-r--r--packages/Keyguard/res/values-sw720dp/dimens.xml2
-rw-r--r--packages/Keyguard/res/values/colors.xml2
-rw-r--r--packages/Keyguard/res/values/dimens.xml2
-rw-r--r--packages/Keyguard/res/values/styles.xml2
-rw-r--r--packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java2
-rw-r--r--packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java2
-rw-r--r--packages/StatementService/src/com/android/statementservice/retriever/Statement.java2
-rw-r--r--packages/SystemUI/res/layout/super_status_bar.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java14
-rw-r--r--rs/java/android/renderscript/RenderScript.java14
-rw-r--r--services/core/java/com/android/server/camera/CameraService.java73
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiControlService.java4
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java2
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperManagerService.java38
-rw-r--r--telecomm/java/android/telecom/RemoteConnection.java2
-rw-r--r--telecomm/java/android/telecom/StatusHints.java3
-rw-r--r--tools/layoutlib/.idea/libraries/framework_jar.xml13
-rw-r--r--tools/layoutlib/.idea/libraries/layoutlib_api_prebuilt.xml11
-rw-r--r--tools/layoutlib/bridge/bridge.iml26
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java12
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java6
-rw-r--r--tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java78
-rw-r--r--tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java13
64 files changed, 590 insertions, 619 deletions
diff --git a/api/current.txt b/api/current.txt
index c7cfb6e..2a36e88 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -13164,7 +13164,7 @@ package android.hardware.camera2 {
method public abstract void close();
method public abstract android.hardware.camera2.CameraDevice getDevice();
method public abstract android.view.Surface getInputSurface();
- method public abstract boolean isReprocessible();
+ method public abstract boolean isReprocessable();
method public abstract void prepare(android.view.Surface) throws android.hardware.camera2.CameraAccessException;
method public abstract int setRepeatingBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
method public abstract int setRepeatingRequest(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
@@ -13285,7 +13285,7 @@ package android.hardware.camera2 {
method public abstract android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int) throws android.hardware.camera2.CameraAccessException;
method public abstract void createCaptureSession(java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
method public abstract android.hardware.camera2.CaptureRequest.Builder createReprocessCaptureRequest(android.hardware.camera2.TotalCaptureResult) throws android.hardware.camera2.CameraAccessException;
- method public abstract void createReprocessibleCaptureSession(android.hardware.camera2.params.InputConfiguration, java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
+ method public abstract void createReprocessableCaptureSession(android.hardware.camera2.params.InputConfiguration, java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
method public abstract java.lang.String getId();
field public static final int TEMPLATE_MANUAL = 6; // 0x6
field public static final int TEMPLATE_PREVIEW = 1; // 0x1
@@ -13464,7 +13464,7 @@ package android.hardware.camera2 {
field public static final int REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8; // 0x8
field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2; // 0x2
field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1; // 0x1
- field public static final int REQUEST_AVAILABLE_CAPABILITIES_OPAQUE_REPROCESSING = 4; // 0x4
+ field public static final int REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4; // 0x4
field public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3; // 0x3
field public static final int REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5; // 0x5
field public static final int REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING = 7; // 0x7
@@ -15229,7 +15229,6 @@ package android.media {
method public abstract android.media.Image.Plane[] getPlanes();
method public abstract long getTimestamp();
method public abstract int getWidth();
- method public boolean isOpaque();
method public void setCropRect(android.graphics.Rect);
method public void setTimestamp(long);
}
@@ -15249,9 +15248,7 @@ package android.media {
method public int getMaxImages();
method public android.view.Surface getSurface();
method public int getWidth();
- method public boolean isOpaque();
method public static android.media.ImageReader newInstance(int, int, int, int);
- method public static android.media.ImageReader newOpaqueInstance(int, int, int);
method public void setOnImageAvailableListener(android.media.ImageReader.OnImageAvailableListener, android.os.Handler);
}
@@ -15266,11 +15263,11 @@ package android.media {
method public int getMaxImages();
method public static android.media.ImageWriter newInstance(android.view.Surface, int);
method public void queueInputImage(android.media.Image);
- method public void setImageListener(android.media.ImageWriter.ImageListener, android.os.Handler);
+ method public void setOnImageReleasedListener(android.media.ImageWriter.OnImageReleasedListener, android.os.Handler);
}
- public static abstract interface ImageWriter.ImageListener {
- method public abstract void onInputImageReleased(android.media.ImageWriter);
+ public static abstract interface ImageWriter.OnImageReleasedListener {
+ method public abstract void onImageReleased(android.media.ImageWriter);
}
public class JetPlayer {
@@ -15672,9 +15669,10 @@ package android.media {
ctor public MediaCryptoException(java.lang.String);
}
- public abstract interface MediaDataSource implements java.io.Closeable {
- method public abstract long getSize();
- method public abstract int readAt(long, byte[], int);
+ public abstract class MediaDataSource implements java.io.Closeable {
+ ctor public MediaDataSource();
+ method public abstract long getSize() throws java.io.IOException;
+ method public abstract int readAt(long, byte[], int, int) throws java.io.IOException;
}
public class MediaDescription implements android.os.Parcelable {
@@ -16098,7 +16096,6 @@ package android.media {
method public void setOnTimedTextListener(android.media.MediaPlayer.OnTimedTextListener);
method public void setOnVideoSizeChangedListener(android.media.MediaPlayer.OnVideoSizeChangedListener);
method public void setPlaybackParams(android.media.PlaybackParams);
- method public void setPlaybackRate(float, int);
method public void setScreenOnWhilePlaying(boolean);
method public void setSurface(android.view.Surface);
method public void setSyncParams(android.media.SyncParams);
@@ -16125,9 +16122,6 @@ package android.media {
field public static final int MEDIA_INFO_VIDEO_RENDERING_START = 3; // 0x3
field public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700; // 0x2bc
field public static final java.lang.String MEDIA_MIMETYPE_TEXT_SUBRIP = "application/x-subrip";
- field public static final int PLAYBACK_RATE_AUDIO_MODE_DEFAULT = 0; // 0x0
- field public static final int PLAYBACK_RATE_AUDIO_MODE_RESAMPLE = 2; // 0x2
- field public static final int PLAYBACK_RATE_AUDIO_MODE_STRETCH = 1; // 0x1
field public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT = 1; // 0x1
field public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = 2; // 0x2
}
@@ -16429,14 +16423,10 @@ package android.media {
method public void setCallback(android.media.MediaSync.Callback, android.os.Handler);
method public void setOnErrorListener(android.media.MediaSync.OnErrorListener, android.os.Handler);
method public void setPlaybackParams(android.media.PlaybackParams);
- method public void setPlaybackRate(float, int);
method public void setSurface(android.view.Surface);
method public void setSyncParams(android.media.SyncParams);
field public static final int MEDIASYNC_ERROR_AUDIOTRACK_FAIL = 1; // 0x1
field public static final int MEDIASYNC_ERROR_SURFACE_FAIL = 2; // 0x2
- field public static final int PLAYBACK_RATE_AUDIO_MODE_DEFAULT = 0; // 0x0
- field public static final int PLAYBACK_RATE_AUDIO_MODE_RESAMPLE = 2; // 0x2
- field public static final int PLAYBACK_RATE_AUDIO_MODE_STRETCH = 1; // 0x1
}
public static abstract class MediaSync.Callback {
@@ -16458,9 +16448,9 @@ package android.media {
}
public final class MediaTimestamp {
- field public final float clockRate;
- field public final long mediaTimeUs;
- field public final long nanoTime;
+ method public long getAnchorMediaTimeUs();
+ method public long getAnchorSytemNanoTime();
+ method public float getMediaClockRate();
}
public final class NotProvisionedException extends android.media.MediaDrmException {
@@ -38807,7 +38797,7 @@ package android.webkit {
}
public abstract class WebResourceError {
- method public abstract java.lang.CharSequence getDescription();
+ method public java.lang.CharSequence getDescription();
method public abstract int getErrorCode();
}
diff --git a/api/system-current.txt b/api/system-current.txt
index f3acbd0..4044e61 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -13478,7 +13478,7 @@ package android.hardware.camera2 {
method public abstract void close();
method public abstract android.hardware.camera2.CameraDevice getDevice();
method public abstract android.view.Surface getInputSurface();
- method public abstract boolean isReprocessible();
+ method public abstract boolean isReprocessable();
method public abstract void prepare(android.view.Surface) throws android.hardware.camera2.CameraAccessException;
method public abstract int setRepeatingBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
method public abstract int setRepeatingRequest(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
@@ -13599,7 +13599,7 @@ package android.hardware.camera2 {
method public abstract android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int) throws android.hardware.camera2.CameraAccessException;
method public abstract void createCaptureSession(java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
method public abstract android.hardware.camera2.CaptureRequest.Builder createReprocessCaptureRequest(android.hardware.camera2.TotalCaptureResult) throws android.hardware.camera2.CameraAccessException;
- method public abstract void createReprocessibleCaptureSession(android.hardware.camera2.params.InputConfiguration, java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
+ method public abstract void createReprocessableCaptureSession(android.hardware.camera2.params.InputConfiguration, java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
method public abstract java.lang.String getId();
field public static final int TEMPLATE_MANUAL = 6; // 0x6
field public static final int TEMPLATE_PREVIEW = 1; // 0x1
@@ -13778,7 +13778,7 @@ package android.hardware.camera2 {
field public static final int REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8; // 0x8
field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2; // 0x2
field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1; // 0x1
- field public static final int REQUEST_AVAILABLE_CAPABILITIES_OPAQUE_REPROCESSING = 4; // 0x4
+ field public static final int REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4; // 0x4
field public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3; // 0x3
field public static final int REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5; // 0x5
field public static final int REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING = 7; // 0x7
@@ -16466,7 +16466,6 @@ package android.media {
method public abstract android.media.Image.Plane[] getPlanes();
method public abstract long getTimestamp();
method public abstract int getWidth();
- method public boolean isOpaque();
method public void setCropRect(android.graphics.Rect);
method public void setTimestamp(long);
}
@@ -16486,9 +16485,7 @@ package android.media {
method public int getMaxImages();
method public android.view.Surface getSurface();
method public int getWidth();
- method public boolean isOpaque();
method public static android.media.ImageReader newInstance(int, int, int, int);
- method public static android.media.ImageReader newOpaqueInstance(int, int, int);
method public void setOnImageAvailableListener(android.media.ImageReader.OnImageAvailableListener, android.os.Handler);
}
@@ -16503,11 +16500,11 @@ package android.media {
method public int getMaxImages();
method public static android.media.ImageWriter newInstance(android.view.Surface, int);
method public void queueInputImage(android.media.Image);
- method public void setImageListener(android.media.ImageWriter.ImageListener, android.os.Handler);
+ method public void setOnImageReleasedListener(android.media.ImageWriter.OnImageReleasedListener, android.os.Handler);
}
- public static abstract interface ImageWriter.ImageListener {
- method public abstract void onInputImageReleased(android.media.ImageWriter);
+ public static abstract interface ImageWriter.OnImageReleasedListener {
+ method public abstract void onImageReleased(android.media.ImageWriter);
}
public class JetPlayer {
@@ -16909,9 +16906,10 @@ package android.media {
ctor public MediaCryptoException(java.lang.String);
}
- public abstract interface MediaDataSource implements java.io.Closeable {
- method public abstract long getSize();
- method public abstract int readAt(long, byte[], int);
+ public abstract class MediaDataSource implements java.io.Closeable {
+ ctor public MediaDataSource();
+ method public abstract long getSize() throws java.io.IOException;
+ method public abstract int readAt(long, byte[], int, int) throws java.io.IOException;
}
public class MediaDescription implements android.os.Parcelable {
@@ -17336,7 +17334,6 @@ package android.media {
method public void setOnTimedTextListener(android.media.MediaPlayer.OnTimedTextListener);
method public void setOnVideoSizeChangedListener(android.media.MediaPlayer.OnVideoSizeChangedListener);
method public void setPlaybackParams(android.media.PlaybackParams);
- method public void setPlaybackRate(float, int);
method public void setScreenOnWhilePlaying(boolean);
method public void setSurface(android.view.Surface);
method public void setSyncParams(android.media.SyncParams);
@@ -17363,9 +17360,6 @@ package android.media {
field public static final int MEDIA_INFO_VIDEO_RENDERING_START = 3; // 0x3
field public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700; // 0x2bc
field public static final java.lang.String MEDIA_MIMETYPE_TEXT_SUBRIP = "application/x-subrip";
- field public static final int PLAYBACK_RATE_AUDIO_MODE_DEFAULT = 0; // 0x0
- field public static final int PLAYBACK_RATE_AUDIO_MODE_RESAMPLE = 2; // 0x2
- field public static final int PLAYBACK_RATE_AUDIO_MODE_STRETCH = 1; // 0x1
field public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT = 1; // 0x1
field public static final int VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING = 2; // 0x2
}
@@ -17669,14 +17663,10 @@ package android.media {
method public void setCallback(android.media.MediaSync.Callback, android.os.Handler);
method public void setOnErrorListener(android.media.MediaSync.OnErrorListener, android.os.Handler);
method public void setPlaybackParams(android.media.PlaybackParams);
- method public void setPlaybackRate(float, int);
method public void setSurface(android.view.Surface);
method public void setSyncParams(android.media.SyncParams);
field public static final int MEDIASYNC_ERROR_AUDIOTRACK_FAIL = 1; // 0x1
field public static final int MEDIASYNC_ERROR_SURFACE_FAIL = 2; // 0x2
- field public static final int PLAYBACK_RATE_AUDIO_MODE_DEFAULT = 0; // 0x0
- field public static final int PLAYBACK_RATE_AUDIO_MODE_RESAMPLE = 2; // 0x2
- field public static final int PLAYBACK_RATE_AUDIO_MODE_STRETCH = 1; // 0x1
}
public static abstract class MediaSync.Callback {
@@ -17698,9 +17688,9 @@ package android.media {
}
public final class MediaTimestamp {
- field public final float clockRate;
- field public final long mediaTimeUs;
- field public final long nanoTime;
+ method public long getAnchorMediaTimeUs();
+ method public long getAnchorSytemNanoTime();
+ method public float getMediaClockRate();
}
public final class NotProvisionedException extends android.media.MediaDrmException {
@@ -41131,7 +41121,7 @@ package android.webkit {
public abstract class WebResourceError {
ctor public WebResourceError();
- method public abstract java.lang.CharSequence getDescription();
+ method public java.lang.CharSequence getDescription();
method public abstract int getErrorCode();
}
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index eb834f2..1599459 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -1585,7 +1585,7 @@ public final class Pm {
}
private int runGrantRevokePermission(boolean grant) {
- int userId = UserHandle.USER_CURRENT;
+ int userId = UserHandle.USER_OWNER;
String opt = null;
while ((opt = nextOption()) != null) {
diff --git a/core/java/android/app/backup/BackupTransport.java b/core/java/android/app/backup/BackupTransport.java
index 9540eb1..4d2158f 100644
--- a/core/java/android/app/backup/BackupTransport.java
+++ b/core/java/android/app/backup/BackupTransport.java
@@ -162,8 +162,17 @@ public class BackupTransport {
* this is called, {@link #finishBackup} will be called to ensure the request
* is sent and received successfully.
*
+ * <p>If the transport returns anything other than TRANSPORT_OK from this method,
+ * the OS will halt the current initialize operation and schedule a retry in the
+ * near future. Even if the transport is in a state such that attempting to
+ * "initialize" the backend storage is meaningless -- for example, if there is
+ * no current live dataset at all, or there is no authenticated account under which
+ * to store the data remotely -- the transport should return TRANSPORT_OK here
+ * and treat the initializeDevice() / finishBackup() pair as a graceful no-op.
+ *
* @return One of {@link BackupTransport#TRANSPORT_OK} (OK so far) or
- * {@link BackupTransport#TRANSPORT_ERROR} (on network error or other failure).
+ * {@link BackupTransport#TRANSPORT_ERROR} (to retry following network error
+ * or other failure).
*/
public int initializeDevice() {
return BackupTransport.TRANSPORT_ERROR;
diff --git a/core/java/android/hardware/ICameraService.aidl b/core/java/android/hardware/ICameraService.aidl
index 7b96e20..9201b61 100644
--- a/core/java/android/hardware/ICameraService.aidl
+++ b/core/java/android/hardware/ICameraService.aidl
@@ -81,5 +81,5 @@ interface ICameraService
*
* Callers require the android.permission.CAMERA_SEND_SYSTEM_EVENTS permission.
*/
- oneway void notifySystemEvent(int eventId, int arg0);
+ oneway void notifySystemEvent(int eventId, in int[] args);
}
diff --git a/core/java/android/hardware/camera2/CameraCaptureSession.java b/core/java/android/hardware/camera2/CameraCaptureSession.java
index f70e075..c6f622c 100644
--- a/core/java/android/hardware/camera2/CameraCaptureSession.java
+++ b/core/java/android/hardware/camera2/CameraCaptureSession.java
@@ -29,11 +29,11 @@ import java.util.List;
* <p>A CameraCaptureSession is created by providing a set of target output surfaces to
* {@link CameraDevice#createCaptureSession createCaptureSession}, or by providing an
* {@link android.hardware.camera2.params.InputConfiguration} and a set of target output surfaces to
- * {@link CameraDevice#createReprocessibleCaptureSession createReprocessibleCaptureSession} for a
- * reprocessible capture session. Once created, the session is active until a new session is
+ * {@link CameraDevice#createReprocessableCaptureSession createReprocessableCaptureSession} for a
+ * reprocessable capture session. Once created, the session is active until a new session is
* created by the camera device, or the camera device is closed.</p>
*
- * <p>All capture sessions can be used for capturing images from the camera but only reprocessible
+ * <p>All capture sessions can be used for capturing images from the camera but only reprocessable
* capture sessions can reprocess images captured from the camera in the same session previously.
* </p>
*
@@ -41,7 +41,7 @@ import java.util.List;
* it requires configuring the camera device's internal pipelines and allocating memory buffers for
* sending images to the desired targets. Therefore the setup is done asynchronously, and
* {@link CameraDevice#createCaptureSession createCaptureSession} and
- * {@link CameraDevice#createReprocessibleCaptureSession createReprocessibleCaptureSession} will
+ * {@link CameraDevice#createReprocessableCaptureSession createReprocessableCaptureSession} will
* send the ready-to-use CameraCaptureSession to the provided listener's
* {@link CameraCaptureSession.StateCallback#onConfigured onConfigured} callback. If configuration
* cannot be completed, then the
@@ -156,7 +156,7 @@ public abstract class CameraCaptureSession implements AutoCloseable {
*
* <p>All capture sessions can be used for capturing images from the camera but only capture
* sessions created by
- * {@link CameraDevice#createReprocessibleCaptureSession createReprocessibleCaptureSession}
+ * {@link CameraDevice#createReprocessableCaptureSession createReprocessableCaptureSession}
* can submit reprocess capture requests. Submitting a reprocess request to a regular capture
* session will result in an {@link IllegalArgumentException}.</p>
*
@@ -179,9 +179,9 @@ public abstract class CameraCaptureSession implements AutoCloseable {
* @throws IllegalArgumentException if the request targets no Surfaces or Surfaces that are not
* configured as outputs for this session; or the request
* targets a set of Surfaces that cannot be submitted
- * simultaneously in a reprocessible capture session; or a
+ * simultaneously in a reprocessable capture session; or a
* reprocess capture request is submitted in a
- * non-reprocessible capture session; or the reprocess capture
+ * non-reprocessable capture session; or the reprocess capture
* request was created with a {@link TotalCaptureResult} from
* a different session; or the capture targets a Surface in
* the middle of being {@link #prepare prepared}; or the
@@ -192,7 +192,7 @@ public abstract class CameraCaptureSession implements AutoCloseable {
* @see #setRepeatingRequest
* @see #setRepeatingBurst
* @see #abortCaptures
- * @see CameraDevice#createReprocessibleCaptureSession
+ * @see CameraDevice#createReprocessableCaptureSession
*/
public abstract int capture(CaptureRequest request, CaptureCallback listener, Handler handler)
throws CameraAccessException;
@@ -214,7 +214,7 @@ public abstract class CameraCaptureSession implements AutoCloseable {
*
* <p>All capture sessions can be used for capturing images from the camera but only capture
* sessions created by
- * {@link CameraDevice#createReprocessibleCaptureSession createReprocessibleCaptureSession}
+ * {@link CameraDevice#createReprocessableCaptureSession createReprocessableCaptureSession}
* can submit reprocess capture requests. Submitting a reprocess request to a regular
* capture session will result in an {@link IllegalArgumentException}.</p>
*
@@ -238,9 +238,9 @@ public abstract class CameraCaptureSession implements AutoCloseable {
* @throws IllegalArgumentException If the requests target no Surfaces, or the requests target
* Surfaces not currently configured as outputs; or one of the
* requests targets a set of Surfaces that cannot be submitted
- * simultaneously in a reprocessible capture session; or a
+ * simultaneously in a reprocessable capture session; or a
* reprocess capture request is submitted in a
- * non-reprocessible capture session; or one of the reprocess
+ * non-reprocessable capture session; or one of the reprocess
* capture requests was created with a
* {@link TotalCaptureResult} from a different session; or one
* of the captures targets a Surface in the middle of being
@@ -425,7 +425,7 @@ public abstract class CameraCaptureSession implements AutoCloseable {
*
* <p>This method is the fastest way to switch the camera device to a new session with
* {@link CameraDevice#createCaptureSession} or
- * {@link CameraDevice#createReprocessibleCaptureSession}, at the cost of discarding in-progress
+ * {@link CameraDevice#createReprocessableCaptureSession}, at the cost of discarding in-progress
* work. It must be called before the new session is created. Once all pending requests are
* either completed or thrown away, the {@link StateCallback#onReady} callback will be called,
* if the session has not been closed. Otherwise, the {@link StateCallback#onClosed}
@@ -448,7 +448,7 @@ public abstract class CameraCaptureSession implements AutoCloseable {
* @see #setRepeatingRequest
* @see #setRepeatingBurst
* @see CameraDevice#createCaptureSession
- * @see CameraDevice#createReprocessibleCaptureSession
+ * @see CameraDevice#createReprocessableCaptureSession
*/
public abstract void abortCaptures() throws CameraAccessException;
@@ -459,14 +459,14 @@ public abstract class CameraCaptureSession implements AutoCloseable {
* @return {@code true} if the application can submit reprocess capture requests with this
* camera capture session. {@code false} otherwise.
*
- * @see CameraDevice#createReprocessibleCaptureSession
+ * @see CameraDevice#createReprocessableCaptureSession
*/
- public abstract boolean isReprocessible();
+ public abstract boolean isReprocessable();
/**
- * Get the input Surface associated with a reprocessible capture session.
+ * Get the input Surface associated with a reprocessable capture session.
*
- * <p>Each reprocessible capture session has an input {@link Surface} where the reprocess
+ * <p>Each reprocessable capture session has an input {@link Surface} where the reprocess
* capture requests get the input images from, rather than the camera device. The application
* can create a {@link android.media.ImageWriter} with this input {@link Surface} and use it to
* provide input images for reprocess capture requests.</p>
@@ -474,7 +474,7 @@ public abstract class CameraCaptureSession implements AutoCloseable {
* @return The {@link Surface} where reprocessing capture requests get the input images from. If
* this is not a reprocess capture session, {@code null} will be returned.
*
- * @see CameraDevice#createReprocessibleCaptureSession
+ * @see CameraDevice#createReprocessableCaptureSession
* @see android.media.ImageWriter
* @see android.media.ImageReader
*/
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index 19e821c..d3b63f9 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -1239,7 +1239,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
* only the input buffer will be used to produce these output stream buffers, and a
* new sensor image will not be captured.</p>
* <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
- * stream image format will be OPAQUE, the associated output stream image format
+ * stream image format will be PRIVATE, the associated output stream image format
* should be JPEG.</p>
* <p><b>Range of valid values:</b><br></p>
* <p>0 or 1.</p>
@@ -1326,7 +1326,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
* <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
* <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
* <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
- * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_OPAQUE_REPROCESSING OPAQUE_REPROCESSING}</li>
+ * <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
* <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
* <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
* <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
@@ -1339,7 +1339,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
* @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
* @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
* @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
- * @see #REQUEST_AVAILABLE_CAPABILITIES_OPAQUE_REPROCESSING
+ * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
* @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
* @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
* @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
@@ -1536,12 +1536,12 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
* <tr>
* <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
* <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
- * <td align="left">OPAQUE_REPROCESSING</td>
+ * <td align="left">PRIVATE_REPROCESSING</td>
* </tr>
* <tr>
* <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
* <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
- * <td align="left">OPAQUE_REPROCESSING</td>
+ * <td align="left">PRIVATE_REPROCESSING</td>
* </tr>
* <tr>
* <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
@@ -1556,8 +1556,9 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
* </tbody>
* </table>
* <p>PRIVATE refers to a device-internal format that is not directly application-visible. A
- * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newOpaqueInstance }.</p>
- * <p>For a OPAQUE_REPROCESSING-capable camera device, using the PRIVATE format as either input
+ * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
+ * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
+ * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
* or output will never hurt maximum frame rate (i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration getOutputStallDuration(ImageFormat.PRIVATE, size)} is always 0),</p>
* <p>Attempting to configure an input stream with output streams not
* listed as available in this map is not valid.</p>
@@ -2647,8 +2648,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
* formats/sizes combination.</p>
* <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
* ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
- * <p>This key is supported if the camera device supports OPAQUE or YUV reprocessing (
- * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains OPAQUE_REPROCESSING or
+ * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
+ * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
* YUV_REPROCESSING).</p>
* <p><b>Units</b>: Number of frames.</p>
* <p><b>Range of valid values:</b><br>
diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java
index 4af7daf..dad4fb6 100644
--- a/core/java/android/hardware/camera2/CameraDevice.java
+++ b/core/java/android/hardware/camera2/CameraDevice.java
@@ -100,7 +100,7 @@ public abstract class CameraDevice implements AutoCloseable {
* means maximizing image quality without compromising preview frame rate.
* AE/AWB/AF should be on auto mode.
* This template is guaranteed to be supported on camera devices that support the
- * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_OPAQUE_REPROCESSING OPAQUE_REPROCESSING}
+ * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}
* capability or the
* {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}
* capability.
@@ -409,15 +409,15 @@ public abstract class CameraDevice implements AutoCloseable {
CameraCaptureSession.StateCallback callback, Handler handler)
throws CameraAccessException;
/**
- * Create a new reprocessible camera capture session by providing the desired reprocessing
+ * Create a new reprocessable camera capture session by providing the desired reprocessing
* input Surface configuration and the target output set of Surfaces to the camera device.
*
* <p>If a camera device supports YUV reprocessing
- * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING}) or OPAQUE
+ * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING}) or PRIVATE
* reprocessing
- * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_OPAQUE_REPROCESSING}), besides
+ * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING}), besides
* the capture session created via {@link #createCaptureSession createCaptureSession}, the
- * application can also create a reprocessible capture session to submit reprocess capture
+ * application can also create a reprocessable capture session to submit reprocess capture
* requests in addition to regular capture requests. A reprocess capture request takes the next
* available buffer from the session's input Surface, and sends it through the camera device's
* processing pipeline again, to produce buffers for the request's target output Surfaces. No
@@ -426,7 +426,7 @@ public abstract class CameraDevice implements AutoCloseable {
* directly (e.g. for Zero-Shutter-Lag use case) or indirectly (e.g. combining multiple output
* images).</p>
*
- * <p>The active reprocessible capture session determines an input {@link Surface} and the set
+ * <p>The active reprocessable capture session determines an input {@link Surface} and the set
* of potential output Surfaces for the camera devices for each capture request. The application
* can use {@link #createCaptureRequest createCaptureRequest} to create regular capture requests
* to capture new images from the camera device, and use {@link #createReprocessCaptureRequest
@@ -448,30 +448,30 @@ public abstract class CameraDevice implements AutoCloseable {
* they cannot be used as targets for a reprocessing request.</p>
*
* <p>Since the application cannot access {@link android.graphics.ImageFormat#PRIVATE} images
- * directly, an output Surface created by {@link android.media.ImageReader#newOpaqueInstance}
- * will be considered as intended to be used for reprocessing input and thus the
- * {@link android.media.ImageReader} size must match one of the supported input sizes for
- * {@link android.graphics.ImageFormat#PRIVATE} format. Otherwise, creating a reprocessible
- * capture session will fail.</p>
+ * directly, an output Surface created by {@link android.media.ImageReader#newInstance} with
+ * {@link android.graphics.ImageFormat#PRIVATE} as the format will be considered as intended to
+ * be used for reprocessing input and thus the {@link android.media.ImageReader} size must
+ * match one of the supported input sizes for {@link android.graphics.ImageFormat#PRIVATE}
+ * format. Otherwise, creating a reprocessable capture session will fail.</p>
*
* <p>The guaranteed stream configurations listed in
* {@link #createCaptureSession createCaptureSession} are also guaranteed to work for
- * {@link #createReprocessibleCaptureSession createReprocessibleCaptureSession}. In addition,
- * the configurations in the tables below are also guaranteed for creating a reprocessible
- * capture session if the camera device supports YUV reprocessing or OPAQUE reprocessing.
- * However, not all output targets used to create a reprocessible session may be used in a
+ * {@link #createReprocessableCaptureSession createReprocessableCaptureSession}. In addition,
+ * the configurations in the tables below are also guaranteed for creating a reprocessable
+ * capture session if the camera device supports YUV reprocessing or PRIVATE reprocessing.
+ * However, not all output targets used to create a reprocessable session may be used in a
* {@link CaptureRequest} simultaneously. The guaranteed output targets that can be included
* in a {@link CaptureRequest} simultaneously are listed in the tables under
* {@link #createCaptureSession createCaptureSession}. For example, with a FULL-capability
* ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL} {@code == }
- * {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}) device that supports OPAQUE
- * reprocessing, an application can create a reprocessible capture session with 1 input,
+ * {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}) device that supports PRIVATE
+ * reprocessing, an application can create a reprocessable capture session with 1 input,
* ({@code PRIV}, {@code MAXIMUM}), and 3 outputs, ({@code PRIV}, {@code MAXIMUM}),
* ({@code PRIV}, {@code PREVIEW}), and ({@code YUV}, {@code MAXIMUM}). However, it's not
* guaranteed that an application can submit a regular or reprocess capture with ({@code PRIV},
* {@code MAXIMUM}) and ({@code YUV}, {@code MAXIMUM}) outputs based on the table listed under
* {@link #createCaptureSession createCaptureSession}. In other words, use the tables below to
- * determine the guaranteed stream configurations for creating a reprocessible capture session,
+ * determine the guaranteed stream configurations for creating a reprocessable capture session,
* and use the tables under {@link #createCaptureSession createCaptureSession} to determine the
* guaranteed output targets that can be submitted in a regular or reprocess
* {@link CaptureRequest} simultaneously.</p>
@@ -482,12 +482,12 @@ public abstract class CameraDevice implements AutoCloseable {
*
* <p>Limited-capability ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL}
* {@code == }{@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}) devices
- * support at least the following stream combinations for creating a reprocessible capture
+ * support at least the following stream combinations for creating a reprocessable capture
* session in addition to those listed in {@link #createCaptureSession createCaptureSession} for
* {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices:
*
* <table>
- * <tr><th colspan="11">LIMITED-level additional guaranteed configurations for creating a reprocessible capture session<br>({@code PRIV} input is guaranteed only if OPAQUE reprocessing is supported. {@code YUV} input is guaranteed only if YUV reprocessing is supported)</th></tr>
+ * <tr><th colspan="11">LIMITED-level additional guaranteed configurations for creating a reprocessable capture session<br>({@code PRIV} input is guaranteed only if PRIVATE reprocessing is supported. {@code YUV} input is guaranteed only if YUV reprocessing is supported)</th></tr>
* <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr>
* <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr>
* <tr> <td>{@code PRIV}/{@code YUV}</td><td id="rb">{@code MAXIMUM}</td> <td>Same as input</td><td id="rb">{@code MAXIMUM}</td> <td>{@code JPEG}</td><td id="rb">{@code MAXIMUM}</td> <td></td><td id="rb"></td> <td></td><td id="rb"></td> <td>No-viewfinder still image reprocessing.</td> </tr>
@@ -499,12 +499,12 @@ public abstract class CameraDevice implements AutoCloseable {
*
* <p>FULL-capability ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL}
* {@code == }{@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}) devices
- * support at least the following stream combinations for creating a reprocessible capture
+ * support at least the following stream combinations for creating a reprocessable capture
* session in addition to those for
* {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices:
*
* <table>
- * <tr><th colspan="11">FULL-capability additional guaranteed configurations for creating a reprocessible capture session<br>({@code PRIV} input is guaranteed only if OPAQUE reprocessing is supported. {@code YUV} input is guaranteed only if YUV reprocessing is supported)</th></tr>
+ * <tr><th colspan="11">FULL-capability additional guaranteed configurations for creating a reprocessable capture session<br>({@code PRIV} input is guaranteed only if PRIVATE reprocessing is supported. {@code YUV} input is guaranteed only if YUV reprocessing is supported)</th></tr>
* <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr>
* <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr>
* <tr> <td>{@code YUV}</td><td id="rb">{@code MAXIMUM}</td> <td>{@code YUV}</td><td id="rb">{@code MAXIMUM}</td> <td>{@code PRIV}</td><td id="rb">{@code PREVIEW}</td> <td></td><td id="rb"></td> <td></td><td id="rb"></td> <td>Maximum-resolution multi-frame image fusion in-app processing with regular preview.</td> </tr>
@@ -520,12 +520,12 @@ public abstract class CameraDevice implements AutoCloseable {
*
* <p>RAW-capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES} includes
* {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}) devices additionally support
- * at least the following stream combinations for creating a reprocessible capture session
+ * at least the following stream combinations for creating a reprocessable capture session
* on both {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL} and
* {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices
*
* <table>
- * <tr><th colspan="11">RAW-capability additional guaranteed configurations for creating a reprocessible capture session<br>({@code PRIV} input is guaranteed only if OPAQUE reprocessing is supported. {@code YUV} input is guaranteed only if YUV reprocessing is supported)</th></tr>
+ * <tr><th colspan="11">RAW-capability additional guaranteed configurations for creating a reprocessable capture session<br>({@code PRIV} input is guaranteed only if PRIVATE reprocessing is supported. {@code YUV} input is guaranteed only if YUV reprocessing is supported)</th></tr>
* <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr>
* <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr>
* <tr> <td>{@code PRIV}/{@code YUV}</td><td id="rb">{@code MAXIMUM}</td> <td>Same as input</td><td id="rb">{@code MAXIMUM}</td> <td>{@code YUV}</td><td id="rb">{@code PREVIEW}</td> <td>{@code RAW}</td><td id="rb">{@code MAXIMUM}</td> <td></td><td id="rb"></td> <td>Mutually exclusive ZSL in-app processing and DNG capture.</td> </tr>
@@ -560,7 +560,7 @@ public abstract class CameraDevice implements AutoCloseable {
* @see android.media.ImageWriter
* @see android.media.ImageReader
*/
- public abstract void createReprocessibleCaptureSession(InputConfiguration inputConfig,
+ public abstract void createReprocessableCaptureSession(InputConfiguration inputConfig,
List<Surface> outputs, CameraCaptureSession.StateCallback callback, Handler handler)
throws CameraAccessException;
@@ -602,8 +602,7 @@ public abstract class CameraDevice implements AutoCloseable {
* {@link CameraCaptureSession}'s input {@link Surface} to all output {@link Surface Surfaces}
* included in the reprocess capture request. The reprocess input images must be generated from
* one or multiple output images captured from the same camera device. The application can
- * provide input images to camera device via
- * {{@link android.media.ImageWriter#queueInputImage ImageWriter#queueInputImage}}.
+ * provide input images to camera device via {@link android.media.ImageWriter#queueInputImage}.
* The application must use the capture result of one of those output images to create a
* reprocess capture request so that the camera device can use the information to achieve
* optimal reprocess image quality.
@@ -618,7 +617,7 @@ public abstract class CameraDevice implements AutoCloseable {
*
* @see CaptureRequest.Builder
* @see TotalCaptureResult
- * @see CameraDevice#createReprocessibleCaptureSession
+ * @see CameraDevice#createReprocessableCaptureSession
* @see android.media.ImageWriter
*/
public abstract CaptureRequest.Builder createReprocessCaptureRequest(
diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java
index 9327f00..d99cce7 100644
--- a/core/java/android/hardware/camera2/CameraManager.java
+++ b/core/java/android/hardware/camera2/CameraManager.java
@@ -556,7 +556,7 @@ public final class CameraManager {
* {@link CameraManager#registerTorchCallback} to be notified of such status changes.
* </p>
*
- * @see registerTorchCallback
+ * @see #registerTorchCallback
*/
public static abstract class TorchCallback {
/**
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index ca9439b..6baa660 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -388,8 +388,8 @@ public abstract class CameraMetadata<TKey> {
* <li>{@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}</li>
* <li>{@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</li>
* <li>{@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</li>
- * <li>android.tonemap.gamma</li>
- * <li>android.tonemap.presetCurve</li>
+ * <li>{@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma}</li>
+ * <li>{@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve}</li>
* </ul>
* </li>
* <li>
@@ -429,8 +429,10 @@ public abstract class CameraMetadata<TKey> {
* @see CaptureRequest#SHADING_MODE
* @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
* @see CaptureRequest#TONEMAP_CURVE
+ * @see CaptureRequest#TONEMAP_GAMMA
* @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
* @see CaptureRequest#TONEMAP_MODE
+ * @see CaptureRequest#TONEMAP_PRESET_CURVE
* @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
*/
public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2;
@@ -472,7 +474,7 @@ public abstract class CameraMetadata<TKey> {
* <li>{@link android.graphics.ImageFormat#PRIVATE } will be reprocessable into both
* {@link android.graphics.ImageFormat#YUV_420_888 } and
* {@link android.graphics.ImageFormat#JPEG } formats.</li>
- * <li>The maximum available resolution for OPAQUE streams
+ * <li>The maximum available resolution for PRIVATE streams
* (both input/output) will match the maximum available
* resolution of JPEG streams.</li>
* <li>Static metadata {@link CameraCharacteristics#REPROCESS_MAX_CAPTURE_STALL android.reprocess.maxCaptureStall}.</li>
@@ -492,7 +494,7 @@ public abstract class CameraMetadata<TKey> {
* @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
* @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
*/
- public static final int REQUEST_AVAILABLE_CAPABILITIES_OPAQUE_REPROCESSING = 4;
+ public static final int REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4;
/**
* <p>The camera device supports accurately reporting the sensor settings for many of
@@ -565,7 +567,7 @@ public abstract class CameraMetadata<TKey> {
/**
* <p>The camera device supports the YUV_420_888 reprocessing use case, similar as
- * OPAQUE_REPROCESSING, This capability requires the camera device to support the
+ * PRIVATE_REPROCESSING, This capability requires the camera device to support the
* following:</p>
* <ul>
* <li>One input stream is supported, that is, <code>{@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} == 1</code>.</li>
@@ -2185,22 +2187,26 @@ public abstract class CameraMetadata<TKey> {
public static final int TONEMAP_MODE_HIGH_QUALITY = 2;
/**
- * <p>Use the gamma value specified in android.tonemap.gamma to peform
+ * <p>Use the gamma value specified in {@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma} to peform
* tonemapping.</p>
* <p>All color enhancement and tonemapping must be disabled, except
- * for applying the tonemapping curve specified by android.tonemap.gamma.</p>
+ * for applying the tonemapping curve specified by {@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma}.</p>
* <p>Must not slow down frame rate relative to raw sensor output.</p>
+ *
+ * @see CaptureRequest#TONEMAP_GAMMA
* @see CaptureRequest#TONEMAP_MODE
*/
public static final int TONEMAP_MODE_GAMMA_VALUE = 3;
/**
* <p>Use the preset tonemapping curve specified in
- * android.tonemap.presetCurve to peform tonemapping.</p>
+ * {@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve} to peform tonemapping.</p>
* <p>All color enhancement and tonemapping must be disabled, except
* for applying the tonemapping curve specified by
- * android.tonemap.presetCurve.</p>
+ * {@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve}.</p>
* <p>Must not slow down frame rate relative to raw sensor output.</p>
+ *
+ * @see CaptureRequest#TONEMAP_PRESET_CURVE
* @see CaptureRequest#TONEMAP_MODE
*/
public static final int TONEMAP_MODE_PRESET_CURVE = 4;
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index ab6ce91..3ec11b7 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -158,9 +158,9 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
private final HashSet<Surface> mSurfaceSet;
private final CameraMetadataNative mSettings;
private boolean mIsReprocess;
- // Each reprocess request must be tied to a reprocessible session ID.
+ // Each reprocess request must be tied to a reprocessable session ID.
// Valid only for reprocess requests (mIsReprocess == true).
- private int mReprocessibleSessionId;
+ private int mReprocessableSessionId;
private Object mUserTag;
@@ -173,7 +173,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
mSettings = new CameraMetadataNative();
mSurfaceSet = new HashSet<Surface>();
mIsReprocess = false;
- mReprocessibleSessionId = CameraCaptureSession.SESSION_ID_NONE;
+ mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
}
/**
@@ -186,7 +186,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
mSettings = new CameraMetadataNative(source.mSettings);
mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone();
mIsReprocess = source.mIsReprocess;
- mReprocessibleSessionId = source.mReprocessibleSessionId;
+ mReprocessableSessionId = source.mReprocessableSessionId;
mUserTag = source.mUserTag;
}
@@ -199,30 +199,30 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* @param isReprocess Indicates whether to create a reprocess capture request. {@code true}
* to create a reprocess capture request. {@code false} to create a regular
* capture request.
- * @param reprocessibleSessionId The ID of the camera capture session this capture is created
+ * @param reprocessableSessionId The ID of the camera capture session this capture is created
* for. This is used to validate if the application submits a
* reprocess capture request to the same session where
* the {@link TotalCaptureResult}, used to create the reprocess
* capture, came from.
*
* @throws IllegalArgumentException If creating a reprocess capture request with an invalid
- * reprocessibleSessionId.
+ * reprocessableSessionId.
*
* @see CameraDevice#createReprocessCaptureRequest
*/
private CaptureRequest(CameraMetadataNative settings, boolean isReprocess,
- int reprocessibleSessionId) {
+ int reprocessableSessionId) {
mSettings = CameraMetadataNative.move(settings);
mSurfaceSet = new HashSet<Surface>();
mIsReprocess = isReprocess;
if (isReprocess) {
- if (reprocessibleSessionId == CameraCaptureSession.SESSION_ID_NONE) {
+ if (reprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
throw new IllegalArgumentException("Create a reprocess capture request with an " +
- "invalid session ID: " + reprocessibleSessionId);
+ "invalid session ID: " + reprocessableSessionId);
}
- mReprocessibleSessionId = reprocessibleSessionId;
+ mReprocessableSessionId = reprocessableSessionId;
} else {
- mReprocessibleSessionId = CameraCaptureSession.SESSION_ID_NONE;
+ mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
}
}
@@ -307,20 +307,20 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
}
/**
- * Get the reprocessible session ID this reprocess capture request is associated with.
+ * Get the reprocessable session ID this reprocess capture request is associated with.
*
- * @return the reprocessible session ID this reprocess capture request is associated with
+ * @return the reprocessable session ID this reprocess capture request is associated with
*
* @throws IllegalStateException if this capture request is not a reprocess capture request.
* @hide
*/
- public int getReprocessibleSessionId() {
+ public int getReprocessableSessionId() {
if (mIsReprocess == false ||
- mReprocessibleSessionId == CameraCaptureSession.SESSION_ID_NONE) {
- throw new IllegalStateException("Getting the reprocessible session ID for a "+
+ mReprocessableSessionId == CameraCaptureSession.SESSION_ID_NONE) {
+ throw new IllegalStateException("Getting the reprocessable session ID for a "+
"non-reprocess capture request is illegal.");
}
- return mReprocessibleSessionId;
+ return mReprocessableSessionId;
}
/**
@@ -346,7 +346,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
&& mSurfaceSet.equals(other.mSurfaceSet)
&& mSettings.equals(other.mSettings)
&& mIsReprocess == other.mIsReprocess
- && mReprocessibleSessionId == other.mReprocessibleSessionId;
+ && mReprocessableSessionId == other.mReprocessableSessionId;
}
@Override
@@ -395,7 +395,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
}
mIsReprocess = (in.readInt() == 0) ? false : true;
- mReprocessibleSessionId = CameraCaptureSession.SESSION_ID_NONE;
+ mReprocessableSessionId = CameraCaptureSession.SESSION_ID_NONE;
}
@Override
@@ -450,19 +450,19 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* @param reprocess Indicates whether to create a reprocess capture request. {@code true}
* to create a reprocess capture request. {@code false} to create a regular
* capture request.
- * @param reprocessibleSessionId The ID of the camera capture session this capture is
+ * @param reprocessableSessionId The ID of the camera capture session this capture is
* created for. This is used to validate if the application
* submits a reprocess capture request to the same session
* where the {@link TotalCaptureResult}, used to create the
* reprocess capture, came from.
*
* @throws IllegalArgumentException If creating a reprocess capture request with an invalid
- * reprocessibleSessionId.
+ * reprocessableSessionId.
* @hide
*/
public Builder(CameraMetadataNative template, boolean reprocess,
- int reprocessibleSessionId) {
- mRequest = new CaptureRequest(template, reprocess, reprocessibleSessionId);
+ int reprocessableSessionId) {
+ mRequest = new CaptureRequest(template, reprocess, reprocessableSessionId);
}
/**
@@ -1275,7 +1275,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* <p>This control (except for MANUAL) is only effective if
* <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
* <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
- * contains OPAQUE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if
+ * contains PRIVATE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if
* {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR. Other intent values are
* always supported.</p>
* <p><b>Possible values:</b>
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index 3dc8970..d931a76 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -1698,7 +1698,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* <p>This control (except for MANUAL) is only effective if
* <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
* <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
- * contains OPAQUE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if
+ * contains PRIVATE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if
* {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR. Other intent values are
* always supported.</p>
* <p><b>Possible values:</b>
diff --git a/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java b/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
index dff6227..d08c52b 100644
--- a/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
@@ -153,10 +153,10 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
Handler handler) throws CameraAccessException {
if (request == null) {
throw new IllegalArgumentException("request must not be null");
- } else if (request.isReprocess() && !isReprocessible()) {
+ } else if (request.isReprocess() && !isReprocessable()) {
throw new IllegalArgumentException("this capture session cannot handle reprocess " +
"requests");
- } else if (request.isReprocess() && request.getReprocessibleSessionId() != mId) {
+ } else if (request.isReprocess() && request.getReprocessableSessionId() != mId) {
throw new IllegalArgumentException("capture request was created for another session");
}
@@ -184,10 +184,10 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
for (CaptureRequest request : requests) {
if (request.isReprocess()) {
- if (!isReprocessible()) {
+ if (!isReprocessable()) {
throw new IllegalArgumentException("This capture session cannot handle " +
"reprocess requests");
- } else if (request.getReprocessibleSessionId() != mId) {
+ } else if (request.getReprocessableSessionId() != mId) {
throw new IllegalArgumentException("Capture request was created for another " +
"session");
}
@@ -293,7 +293,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
}
@Override
- public boolean isReprocessible() {
+ public boolean isReprocessable() {
return mInput != null;
}
diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
index e84b46a..4508dc8 100644
--- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
@@ -480,16 +480,16 @@ public class CameraDeviceImpl extends CameraDevice {
}
@Override
- public void createReprocessibleCaptureSession(InputConfiguration inputConfig,
+ public void createReprocessableCaptureSession(InputConfiguration inputConfig,
List<Surface> outputs, CameraCaptureSession.StateCallback callback, Handler handler)
throws CameraAccessException {
if (DEBUG) {
- Log.d(TAG, "createReprocessibleCaptureSession");
+ Log.d(TAG, "createReprocessableCaptureSession");
}
if (inputConfig == null) {
throw new IllegalArgumentException("inputConfig cannot be null when creating a " +
- "reprocessible capture session");
+ "reprocessable capture session");
}
List<OutputConfiguration> outConfigurations = new ArrayList<>(outputs.size());
for (Surface surface : outputs) {
diff --git a/core/java/android/hardware/camera2/params/InputConfiguration.java b/core/java/android/hardware/camera2/params/InputConfiguration.java
index dea1c5c..0c642cf 100644
--- a/core/java/android/hardware/camera2/params/InputConfiguration.java
+++ b/core/java/android/hardware/camera2/params/InputConfiguration.java
@@ -19,11 +19,11 @@ package android.hardware.camera2.params;
import android.hardware.camera2.utils.HashCodeHelpers;
/**
- * Immutable class to store an input configuration that is used to create a reprocessible capture
+ * Immutable class to store an input configuration that is used to create a reprocessable capture
* session.
*
- * @see CameraDevice#createReprocessibleCaptureSession
- * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
+ * @see android.hardware.camera2.CameraDevice#createReprocessableCaptureSession
+ * @see android.hardware.camera2.CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
*/
public final class InputConfiguration {
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index cc37d5e..3dee68c 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -936,7 +936,7 @@ public class UserManager {
* Returns list of the profiles of userHandle including
* userHandle itself.
* Note that this returns both enabled and not enabled profiles. See
- * {@link #getUserProfiles()} if you need only the enabled ones.
+ * {@link #getEnabledProfiles(int)} if you need only the enabled ones.
*
* Requires {@link android.Manifest.permission#MANAGE_USERS} permission.
* @param userHandle profiles of this user will be returned.
@@ -953,6 +953,25 @@ public class UserManager {
}
/**
+ * Returns list of the profiles of userHandle including
+ * userHandle itself.
+ * Note that this returns only enabled.
+ *
+ * Requires {@link android.Manifest.permission#MANAGE_USERS} permission.
+ * @param userHandle profiles of this user will be returned.
+ * @return the list of profiles.
+ * @hide
+ */
+ public List<UserInfo> getEnabledProfiles(int userHandle) {
+ try {
+ return mService.getProfiles(userHandle, true /* enabledOnly */);
+ } catch (RemoteException re) {
+ Log.w(TAG, "Could not get user list", re);
+ return null;
+ }
+ }
+
+ /**
* Returns a list of UserHandles for profiles associated with the user that the calling process
* is running on, including the user itself.
*
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java
index 85b22fb..d70712a 100644
--- a/core/java/android/view/TextureView.java
+++ b/core/java/android/view/TextureView.java
@@ -717,6 +717,14 @@ public class TextureView extends View {
if (surfaceTexture == null) {
throw new NullPointerException("surfaceTexture must not be null");
}
+ if (surfaceTexture == mSurface) {
+ throw new IllegalArgumentException("Trying to setSurfaceTexture to " +
+ "the same SurfaceTexture that's already set.");
+ }
+ if (surfaceTexture.isReleased()) {
+ throw new IllegalArgumentException("Cannot setSurfaceTexture to a " +
+ "released SurfaceTexture");
+ }
if (mSurface != null) {
mSurface.release();
}
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index c785149..42e6766 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -1011,6 +1011,10 @@ public class AccessibilityNodeInfo implements Parcelable {
public void addAction(AccessibilityAction action) {
enforceNotSealed();
+ addActionUnchecked(action);
+ }
+
+ private void addActionUnchecked(AccessibilityAction action) {
if (action == null) {
return;
}
@@ -2846,9 +2850,9 @@ public class AccessibilityNodeInfo implements Parcelable {
addLegacyStandardActions(legacyStandardActions);
final int nonLegacyActionCount = actionCount - Integer.bitCount(legacyStandardActions);
for (int i = 0; i < nonLegacyActionCount; i++) {
- AccessibilityAction action = new AccessibilityAction(
+ final AccessibilityAction action = new AccessibilityAction(
parcel.readInt(), parcel.readCharSequence());
- addAction(action);
+ addActionUnchecked(action);
}
}
diff --git a/core/java/android/webkit/WebResourceError.java b/core/java/android/webkit/WebResourceError.java
index 11f1b6f..90693f3 100644
--- a/core/java/android/webkit/WebResourceError.java
+++ b/core/java/android/webkit/WebResourceError.java
@@ -36,8 +36,11 @@ public abstract class WebResourceError {
* and thus can be used for communicating the problem to the user.
*
* @return The description of the error
+ *
+ * Will become abstract after updated WebView.apk will be submitted
+ * into the Android tree.
*/
- public abstract CharSequence getDescription();
+ public CharSequence getDescription() { return ""; }
/**
* This class can not be subclassed by applications.
diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp
index 35d69fe..08d61d5 100644
--- a/core/jni/android/graphics/SurfaceTexture.cpp
+++ b/core/jni/android/graphics/SurfaceTexture.cpp
@@ -341,6 +341,12 @@ static void SurfaceTexture_release(JNIEnv* env, jobject thiz)
surfaceTexture->abandon();
}
+static jboolean SurfaceTexture_isReleased(JNIEnv* env, jobject thiz)
+{
+ sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
+ return surfaceTexture->isAbandoned();
+}
+
// ----------------------------------------------------------------------------
static JNINativeMethod gSurfaceTextureMethods[] = {
@@ -355,6 +361,7 @@ static JNINativeMethod gSurfaceTextureMethods[] = {
{"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix },
{"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp },
{"nativeRelease", "()V", (void*)SurfaceTexture_release },
+ {"nativeIsReleased", "()Z", (void*)SurfaceTexture_isReleased },
};
int register_android_graphics_SurfaceTexture(JNIEnv* env)
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 38bbe66..470e345 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -1105,7 +1105,7 @@
intern filter data scheme is set to "http" or "https". When set to true, the intent filter
will need to use its data tag for getting the URIs to verify with.
- For each URI, an HTTPS network request will be done to <code>/.well-known/associations.json</code>
+ For each URI, an HTTPS network request will be done to <code>/.well-known/statements.json</code>
host to verify that the web site is okay with the app intercepting the URI.
-->
<attr name="autoVerify" format="boolean" />
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java
index f52c661..5c54324 100644
--- a/graphics/java/android/graphics/SurfaceTexture.java
+++ b/graphics/java/android/graphics/SurfaceTexture.java
@@ -347,6 +347,14 @@ public class SurfaceTexture {
nativeRelease();
}
+ /**
+ * Returns true if the SurfaceTexture was released
+ * @hide
+ */
+ public boolean isReleased() {
+ return nativeIsReleased();
+ }
+
@Override
protected void finalize() throws Throwable {
try {
@@ -383,6 +391,7 @@ public class SurfaceTexture {
private native int nativeAttachToGLContext(int texName);
private native int nativeGetQueuedCount();
private native void nativeRelease();
+ private native boolean nativeIsReleased();
/*
* We use a class initializer to allow the native code to cache some
diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java
index 871715e..e1975c9 100644
--- a/graphics/java/android/graphics/drawable/AnimationDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java
@@ -151,7 +151,9 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An
mAnimating = true;
if (!isRunning()) {
- run();
+ // Start from 0th frame.
+ setFrame(0, false, mAnimationState.getChildCount() > 1
+ || !mAnimationState.mOneShot);
}
}
diff --git a/graphics/java/android/graphics/drawable/Icon.java b/graphics/java/android/graphics/drawable/Icon.java
index 668a14a..0366246 100644
--- a/graphics/java/android/graphics/drawable/Icon.java
+++ b/graphics/java/android/graphics/drawable/Icon.java
@@ -228,6 +228,7 @@ public final class Icon implements Parcelable {
getResPackage()),
e);
}
+ break;
case TYPE_DATA:
return new BitmapDrawable(context.getResources(),
BitmapFactory.decodeByteArray(getDataBytes(), getDataOffset(), getDataLength())
diff --git a/media/java/android/media/Image.java b/media/java/android/media/Image.java
index 195c987..e18e9a3 100644
--- a/media/java/android/media/Image.java
+++ b/media/java/android/media/Image.java
@@ -163,10 +163,12 @@ public abstract class Image implements AutoCloseable {
* Get the timestamp associated with this frame.
* <p>
* The timestamp is measured in nanoseconds, and is normally monotonically
- * increasing. However, the behavior of the timestamp depends on the source
- * of this image. See {@link android.hardware.Camera Camera},
- * {@link android.hardware.camera2.CameraDevice CameraDevice}, {@link MediaPlayer} and
- * {@link MediaCodec} for more details.
+ * increasing. The timestamps for the images from different sources may have
+ * different timebases therefore may not be comparable. The specific meaning and
+ * timebase of the timestamp depend on the source providing images. See
+ * {@link android.hardware.Camera Camera},
+ * {@link android.hardware.camera2.CameraDevice CameraDevice},
+ * {@link MediaPlayer} and {@link MediaCodec} for more details.
* </p>
*/
public abstract long getTimestamp();
@@ -175,9 +177,11 @@ public abstract class Image implements AutoCloseable {
* Set the timestamp associated with this frame.
* <p>
* The timestamp is measured in nanoseconds, and is normally monotonically
- * increasing. However, the behavior of the timestamp depends on
- * the destination of this image. See {@link android.hardware.Camera Camera}
- * , {@link android.hardware.camera2.CameraDevice CameraDevice},
+ * increasing. The timestamps for the images from different sources may have
+ * different timebases therefore may not be comparable. The specific meaning and
+ * timebase of the timestamp depend on the source providing images. See
+ * {@link android.hardware.Camera Camera},
+ * {@link android.hardware.camera2.CameraDevice CameraDevice},
* {@link MediaPlayer} and {@link MediaCodec} for more details.
* </p>
* <p>
@@ -195,18 +199,6 @@ public abstract class Image implements AutoCloseable {
return;
}
- /**
- * <p>Check if the image is opaque.</p>
- *
- * <p>The pixel data of opaque images are not accessible to the application,
- * and therefore {@link #getPlanes} will return an empty array for an opaque image.
- * </p>
- */
- public boolean isOpaque() {
- throwISEIfImageIsInvalid();
- return false;
- }
-
private Rect mCropRect;
/**
@@ -243,10 +235,11 @@ public abstract class Image implements AutoCloseable {
/**
* Get the array of pixel planes for this Image. The number of planes is
- * determined by the format of the Image. The application will get an
- * empty array if the image is opaque because the opaque image pixel data
- * is not directly accessible. The application can check if an image is
- * opaque by calling {@link Image#isOpaque}.
+ * determined by the format of the Image. The application will get an empty
+ * array if the image format is {@link android.graphics.ImageFormat#PRIVATE
+ * PRIVATE}, because the image pixel data is not directly accessible. The
+ * application can check the image format by calling
+ * {@link Image#getFormat()}.
*/
public abstract Plane[] getPlanes();
diff --git a/media/java/android/media/ImageReader.java b/media/java/android/media/ImageReader.java
index 6d30208..9bd721a 100644
--- a/media/java/android/media/ImageReader.java
+++ b/media/java/android/media/ImageReader.java
@@ -68,76 +68,45 @@ public class ImageReader implements AutoCloseable {
private static final int ACQUIRE_MAX_IMAGES = 2;
/**
- * <p>Create a new reader for images of the desired size and format.</p>
- *
- * <p>The {@code maxImages} parameter determines the maximum number of {@link Image}
- * objects that can be be acquired from the {@code ImageReader}
- * simultaneously. Requesting more buffers will use up more memory, so it is
- * important to use only the minimum number necessary for the use case.</p>
- *
- * <p>The valid sizes and formats depend on the source of the image
- * data.</p>
- *
- * @param width
- * The default width in pixels of the Images that this reader will produce.
- * @param height
- * The default height in pixels of the Images that this reader will produce.
- * @param format
- * The format of the Image that this reader will produce. This
- * must be one of the {@link android.graphics.ImageFormat} or
- * {@link android.graphics.PixelFormat} constants. Note that
- * not all formats is supported, like ImageFormat.NV21.
- * @param maxImages
- * The maximum number of images the user will want to
- * access simultaneously. This should be as small as possible to limit
- * memory use. Once maxImages Images are obtained by the user, one of them
- * has to be released before a new Image will become available for access
- * through {@link #acquireLatestImage()} or {@link #acquireNextImage()}.
- * Must be greater than 0.
- *
- * @see Image
- */
- public static ImageReader newInstance(int width, int height, int format, int maxImages) {
- if (format == ImageFormat.PRIVATE) {
- throw new IllegalArgumentException("To obtain an opaque ImageReader, please use"
- + " newOpaqueInstance rather than newInstance");
- }
- return new ImageReader(width, height, format, maxImages);
- }
-
- /**
- * <p>
- * Create a new opaque reader for images of the desired size.
- * </p>
* <p>
- * An opaque {@link ImageReader} produces images that are not directly
- * accessible by the application. The application can still acquire images
- * from an opaque image reader, and send them to the
- * {@link android.hardware.camera2.CameraDevice camera} for reprocessing via
- * {@link ImageWriter} interface. However, the {@link Image#getPlanes()
- * getPlanes()} will return an empty array for opaque images. The
- * application can check if an existing reader is an opaque reader by
- * calling {@link #isOpaque()}.
+ * Create a new reader for images of the desired size and format.
* </p>
* <p>
* The {@code maxImages} parameter determines the maximum number of
* {@link Image} objects that can be be acquired from the
* {@code ImageReader} simultaneously. Requesting more buffers will use up
- * more memory, so it is important to use only the minimum number necessary.
+ * more memory, so it is important to use only the minimum number necessary
+ * for the use case.
* </p>
* <p>
* The valid sizes and formats depend on the source of the image data.
* </p>
* <p>
- * Opaque ImageReaders are more efficient to use when application access to
- * image data is not necessary, compared to ImageReaders using a non-opaque
- * format such as {@link ImageFormat#YUV_420_888 YUV_420_888}.
+ * If the {@code format} is {@link ImageFormat#PRIVATE PRIVATE}, the created
+ * {@link ImageReader} will produce images that are not directly accessible
+ * by the application. The application can still acquire images from this
+ * {@link ImageReader}, and send them to the
+ * {@link android.hardware.camera2.CameraDevice camera} for reprocessing via
+ * {@link ImageWriter} interface. However, the {@link Image#getPlanes()
+ * getPlanes()} will return an empty array for {@link ImageFormat#PRIVATE
+ * PRIVATE} format images. The application can check if an existing reader's
+ * format by calling {@link #getImageFormat()}.
+ * </p>
+ * <p>
+ * {@link ImageFormat#PRIVATE PRIVATE} format {@link ImageReader
+ * ImageReaders} are more efficient to use when application access to image
+ * data is not necessary, compared to ImageReaders using other format such
+ * as {@link ImageFormat#YUV_420_888 YUV_420_888}.
* </p>
*
* @param width The default width in pixels of the Images that this reader
* will produce.
* @param height The default height in pixels of the Images that this reader
* will produce.
+ * @param format The format of the Image that this reader will produce. This
+ * must be one of the {@link android.graphics.ImageFormat} or
+ * {@link android.graphics.PixelFormat} constants. Note that not
+ * all formats are supported, like ImageFormat.NV21.
* @param maxImages The maximum number of images the user will want to
* access simultaneously. This should be as small as possible to
* limit memory use. Once maxImages Images are obtained by the
@@ -147,8 +116,8 @@ public class ImageReader implements AutoCloseable {
* Must be greater than 0.
* @see Image
*/
- public static ImageReader newOpaqueInstance(int width, int height, int maxImages) {
- return new ImageReader(width, height, ImageFormat.PRIVATE, maxImages);
+ public static ImageReader newInstance(int width, int height, int format, int maxImages) {
+ return new ImageReader(width, height, format, maxImages);
}
/**
@@ -248,23 +217,6 @@ public class ImageReader implements AutoCloseable {
}
/**
- * <p>
- * Check if the {@link ImageReader} is an opaque reader.
- * </p>
- * <p>
- * An opaque image reader produces opaque images, see {@link Image#isOpaque}
- * for more details.
- * </p>
- *
- * @return true if the ImageReader is opaque.
- * @see Image#isOpaque
- * @see ImageReader#newOpaqueInstance
- */
- public boolean isOpaque() {
- return mFormat == ImageFormat.PRIVATE;
- }
-
- /**
* <p>Get a {@link Surface} that can be used to produce {@link Image Images} for this
* {@code ImageReader}.</p>
*
@@ -540,11 +492,11 @@ public class ImageReader implements AutoCloseable {
* </p>
* <p>
* This method can be used to achieve zero buffer copy for use cases like
- * {@link android.hardware.camera2.CameraDevice Camera2 API} OPAQUE and YUV
+ * {@link android.hardware.camera2.CameraDevice Camera2 API} PRIVATE and YUV
* reprocessing, where the application can select an output image from
* {@link ImageReader} and transfer this image directly to
* {@link ImageWriter}, where this image can be consumed by camera directly.
- * For OPAQUE reprocessing, this is the only way to send input buffers to
+ * For PRIVATE reprocessing, this is the only way to send input buffers to
* the {@link android.hardware.camera2.CameraDevice camera} for
* reprocessing.
* </p>
@@ -703,26 +655,26 @@ public class ImageReader implements AutoCloseable {
@Override
public int getFormat() {
throwISEIfImageIsInvalid();
+ int readerFormat = ImageReader.this.getImageFormat();
+ // Assume opaque reader always produce opaque images.
+ mFormat = (readerFormat == ImageFormat.PRIVATE) ? readerFormat :
+ nativeGetFormat(readerFormat);
return mFormat;
}
@Override
public int getWidth() {
throwISEIfImageIsInvalid();
- if (mWidth == -1) {
- mWidth = (getFormat() == ImageFormat.JPEG) ? ImageReader.this.getWidth() :
- nativeGetWidth(mFormat);
- }
+ mWidth = (getFormat() == ImageFormat.JPEG) ? ImageReader.this.getWidth() :
+ nativeGetWidth(mFormat);
return mWidth;
}
@Override
public int getHeight() {
throwISEIfImageIsInvalid();
- if (mHeight == -1) {
- mHeight = (getFormat() == ImageFormat.JPEG) ? ImageReader.this.getHeight() :
- nativeGetHeight(mFormat);
- }
+ mHeight = (getFormat() == ImageFormat.JPEG) ? ImageReader.this.getHeight() :
+ nativeGetHeight(mFormat);
return mHeight;
}
@@ -746,12 +698,6 @@ public class ImageReader implements AutoCloseable {
}
@Override
- public boolean isOpaque() {
- throwISEIfImageIsInvalid();
- return mFormat == ImageFormat.PRIVATE;
- }
-
- @Override
protected final void finalize() throws Throwable {
try {
close();
@@ -876,6 +822,7 @@ public class ImageReader implements AutoCloseable {
private synchronized native SurfacePlane nativeCreatePlane(int idx, int readerFormat);
private synchronized native int nativeGetWidth(int format);
private synchronized native int nativeGetHeight(int format);
+ private synchronized native int nativeGetFormat(int readerFormat);
}
private synchronized native void nativeInit(Object weakSelf, int w, int h,
diff --git a/media/java/android/media/ImageUtils.java b/media/java/android/media/ImageUtils.java
index 89313bf..c312525 100644
--- a/media/java/android/media/ImageUtils.java
+++ b/media/java/android/media/ImageUtils.java
@@ -57,7 +57,7 @@ class ImageUtils {
case ImageFormat.RAW_SENSOR:
case ImageFormat.RAW10:
return 1;
- case PixelFormat.OPAQUE:
+ case ImageFormat.PRIVATE:
return 0;
default:
throw new UnsupportedOperationException(
@@ -70,10 +70,11 @@ class ImageUtils {
* Copy source image data to destination Image.
* </p>
* <p>
- * Only support the copy between two non-opaque images with same properties
- * (format, size, etc.). The data from the source image will be copied to
- * the byteBuffers from the destination Image starting from position zero,
- * and the destination image will be rewound to zero after copy is done.
+ * Only support the copy between two non-{@link ImageFormat#PRIVATE PRIVATE} format
+ * images with same properties (format, size, etc.). The data from the
+ * source image will be copied to the byteBuffers from the destination Image
+ * starting from position zero, and the destination image will be rewound to
+ * zero after copy is done.
* </p>
*
* @param src The source image to be copied from.
@@ -88,8 +89,9 @@ class ImageUtils {
if (src.getFormat() != dst.getFormat()) {
throw new IllegalArgumentException("Src and dst images should have the same format");
}
- if (src.isOpaque() || dst.isOpaque()) {
- throw new IllegalArgumentException("Opaque image is not copyable");
+ if (src.getFormat() == ImageFormat.PRIVATE ||
+ dst.getFormat() == ImageFormat.PRIVATE) {
+ throw new IllegalArgumentException("PRIVATE format images are not copyable");
}
if (!(dst.getOwner() instanceof ImageWriter)) {
throw new IllegalArgumentException("Destination image is not from ImageWriter. Only"
diff --git a/media/java/android/media/ImageWriter.java b/media/java/android/media/ImageWriter.java
index f805339..2ef2519 100644
--- a/media/java/android/media/ImageWriter.java
+++ b/media/java/android/media/ImageWriter.java
@@ -33,8 +33,8 @@ import java.util.List;
/**
* <p>
* The ImageWriter class allows an application to produce Image data into a
- * {@link android.view.Surface}, and have it be consumed by another component like
- * {@link android.hardware.camera2.CameraDevice CameraDevice}.
+ * {@link android.view.Surface}, and have it be consumed by another component
+ * like {@link android.hardware.camera2.CameraDevice CameraDevice}.
* </p>
* <p>
* Several Android API classes can provide input {@link android.view.Surface
@@ -54,21 +54,21 @@ import java.util.List;
* <p>
* If the application already has an Image from {@link ImageReader}, the
* application can directly queue this Image into ImageWriter (via
- * {@link #queueInputImage}), potentially with zero buffer copies. For the opaque
- * Images produced by an opaque ImageReader (created by
- * {@link ImageReader#newOpaqueInstance}), this is the only way to send Image
- * data to ImageWriter, as the Image data aren't accessible by the application.
+ * {@link #queueInputImage}), potentially with zero buffer copies. For the
+ * {@link ImageFormat#PRIVATE PRIVATE} format Images produced by
+ * {@link ImageReader}, this is the only way to send Image data to ImageWriter,
+ * as the Image data aren't accessible by the application.
* </p>
- * Once new input Images are queued into an ImageWriter, it's up to the downstream
- * components (e.g. {@link ImageReader} or
+ * Once new input Images are queued into an ImageWriter, it's up to the
+ * downstream components (e.g. {@link ImageReader} or
* {@link android.hardware.camera2.CameraDevice}) to consume the Images. If the
* downstream components cannot consume the Images at least as fast as the
- * ImageWriter production rate, the {@link #dequeueInputImage} call will eventually
- * block and the application will have to drop input frames. </p>
+ * ImageWriter production rate, the {@link #dequeueInputImage} call will
+ * eventually block and the application will have to drop input frames. </p>
*/
public class ImageWriter implements AutoCloseable {
private final Object mListenerLock = new Object();
- private ImageListener mListener;
+ private OnImageReleasedListener mListener;
private ListenerHandler mListenerHandler;
private long mNativeContext;
@@ -168,32 +168,34 @@ public class ImageWriter implements AutoCloseable {
* This call will block if all available input images have been queued by
* the application and the downstream consumer has not yet consumed any.
* When an Image is consumed by the downstream consumer and released, an
- * {@link ImageListener#onInputImageReleased} callback will be fired, which
- * indicates that there is one input Image available. For non-opaque formats
- * (({@link ImageWriter#getFormat()} != {@link ImageFormat#PRIVATE})), it is
+ * {@link OnImageReleasedListener#onImageReleased} callback will be fired,
+ * which indicates that there is one input Image available. For non-
+ * {@link ImageFormat#PRIVATE PRIVATE} formats (
+ * {@link ImageWriter#getFormat()} != {@link ImageFormat#PRIVATE}), it is
* recommended to dequeue the next Image only after this callback is fired,
* in the steady state.
* </p>
* <p>
- * If the ImageWriter is opaque ({@link ImageWriter#getFormat()} ==
- * {@link ImageFormat#PRIVATE}), the image buffer is inaccessible to
- * the application, and calling this method will result in an
- * {@link IllegalStateException}. Instead, the application should acquire
- * opaque images from some other component (e.g. an opaque
+ * If the format of ImageWriter is {@link ImageFormat#PRIVATE PRIVATE} (
+ * {@link ImageWriter#getFormat()} == {@link ImageFormat#PRIVATE}), the
+ * image buffer is inaccessible to the application, and calling this method
+ * will result in an {@link IllegalStateException}. Instead, the application
+ * should acquire images from some other component (e.g. an
* {@link ImageReader}), and queue them directly to this ImageWriter via the
* {@link ImageWriter#queueInputImage queueInputImage()} method.
* </p>
*
* @return The next available input Image from this ImageWriter.
* @throws IllegalStateException if {@code maxImages} Images are currently
- * dequeued, or the ImageWriter is opaque.
+ * dequeued, or the ImageWriter format is
+ * {@link ImageFormat#PRIVATE PRIVATE}.
* @see #queueInputImage
* @see Image#close
*/
public Image dequeueInputImage() {
if (mWriterFormat == ImageFormat.PRIVATE) {
throw new IllegalStateException(
- "Opaque ImageWriter doesn't support this operation since opaque images are"
+ "PRIVATE format ImageWriter doesn't support this operation since the images are"
+ " inaccessible to the application!");
}
@@ -229,10 +231,10 @@ public class ImageWriter implements AutoCloseable {
* </p>
* <p>
* After this method is called and the downstream consumer consumes and
- * releases the Image, an {@link ImageListener#onInputImageReleased
- * onInputImageReleased()} callback will fire. The application can use this
- * callback to avoid sending Images faster than the downstream consumer
- * processing rate in steady state.
+ * releases the Image, an {@link OnImageReleasedListener#onImageReleased}
+ * callback will fire. The application can use this callback to avoid
+ * sending Images faster than the downstream consumer processing rate in
+ * steady state.
* </p>
* <p>
* Passing in an Image from some other component (e.g. an
@@ -271,12 +273,12 @@ public class ImageWriter implements AutoCloseable {
}
ImageReader prevOwner = (ImageReader) image.getOwner();
- // Only do the image attach for opaque images for now. Do the image
+ // Only do the image attach for PRIVATE format images for now. Do the image
// copy for other formats. TODO: use attach for other formats to
// improve the performance, and fall back to copy when attach/detach
// fails. Right now, detach is guaranteed to fail as the buffer is
// locked when ImageReader#acquireNextImage is called. See bug 19962027.
- if (image.isOpaque()) {
+ if (image.getFormat() == ImageFormat.PRIVATE) {
prevOwner.detachImage(image);
attachAndQueueInputImage(image);
// This clears the native reference held by the original owner.
@@ -319,8 +321,9 @@ public class ImageWriter implements AutoCloseable {
* Get the ImageWriter format.
* <p>
* This format may be different than the Image format returned by
- * {@link Image#getFormat()}. However, if the ImageWriter is opaque (format
- * == {@link ImageFormat#PRIVATE}) , the images from it will also be opaque.
+ * {@link Image#getFormat()}. However, if the ImageWriter format is
+ * {@link ImageFormat#PRIVATE PRIVATE}, calling {@link #dequeueInputImage()}
+ * will result in an {@link IllegalStateException}.
* </p>
*
* @return The ImageWriter format.
@@ -333,7 +336,7 @@ public class ImageWriter implements AutoCloseable {
* ImageWriter callback interface, used to to asynchronously notify the
* application of various ImageWriter events.
*/
- public interface ImageListener {
+ public interface OnImageReleasedListener {
/**
* <p>
* Callback that is called when an input Image is released back to
@@ -361,7 +364,7 @@ public class ImageWriter implements AutoCloseable {
* @see ImageWriter
* @see Image
*/
- void onInputImageReleased(ImageWriter writer);
+ void onImageReleased(ImageWriter writer);
}
/**
@@ -375,7 +378,7 @@ public class ImageWriter implements AutoCloseable {
* @throws IllegalArgumentException If no handler specified and the calling
* thread has no looper.
*/
- public void setImageListener(ImageListener listener, Handler handler) {
+ public void setOnImageReleasedListener(OnImageReleasedListener listener, Handler handler) {
synchronized (mListenerLock) {
if (listener != null) {
Looper looper = handler != null ? handler.getLooper() : Looper.myLooper();
@@ -408,7 +411,7 @@ public class ImageWriter implements AutoCloseable {
*/
@Override
public void close() {
- setImageListener(null, null);
+ setOnImageReleasedListener(null, null);
for (Image image : mDequeuedImages) {
image.close();
}
@@ -431,19 +434,18 @@ public class ImageWriter implements AutoCloseable {
* Attach and queue input Image to this ImageWriter.
* </p>
* <p>
- * When an Image is from an opaque source (e.g. an opaque ImageReader
- * created by {@link ImageReader#newOpaqueInstance}), or the source Image is
- * so large that copying its data is too expensive, this method can be used
- * to migrate the source Image into ImageWriter without a data copy, and
- * then queue it to this ImageWriter. The source Image must be detached from
- * its previous owner already, or this call will throw an
+ * When the format of an Image is {@link ImageFormat#PRIVATE PRIVATE}, or
+ * the source Image is so large that copying its data is too expensive, this
+ * method can be used to migrate the source Image into ImageWriter without a
+ * data copy, and then queue it to this ImageWriter. The source Image must
+ * be detached from its previous owner already, or this call will throw an
* {@link IllegalStateException}.
* </p>
* <p>
* After this call, the ImageWriter takes ownership of this Image. This
* ownership will automatically be removed from this writer after the
* consumer releases this Image, that is, after
- * {@link ImageListener#onInputImageReleased}. The caller is responsible for
+ * {@link OnImageReleasedListener#onImageReleased}. The caller is responsible for
* closing this Image through {@link Image#close()} to free up the resources
* held by this Image.
* </p>
@@ -492,12 +494,12 @@ public class ImageWriter implements AutoCloseable {
@Override
public void handleMessage(Message msg) {
- ImageListener listener;
+ OnImageReleasedListener listener;
synchronized (mListenerLock) {
listener = mListener;
}
if (listener != null) {
- listener.onInputImageReleased(ImageWriter.this);
+ listener.onImageReleased(ImageWriter.this);
}
}
}
@@ -647,13 +649,6 @@ public class ImageWriter implements AutoCloseable {
}
@Override
- public boolean isOpaque() {
- throwISEIfImageIsInvalid();
-
- return getFormat() == ImageFormat.PRIVATE;
- }
-
- @Override
public Plane[] getPlanes() {
throwISEIfImageIsInvalid();
diff --git a/media/java/android/media/MediaDataSource.java b/media/java/android/media/MediaDataSource.java
index 246c0ef..948da0b 100644
--- a/media/java/android/media/MediaDataSource.java
+++ b/media/java/android/media/MediaDataSource.java
@@ -18,6 +18,7 @@
package android.media;
import java.io.Closeable;
+import java.io.IOException;
/**
* For supplying media data to the framework. Implement this if your app has
@@ -29,34 +30,32 @@ import java.io.Closeable;
* you don't need to do your own synchronization unless you're modifying the
* MediaDataSource from another thread while it's being used by the framework.</p>
*/
-public interface MediaDataSource extends Closeable {
+public abstract class MediaDataSource implements Closeable {
/**
* Called to request data from the given position.
*
* Implementations should should write up to {@code size} bytes into
* {@code buffer}, and return the number of bytes written.
*
- * Return {@code 0} to indicate that {@code position} is at, or beyond, the
- * end of the source.
+ * Return {@code 0} if size is zero (thus no bytes are read).
*
- * Return {@code -1} to indicate that a fatal error occurred. The failed
- * read will not be retried, so transient errors should be handled
- * internally.
- *
- * Throwing an exception from this method will have the same effect as
- * returning {@code -1}.
+ * Return {@code -1} to indicate that end of stream is reached.
*
* @param position the position in the data source to read from.
* @param buffer the buffer to read the data into.
+ * @param offset the offset within buffer to read the data into.
* @param size the number of bytes to read.
+ * @throws IOException on fatal errors.
* @return the number of bytes read, or -1 if there was an error.
*/
- public int readAt(long position, byte[] buffer, int size);
+ public abstract int readAt(long position, byte[] buffer, int offset, int size)
+ throws IOException;
/**
* Called to get the size of the data source.
*
+ * @throws IOException on fatal errors
* @return the size of data source in bytes, or -1 if the size is unknown.
*/
- public long getSize();
+ public abstract long getSize() throws IOException;
}
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 256ab29..e3a6a83 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -1360,6 +1360,8 @@ public class MediaPlayer implements SubtitleController.Listener
* frequency.
* When rate is larger than 1.0, pitch becomes higher.
* When rate is smaller than 1.0, pitch becomes lower.
+ *
+ * @hide
*/
public static final int PLAYBACK_RATE_AUDIO_MODE_RESAMPLE = 2;
@@ -1372,6 +1374,8 @@ public class MediaPlayer implements SubtitleController.Listener
* <p>
* This mode is only supported for a limited range of playback speed factors,
* e.g. between 1/2x and 2x.
+ *
+ * @hide
*/
public static final int PLAYBACK_RATE_AUDIO_MODE_STRETCH = 1;
@@ -1383,6 +1387,8 @@ public class MediaPlayer implements SubtitleController.Listener
* Try to keep audio pitch when changing the playback rate, but allow the
* system to determine how to change audio playback if the rate is out
* of range.
+ *
+ * @hide
*/
public static final int PLAYBACK_RATE_AUDIO_MODE_DEFAULT = 0;
@@ -1406,8 +1412,11 @@ public class MediaPlayer implements SubtitleController.Listener
* @throws IllegalStateException if the internal player engine has not been
* initialized.
* @throws IllegalArgumentException if audioMode is not supported.
+ *
+ * @hide
*/
- public void setPlaybackRate(float rate, @PlaybackRateAudioMode int audioMode) {
+ @NonNull
+ public PlaybackParams easyPlaybackParams(float rate, @PlaybackRateAudioMode int audioMode) {
PlaybackParams params = new PlaybackParams();
params.allowDefaults();
switch (audioMode) {
@@ -1425,7 +1434,7 @@ public class MediaPlayer implements SubtitleController.Listener
final String msg = "Audio playback mode " + audioMode + " is not supported";
throw new IllegalArgumentException(msg);
}
- setPlaybackParams(params);
+ return params;
}
/**
@@ -1481,23 +1490,22 @@ public class MediaPlayer implements SubtitleController.Listener
public native void seekTo(int msec) throws IllegalStateException;
/**
- * Get current playback position.
+ * Get current playback position as a {@link MediaTimestamp}.
* <p>
* The MediaTimestamp represents how the media time correlates to the system time in
- * a linear fashion. It contains the media time and system timestamp of an anchor frame
- * ({@link MediaTimestamp#mediaTimeUs} and {@link MediaTimestamp#nanoTime})
- * and the speed of the media clock ({@link MediaTimestamp#clockRate}).
+ * a linear fashion using an anchor and a clock rate. During regular playback, the media
+ * time moves fairly constantly (though the anchor frame may be rebased to a current
+ * system time, the linear correlation stays steady). Therefore, this method does not
+ * need to be called often.
* <p>
- * During regular playback, the media time moves fairly constantly (though the
- * anchor frame may be rebased to a current system time, the linear correlation stays
- * steady). Therefore, this method does not need to be called often.
- * <p>
- * To help users to get current playback position, this method always returns the timestamp of
- * just-rendered frame, i.e., {@link System#nanoTime} and its corresponding media time. They
- * can be used as current playback position.
+ * To help users get current playback position, this method always anchors the timestamp
+ * to the current {@link System#nanoTime system time}, so
+ * {@link MediaTimestamp#getAnchorMediaTimeUs} can be used as current playback position.
*
* @return a MediaTimestamp object if a timestamp is available, or {@code null} if no timestamp
* is available, e.g. because the media player has not been initialized.
+ *
+ * @see MediaTimestamp
*/
@Nullable
public MediaTimestamp getTimestamp()
diff --git a/media/java/android/media/MediaSync.java b/media/java/android/media/MediaSync.java
index d9e554c..b07931d 100644
--- a/media/java/android/media/MediaSync.java
+++ b/media/java/android/media/MediaSync.java
@@ -352,89 +352,6 @@ public final class MediaSync {
public native final Surface createInputSurface();
/**
- * Resample audio data when changing playback speed.
- * <p>
- * Resample the waveform based on the requested playback rate to get
- * a new waveform, and play back the new waveform at the original sampling
- * frequency.
- * <p><ul>
- * <li>When rate is larger than 1.0, pitch becomes higher.
- * <li>When rate is smaller than 1.0, pitch becomes lower.
- * </ul>
- */
- public static final int PLAYBACK_RATE_AUDIO_MODE_RESAMPLE = 2;
-
- /**
- * Time stretch audio when changing playback speed.
- * <p>
- * Time stretching changes the duration of the audio samples without
- * affecting their pitch. This is only supported for a limited range
- * of playback speeds, e.g. from 1/2x to 2x. If the rate is adjusted
- * beyond this limit, the rate change will fail.
- */
- public static final int PLAYBACK_RATE_AUDIO_MODE_STRETCH = 1;
-
- /**
- * Time stretch audio when changing playback speed, and may mute if
- * stretching is no longer supported.
- * <p>
- * Time stretching changes the duration of the audio samples without
- * affecting their pitch. This is only supported for a limited range
- * of playback speeds, e.g. from 1/2x to 2x. When it is no longer
- * supported, the audio may be muted. Using this mode will not fail
- * for non-negative playback rates.
- */
- public static final int PLAYBACK_RATE_AUDIO_MODE_DEFAULT = 0;
-
- /** @hide */
- @IntDef(
- value = {
- PLAYBACK_RATE_AUDIO_MODE_DEFAULT,
- PLAYBACK_RATE_AUDIO_MODE_STRETCH,
- PLAYBACK_RATE_AUDIO_MODE_RESAMPLE,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface PlaybackRateAudioMode {}
-
- /**
- * Sets playback rate and audio mode.
- *
- * @param rate the ratio between desired playback rate and normal one. 1.0 means normal
- * playback speed. 0.0 means pause. Value larger than 1.0 means faster playback,
- * while value between 0.0 and 1.0 for slower playback. <b>Note:</b> the normal rate
- * does not change as a result of this call. To restore the original rate at any time,
- * use 1.0.
- * @param audioMode audio playback mode. Must be one of the supported
- * audio modes.
- *
- * @throws IllegalStateException if the internal sync engine or the audio track has not
- * been initialized.
- * @throws IllegalArgumentException if audioMode is not supported.
- */
- public void setPlaybackRate(float rate, @PlaybackRateAudioMode int audioMode) {
- PlaybackParams rateParams = new PlaybackParams();
- rateParams.allowDefaults();
- switch (audioMode) {
- case PLAYBACK_RATE_AUDIO_MODE_DEFAULT:
- rateParams.setSpeed(rate).setPitch(1.0f);
- break;
- case PLAYBACK_RATE_AUDIO_MODE_STRETCH:
- rateParams.setSpeed(rate).setPitch(1.0f)
- .setAudioFallbackMode(rateParams.AUDIO_FALLBACK_MODE_FAIL);
- break;
- case PLAYBACK_RATE_AUDIO_MODE_RESAMPLE:
- rateParams.setSpeed(rate).setPitch(rate);
- break;
- default:
- {
- final String msg = "Audio playback mode " + audioMode + " is not supported";
- throw new IllegalArgumentException(msg);
- }
- }
- setPlaybackParams(rateParams);
- }
-
- /**
* Sets playback rate using {@link PlaybackParams}.
* <p>
* When using MediaSync with {@link AudioTrack}, set playback params using this
@@ -524,24 +441,23 @@ public final class MediaSync {
}
/**
- * Get current playback position.
- * <p>
- * The MediaTimestamp represents how the media time correlates to the system time in
- * a linear fashion. It contains the media time and system timestamp of an anchor frame
- * ({@link MediaTimestamp#mediaTimeUs} and {@link MediaTimestamp#nanoTime})
- * and the speed of the media clock ({@link MediaTimestamp#clockRate}).
- * <p>
- * During regular playback, the media time moves fairly constantly (though the
- * anchor frame may be rebased to a current system time, the linear correlation stays
- * steady). Therefore, this method does not need to be called often.
- * <p>
- * To help users to get current playback position, this method always returns the timestamp of
- * just-rendered frame, i.e., {@link System#nanoTime} and its corresponding media time. They
- * can be used as current playback position.
- *
- * @return a MediaTimestamp object if a timestamp is available, or {@code null} if no timestamp
- * is available, e.g. because the media sync has not been initialized.
- */
+ * Get current playback position.
+ * <p>
+ * The MediaTimestamp represents how the media time correlates to the system time in
+ * a linear fashion using an anchor and a clock rate. During regular playback, the media
+ * time moves fairly constantly (though the anchor frame may be rebased to a current
+ * system time, the linear correlation stays steady). Therefore, this method does not
+ * need to be called often.
+ * <p>
+ * To help users get current playback position, this method always anchors the timestamp
+ * to the current {@link System#nanoTime system time}, so
+ * {@link MediaTimestamp#getAnchorMediaTimeUs} can be used as current playback position.
+ *
+ * @return a MediaTimestamp object if a timestamp is available, or {@code null} if no timestamp
+ * is available, e.g. because the media player has not been initialized.
+ *
+ * @see MediaTimestamp
+ */
@Nullable
public MediaTimestamp getTimestamp()
{
diff --git a/media/java/android/media/MediaTimestamp.java b/media/java/android/media/MediaTimestamp.java
index d3d5618..5ea6bbe 100644
--- a/media/java/android/media/MediaTimestamp.java
+++ b/media/java/android/media/MediaTimestamp.java
@@ -37,22 +37,36 @@ package android.media;
public final class MediaTimestamp
{
/**
- * Media time in microseconds.
+ * Get the media time of the anchor in microseconds.
*/
- public final long mediaTimeUs;
+ public long getAnchorMediaTimeUs() {
+ return mediaTimeUs;
+ }
/**
- * The {@link java.lang.System#nanoTime system time} corresponding to the media time
+ * Get the {@link java.lang.System#nanoTime system time} corresponding to the media time
* in nanoseconds.
*/
- public final long nanoTime;
+ public long getAnchorSytemNanoTime() {
+ return nanoTime;
+ }
/**
- * The rate of the media clock in relation to the system time.
+ * Get the rate of the media clock in relation to the system time.
+ * <p>
* It is 1.0 if media clock advances in sync with the system clock;
* greater than 1.0 if media clock is faster than the system clock;
* less than 1.0 if media clock is slower than the system clock.
*/
+ public float getMediaClockRate() {
+ return clockRate;
+ }
+
+ /** @hide - accessor shorthand */
+ public final long mediaTimeUs;
+ /** @hide - accessor shorthand */
+ public final long nanoTime;
+ /** @hide - accessor shorthand */
public final float clockRate;
/** @hide */
diff --git a/media/jni/android_media_ImageReader.cpp b/media/jni/android_media_ImageReader.cpp
index 043e20b..49614bd 100644
--- a/media/jni/android_media_ImageReader.cpp
+++ b/media/jni/android_media_ImageReader.cpp
@@ -1222,6 +1222,19 @@ static jint Image_getHeight(JNIEnv* env, jobject thiz, jint format)
}
}
+static jint Image_getFormat(JNIEnv* env, jobject thiz, jint readerFormat)
+{
+ if (isFormatOpaque(readerFormat)) {
+ // Assuming opaque reader produce opaque images.
+ return static_cast<jint>(PublicFormat::PRIVATE);
+ } else {
+ CpuConsumer::LockedBuffer* buffer = Image_getLockedBuffer(env, thiz);
+ PublicFormat publicFmt = android_view_Surface_mapHalFormatDataspaceToPublicFormat(
+ buffer->flexFormat, buffer->dataSpace);
+ return static_cast<jint>(publicFmt);
+ }
+}
+
} // extern "C"
// ----------------------------------------------------------------------------
@@ -1240,8 +1253,9 @@ static JNINativeMethod gImageMethods[] = {
{"nativeImageGetBuffer", "(II)Ljava/nio/ByteBuffer;", (void*)Image_getByteBuffer },
{"nativeCreatePlane", "(II)Landroid/media/ImageReader$SurfaceImage$SurfacePlane;",
(void*)Image_createSurfacePlane },
- {"nativeGetWidth", "(I)I", (void*)Image_getWidth },
- {"nativeGetHeight", "(I)I", (void*)Image_getHeight },
+ {"nativeGetWidth", "(I)I", (void*)Image_getWidth },
+ {"nativeGetHeight", "(I)I", (void*)Image_getHeight },
+ {"nativeGetFormat", "(I)I", (void*)Image_getFormat },
};
int register_android_media_ImageReader(JNIEnv *env) {
diff --git a/media/jni/android_media_MediaDataSource.cpp b/media/jni/android_media_MediaDataSource.cpp
index 1e6d2af..025133f 100644
--- a/media/jni/android_media_MediaDataSource.cpp
+++ b/media/jni/android_media_MediaDataSource.cpp
@@ -39,7 +39,7 @@ JMediaDataSource::JMediaDataSource(JNIEnv* env, jobject source)
ScopedLocalRef<jclass> mediaDataSourceClass(env, env->GetObjectClass(mMediaDataSourceObj));
CHECK(mediaDataSourceClass.get() != NULL);
- mReadMethod = env->GetMethodID(mediaDataSourceClass.get(), "readAt", "(J[BI)I");
+ mReadMethod = env->GetMethodID(mediaDataSourceClass.get(), "readAt", "(J[BII)I");
CHECK(mReadMethod != NULL);
mGetSizeMethod = env->GetMethodID(mediaDataSourceClass.get(), "getSize", "()J");
CHECK(mGetSizeMethod != NULL);
@@ -80,7 +80,7 @@ ssize_t JMediaDataSource::readAt(off64_t offset, size_t size) {
JNIEnv* env = AndroidRuntime::getJNIEnv();
jint numread = env->CallIntMethod(mMediaDataSourceObj, mReadMethod,
- (jlong)offset, mByteArrayObj, (jint)size);
+ (jlong)offset, mByteArrayObj, (jint)0, (jint)size);
if (env->ExceptionCheck()) {
ALOGW("An exception occurred in readAt()");
LOGW_EX(env);
@@ -89,9 +89,14 @@ ssize_t JMediaDataSource::readAt(off64_t offset, size_t size) {
return -1;
}
if (numread < 0) {
- ALOGW("An error occurred in readAt()");
- mJavaObjStatus = UNKNOWN_ERROR;
- return -1;
+ if (numread != -1) {
+ ALOGW("An error occurred in readAt()");
+ mJavaObjStatus = UNKNOWN_ERROR;
+ return -1;
+ } else {
+ // numread == -1 indicates EOF
+ return 0;
+ }
}
if ((size_t)numread > size) {
ALOGE("readAt read too many bytes.");
diff --git a/media/jni/android_media_MediaExtractor.cpp b/media/jni/android_media_MediaExtractor.cpp
index b6b7a80..4e9b726 100644
--- a/media/jni/android_media_MediaExtractor.cpp
+++ b/media/jni/android_media_MediaExtractor.cpp
@@ -715,6 +715,11 @@ static void android_media_MediaExtractor_setDataSourceCallback(
status_t err = extractor->setDataSource(bridge);
if (err != OK) {
+ // Clear bridge so that JMediaDataSource::close() is called _before_
+ // we throw the IOException.
+ // Otherwise close() gets called when we go out of scope, it calls
+ // Java with a pending exception and crashes the process.
+ bridge.clear();
jniThrowException(
env,
"java/io/IOException",
diff --git a/packages/Keyguard/res/layout/keyguard_status_area.xml b/packages/Keyguard/res/layout/keyguard_status_area.xml
index 7d8977c..8fe2835 100644
--- a/packages/Keyguard/res/layout/keyguard_status_area.xml
+++ b/packages/Keyguard/res/layout/keyguard_status_area.xml
@@ -30,6 +30,8 @@
android:layout_height="wrap_content"
android:textColor="@color/clock_white"
style="@style/widget_label"
+ android:textAllCaps="true"
+ android:letterSpacing="0.15"
android:gravity="center"
/>
<TextView android:id="@+id/alarm_status"
@@ -38,6 +40,8 @@
android:drawablePadding="6dp"
android:drawableStart="@drawable/ic_access_alarms_big"
android:textColor="@color/clock_gray"
+ android:letterSpacing="0.15"
+ android:textAllCaps="true"
style="@style/widget_label"
android:layout_marginStart="6dp"
android:gravity="center"
diff --git a/packages/Keyguard/res/layout/keyguard_status_view.xml b/packages/Keyguard/res/layout/keyguard_status_view.xml
index 69f510e..fc0b568 100644
--- a/packages/Keyguard/res/layout/keyguard_status_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_status_view.xml
@@ -57,6 +57,7 @@
android:layout_gravity="center_horizontal"
android:textColor="@color/clock_gray"
android:textSize="@dimen/widget_label_font_size"
+ android:letterSpacing="0.05"
android:ellipsize="marquee"
android:singleLine="true" />
diff --git a/packages/Keyguard/res/values-h650dp/dimens.xml b/packages/Keyguard/res/values-h650dp/dimens.xml
index 4864326..92035bb 100644
--- a/packages/Keyguard/res/values-h650dp/dimens.xml
+++ b/packages/Keyguard/res/values-h650dp/dimens.xml
@@ -16,5 +16,5 @@
-->
<resources>
- <dimen name="widget_big_font_size">112dp</dimen>
+ <dimen name="widget_big_font_size">104dp</dimen>
</resources> \ No newline at end of file
diff --git a/packages/Keyguard/res/values-sw600dp/dimens.xml b/packages/Keyguard/res/values-sw600dp/dimens.xml
index 5de1d11..b181682 100644
--- a/packages/Keyguard/res/values-sw600dp/dimens.xml
+++ b/packages/Keyguard/res/values-sw600dp/dimens.xml
@@ -26,7 +26,7 @@
<dimen name="keyguard_security_view_margin">12dp</dimen>
<!-- Overload default clock widget parameters -->
- <dimen name="widget_big_font_size">140dp</dimen>
+ <dimen name="widget_big_font_size">125dp</dimen>
<dimen name="widget_label_font_size">16sp</dimen>
<dimen name="bottom_text_spacing_digital">-16dp</dimen>
diff --git a/packages/Keyguard/res/values-sw720dp/dimens.xml b/packages/Keyguard/res/values-sw720dp/dimens.xml
index 428c18e..08ab791 100644
--- a/packages/Keyguard/res/values-sw720dp/dimens.xml
+++ b/packages/Keyguard/res/values-sw720dp/dimens.xml
@@ -24,5 +24,5 @@
<!-- Height of the sliding KeyguardSecurityContainer (includes 2x keyguard_security_view_margin) -->
<dimen name="keyguard_security_height">420dp</dimen>
- <dimen name="widget_big_font_size">150dp</dimen>
+ <dimen name="widget_big_font_size">138dp</dimen>
</resources>
diff --git a/packages/Keyguard/res/values/colors.xml b/packages/Keyguard/res/values/colors.xml
index 3b741ea..3998c5b 100644
--- a/packages/Keyguard/res/values/colors.xml
+++ b/packages/Keyguard/res/values/colors.xml
@@ -17,5 +17,5 @@
<!-- Clock -->
<color name="clock_white">#ffffffff</color>
- <color name="clock_gray">#99ffffff</color>
+ <color name="clock_gray">@*android:color/secondary_text_default_material_dark</color>
</resources>
diff --git a/packages/Keyguard/res/values/dimens.xml b/packages/Keyguard/res/values/dimens.xml
index 9290236..18d893a 100644
--- a/packages/Keyguard/res/values/dimens.xml
+++ b/packages/Keyguard/res/values/dimens.xml
@@ -40,7 +40,7 @@
<!-- Default clock parameters -->
<dimen name="bottom_text_spacing_digital">-10dp</dimen>
- <dimen name="widget_label_font_size">16sp</dimen>
+ <dimen name="widget_label_font_size">14sp</dimen>
<dimen name="widget_big_font_size">88dp</dimen>
<!-- The y translation to apply at the start in appear animations. -->
diff --git a/packages/Keyguard/res/values/styles.xml b/packages/Keyguard/res/values/styles.xml
index 404a17e..943c3ea 100644
--- a/packages/Keyguard/res/values/styles.xml
+++ b/packages/Keyguard/res/values/styles.xml
@@ -41,7 +41,7 @@
</style>
<style name="widget_big_thin">
<item name="android:textSize">@dimen/widget_big_font_size</item>
- <item name="android:fontFamily">sans-serif-thin</item>
+ <item name="android:fontFamily">sans-serif-light</item>
</style>
<style name="BouncerSecurityContainer">
diff --git a/packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java b/packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java
index fb30bc1..3b59fd6 100644
--- a/packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java
+++ b/packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java
@@ -90,7 +90,7 @@ public abstract class AbstractStatementRetriever {
* Creates a new StatementRetriever that directly retrieves statements from the asset.
*
* <p> For web assets, {@link AbstractStatementRetriever} will try to retrieve the statement
- * file from URL: {@code [webAsset.site]/.well-known/associations.json"} where {@code
+ * file from URL: {@code [webAsset.site]/.well-known/statements.json"} where {@code
* [webAsset.site]} is in the form {@code http{s}://[hostname]:[optional_port]}. The file
* should contain one JSON array of statements.
*
diff --git a/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java b/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java
index 3ad71c4..6516516 100644
--- a/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java
+++ b/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java
@@ -38,7 +38,7 @@ import java.util.List;
private static final int HTTP_CONNECTION_TIMEOUT_MILLIS = 5000;
private static final long HTTP_CONTENT_SIZE_LIMIT_IN_BYTES = 1024 * 1024;
private static final int MAX_INCLUDE_LEVEL = 1;
- private static final String WELL_KNOWN_STATEMENT_PATH = "/.well-known/associations.json";
+ private static final String WELL_KNOWN_STATEMENT_PATH = "/.well-known/statements.json";
private final URLFetcher mUrlFetcher;
private final AndroidPackageInfoFetcher mAndroidFetcher;
diff --git a/packages/StatementService/src/com/android/statementservice/retriever/Statement.java b/packages/StatementService/src/com/android/statementservice/retriever/Statement.java
index f83edaf..da3c355 100644
--- a/packages/StatementService/src/com/android/statementservice/retriever/Statement.java
+++ b/packages/StatementService/src/com/android/statementservice/retriever/Statement.java
@@ -21,7 +21,7 @@ import android.annotation.NonNull;
/**
* An immutable value type representing a statement, consisting of a source, target, and relation.
* This reflects an assertion that the relation holds for the source, target pair. For example, if a
- * web site has the following in its associations.json file:
+ * web site has the following in its statements.json file:
*
* <pre>
* {
diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml
index 539aabf..03b6dca 100644
--- a/packages/SystemUI/res/layout/super_status_bar.xml
+++ b/packages/SystemUI/res/layout/super_status_bar.xml
@@ -63,7 +63,7 @@
android:layout_gravity="@integer/notification_panel_layout_gravity"
android:paddingLeft="@dimen/notification_side_padding"
android:paddingRight="@dimen/notification_side_padding"
- android:visibility="gone">
+ android:visibility="invisible">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 38812ce..c8b8b24 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -616,6 +616,9 @@ public abstract class PanelView extends FrameLayout {
boolean expandBecauseOfFalsing) {
cancelPeek();
float target = expand ? getMaxPanelHeight() : 0.0f;
+ if (!expand) {
+ mClosing = true;
+ }
flingToHeight(vel, expand, target, collapseSpeedUpFactor, expandBecauseOfFalsing);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 808f1ff..450fdd9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -45,7 +45,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
public static final long ANIMATION_DURATION = 220;
private static final float SCRIM_BEHIND_ALPHA = 0.62f;
- private static final float SCRIM_BEHIND_ALPHA_KEYGUARD = 0.55f;
+ private static final float SCRIM_BEHIND_ALPHA_KEYGUARD = 0.45f;
private static final float SCRIM_BEHIND_ALPHA_UNLOCKING = 0.2f;
private static final float SCRIM_IN_FRONT_ALPHA = 0.75f;
private static final int TAG_KEY_ANIM = R.id.scrim;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java
index 895af62..0340984 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java
@@ -58,7 +58,7 @@ public class BrightnessMirrorController {
.withEndAction(new Runnable() {
@Override
public void run() {
- mBrightnessMirror.setVisibility(View.GONE);
+ mBrightnessMirror.setVisibility(View.INVISIBLE);
}
});
}
@@ -77,12 +77,18 @@ public class BrightnessMirrorController {
public void setLocation(View original) {
original.getLocationInWindow(mInt2Cache);
+
+ // Original is slightly larger than the mirror, so make sure to use the center for the
+ // positioning.
+ int originalX = mInt2Cache[0] + original.getWidth()/2;
int originalY = mInt2Cache[1];
+ mBrightnessMirror.setTranslationX(0);
+ mBrightnessMirror.setTranslationY(0);
mBrightnessMirror.getLocationInWindow(mInt2Cache);
+ int mirrorX = mInt2Cache[0] + mBrightnessMirror.getWidth()/2;
int mirrorY = mInt2Cache[1];
-
- mBrightnessMirror.setTranslationY(mBrightnessMirror.getTranslationY()
- + originalY - mirrorY);
+ mBrightnessMirror.setTranslationX(originalX - mirrorX);
+ mBrightnessMirror.setTranslationY(originalY - mirrorY);
}
public View getMirror() {
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java
index 27f2cc8..8b1a032 100644
--- a/rs/java/android/renderscript/RenderScript.java
+++ b/rs/java/android/renderscript/RenderScript.java
@@ -134,6 +134,20 @@ public class RenderScript {
static final long sMinorVersion = 1;
/**
+ * @hide
+ *
+ * Only exist to be compatible with old version RenderScript Support lib.
+ * Will eventually be removed.
+ *
+ * @return Always return 1
+ *
+ */
+ public static long getMinorID() {
+ return 1;
+ }
+
+
+ /**
* Returns an identifier that can be used to identify a particular
* minor version of RS.
*
diff --git a/services/core/java/com/android/server/camera/CameraService.java b/services/core/java/com/android/server/camera/CameraService.java
index f9b17ed..1d77bc2 100644
--- a/services/core/java/com/android/server/camera/CameraService.java
+++ b/services/core/java/com/android/server/camera/CameraService.java
@@ -15,13 +15,21 @@
*/
package com.android.server.camera;
+import android.app.ActivityManager;
import android.content.Context;
+import android.content.pm.UserInfo;
import android.hardware.ICameraService;
import android.os.IBinder;
import android.os.RemoteException;
+import android.os.UserManager;
import com.android.server.SystemService;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
/**
* CameraService is the system_server analog to the camera service running in mediaserver.
*
@@ -38,29 +46,78 @@ public class CameraService extends SystemService {
public static final int NO_EVENT = 0; // NOOP
public static final int USER_SWITCHED = 1; // User changed, argument is the new user handle
+ private final Context mContext;
+ private UserManager mUserManager;
+ private Set<Integer> mEnabledCameraUsers;
+
public CameraService(Context context) {
super(context);
+ mContext = context;
}
@Override
- public void onStart() {}
+ public void onStart() {
+ mUserManager = UserManager.get(mContext);
+ if (mUserManager == null) {
+ // Should never see this unless someone messes up the SystemServer service boot order.
+ throw new IllegalStateException("UserManagerService must start before CameraService!");
+ }
+ }
+
+ @Override
+ public void onStartUser(int userHandle) {
+ if (mEnabledCameraUsers == null) {
+ // Initialize mediaserver, or update mediaserver if we are recovering from a crash.
+ onSwitchUser(userHandle);
+ }
+ }
@Override
public void onSwitchUser(int userHandle) {
- super.onSwitchUser(userHandle);
+ Set<Integer> currentUserHandles = getEnabledUserHandles(userHandle);
+ if (mEnabledCameraUsers == null || !mEnabledCameraUsers.equals(currentUserHandles)) {
+ // Some user handles have been added or removed, update mediaserver.
+ mEnabledCameraUsers = currentUserHandles;
+ notifyMediaserver(USER_SWITCHED, currentUserHandles);
+ }
+ }
+
- /**
- * Forward the user switch event to the native camera service running in mediaserver.
- */
+ private Set<Integer> getEnabledUserHandles(int currentUserHandle) {
+ List<UserInfo> userProfiles = mUserManager.getEnabledProfiles(currentUserHandle);
+ Set<Integer> handles = new HashSet<>(userProfiles.size());
+
+ for (UserInfo i : userProfiles) {
+ handles.add(i.id);
+ }
+
+ return handles;
+ }
+
+ private void notifyMediaserver(int eventType, Set<Integer> updatedUserHandles) {
+ // Forward the user switch event to the native camera service running in the mediaserver
+ // process.
IBinder cameraServiceBinder = getBinderService(CAMERA_SERVICE_BINDER_NAME);
if (cameraServiceBinder == null) {
- return; // Camera service not active, there is no need to evict user clients.
+ return; // Camera service not active, cannot evict user clients.
}
+
ICameraService cameraServiceRaw = ICameraService.Stub.asInterface(cameraServiceBinder);
+
try {
- cameraServiceRaw.notifySystemEvent(USER_SWITCHED, userHandle);
+ cameraServiceRaw.notifySystemEvent(eventType, toArray(updatedUserHandles));
} catch (RemoteException e) {
- // Do nothing, if camera service is dead, there is no need to evict user clients.
+ // Not much we can do if camera service is dead.
+ }
+ }
+
+ private static int[] toArray(Collection<Integer> c) {
+ int len = c.size();
+ int[] ret = new int[len];
+ int idx = 0;
+ for (Integer i : c) {
+ ret[idx++] = i;
}
+ return ret;
}
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 66f7861..c37f619 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -392,10 +392,6 @@ public final class HdmiControlService extends SystemService {
mCecController = HdmiCecController.create(this);
if (mCecController != null) {
- // TODO: Remove this as soon as OEM's HAL implementation is corrected.
- mCecController.setOption(OPTION_CEC_ENABLE, ENABLED);
-
- // TODO: load value for mHdmiControlEnabled from preference.
if (mHdmiControlEnabled) {
initializeCec(INITIATED_BY_BOOT_UP);
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 944fa52..8e0cdf1 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -3146,6 +3146,7 @@ public class PackageManagerService extends IPackageManager.Stub {
@Override
public void grantRuntimePermission(String packageName, String name, int userId) {
if (!sUserManager.exists(userId)) {
+ Log.e(TAG, "No such user:" + userId);
return;
}
@@ -3203,6 +3204,7 @@ public class PackageManagerService extends IPackageManager.Stub {
@Override
public void revokeRuntimePermission(String packageName, String name, int userId) {
if (!sUserManager.exists(userId)) {
+ Log.e(TAG, "No such user:" + userId);
return;
}
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index 4098698..7784884 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -590,12 +590,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
void switchUser(int userId, IRemoteCallback reply) {
synchronized (mLock) {
mCurrentUserId = userId;
- WallpaperData wallpaper = mWallpaperMap.get(userId);
- if (wallpaper == null) {
- wallpaper = new WallpaperData(userId);
- mWallpaperMap.put(userId, wallpaper);
- loadSettingsLocked(userId);
- }
+ WallpaperData wallpaper = getWallpaperSafeLocked(userId);
// Not started watching yet, in case wallpaper data was loaded for other reasons.
if (wallpaper.wallpaperObserver == null) {
wallpaper.wallpaperObserver = new WallpaperObserver(wallpaper);
@@ -718,10 +713,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
}
synchronized (mLock) {
int userId = UserHandle.getCallingUserId();
- WallpaperData wallpaper = mWallpaperMap.get(userId);
- if (wallpaper == null) {
- throw new IllegalStateException("Wallpaper not yet initialized for user " + userId);
- }
+ WallpaperData wallpaper = getWallpaperSafeLocked(userId);
if (width <= 0 || height <= 0) {
throw new IllegalArgumentException("width and height must be > 0");
}
@@ -783,10 +775,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
}
synchronized (mLock) {
int userId = UserHandle.getCallingUserId();
- WallpaperData wallpaper = mWallpaperMap.get(userId);
- if (wallpaper == null) {
- throw new IllegalStateException("Wallpaper not yet initialized for user " + userId);
- }
+ WallpaperData wallpaper = getWallpaperSafeLocked(userId);
if (padding.left < 0 || padding.top < 0 || padding.right < 0 || padding.bottom < 0) {
throw new IllegalArgumentException("padding must be positive: " + padding);
}
@@ -867,10 +856,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
synchronized (mLock) {
if (DEBUG) Slog.v(TAG, "setWallpaper");
int userId = UserHandle.getCallingUserId();
- WallpaperData wallpaper = mWallpaperMap.get(userId);
- if (wallpaper == null) {
- throw new IllegalStateException("Wallpaper not yet initialized for user " + userId);
- }
+ WallpaperData wallpaper = getWallpaperSafeLocked(userId);
final long ident = Binder.clearCallingIdentity();
try {
ParcelFileDescriptor pfd = updateWallpaperBitmapLocked(name, wallpaper);
@@ -1230,6 +1216,22 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
return Integer.parseInt(value);
}
+ /**
+ * Sometimes it is expected the wallpaper map may not have a user's data. E.g. This could
+ * happen during user switch. The async user switch observer may not have received
+ * the event yet. We use this safe method when we don't care about this ordering and just
+ * want to update the data. The data is going to be applied when the user switch observer
+ * is eventually executed.
+ */
+ private WallpaperData getWallpaperSafeLocked(int userId) {
+ WallpaperData wallpaper = mWallpaperMap.get(userId);
+ if (wallpaper == null) {
+ loadSettingsLocked(userId);
+ wallpaper = mWallpaperMap.get(userId);
+ }
+ return wallpaper;
+ }
+
private void loadSettingsLocked(int userId) {
if (DEBUG) Slog.v(TAG, "loadSettingsLocked");
diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java
index 08485a3..1d6e15c 100644
--- a/telecomm/java/android/telecom/RemoteConnection.java
+++ b/telecomm/java/android/telecom/RemoteConnection.java
@@ -960,7 +960,7 @@ public final class RemoteConnection {
record.getHandler().post(new Runnable() {
@Override
public void run() {
- callback.onPostDialWait(connection, String.valueOf(nextChar));
+ callback.onPostDialChar(connection, nextChar);
}
});
}
diff --git a/telecomm/java/android/telecom/StatusHints.java b/telecomm/java/android/telecom/StatusHints.java
index 99c8d7f..453f408 100644
--- a/telecomm/java/android/telecom/StatusHints.java
+++ b/telecomm/java/android/telecom/StatusHints.java
@@ -42,7 +42,8 @@ public final class StatusHints implements Parcelable {
@SystemApi @Deprecated
public StatusHints(ComponentName packageName, CharSequence label, int iconResId,
Bundle extras) {
- this(label, Icon.createWithResource(packageName.getPackageName(), iconResId), extras);
+ this(label, iconResId == 0 ? null : Icon.createWithResource(packageName.getPackageName(),
+ iconResId), extras);
}
public StatusHints(CharSequence label, Icon icon, Bundle extras) {
diff --git a/tools/layoutlib/.idea/libraries/framework_jar.xml b/tools/layoutlib/.idea/libraries/framework_jar.xml
new file mode 100644
index 0000000..6695a36
--- /dev/null
+++ b/tools/layoutlib/.idea/libraries/framework_jar.xml
@@ -0,0 +1,13 @@
+<component name="libraryTable">
+ <library name="framework.jar">
+ <CLASSES>
+ <root url="jar://$PROJECT_DIR$/../../../../out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="file://$PROJECT_DIR$/../../core/java" />
+ <root url="file://$PROJECT_DIR$/../../graphics/java" />
+ <root url="file://$PROJECT_DIR$/../../../../libcore/luni/src/main/java" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/tools/layoutlib/.idea/libraries/layoutlib_api_prebuilt.xml b/tools/layoutlib/.idea/libraries/layoutlib_api_prebuilt.xml
new file mode 100644
index 0000000..a873600
--- /dev/null
+++ b/tools/layoutlib/.idea/libraries/layoutlib_api_prebuilt.xml
@@ -0,0 +1,11 @@
+<component name="libraryTable">
+ <library name="layoutlib_api-prebuilt">
+ <CLASSES>
+ <root url="jar://$PROJECT_DIR$/../../../../prebuilts/misc/common/layoutlib_api/layoutlib_api-prebuilt.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$PROJECT_DIR$/../../../../prebuilts/misc/common/layoutlib_api/layoutlib_api-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component> \ No newline at end of file
diff --git a/tools/layoutlib/bridge/bridge.iml b/tools/layoutlib/bridge/bridge.iml
index d2b1259..af2fe7f 100644
--- a/tools/layoutlib/bridge/bridge.iml
+++ b/tools/layoutlib/bridge/bridge.iml
@@ -24,17 +24,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module-library">
- <library name="layoutlib_api-prebuilt">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../prebuilts/misc/common/layoutlib_api/layoutlib_api-prebuilt.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../prebuilts/misc/common/layoutlib_api/layoutlib_api-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
+ <orderEntry type="library" name="layoutlib_api-prebuilt" level="project" />
<orderEntry type="module-library">
<library name="ninepatch-prebuilt">
<CLASSES>
@@ -60,19 +50,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="framework.jar">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES>
- <root url="file://$MODULE_DIR$/../../../core/java" />
- <root url="file://$MODULE_DIR$/../../../graphics/java" />
- <root url="file://$MODULE_DIR$/../../../../../libcore/luni/src/main/java" />
- </SOURCES>
- </library>
- </orderEntry>
+ <orderEntry type="library" name="framework.jar" level="project" />
<orderEntry type="module-library" scope="TEST">
<library name="kxml2-2.3.0">
<CLASSES>
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java
index 6ca22b0..646f960 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java
@@ -19,7 +19,6 @@ package com.android.layoutlib.bridge.impl;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
-import com.android.ide.common.rendering.api.LayoutlibCallback;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -44,10 +43,11 @@ public class ParserFactory {
// Used to get a new XmlPullParser from the client.
@Nullable
- private static LayoutlibCallback sLayoutlibCallback;
+ private static com.android.ide.common.rendering.api.ParserFactory sParserFactory;
- public static void setLayoutlibCallback(@Nullable LayoutlibCallback callback) {
- sLayoutlibCallback = callback;
+ public static void setParserFactory(
+ @Nullable com.android.ide.common.rendering.api.ParserFactory parserFactory) {
+ sParserFactory = parserFactory;
}
@NonNull
@@ -77,10 +77,10 @@ public class ParserFactory {
@NonNull
public static XmlPullParser instantiateParser(@Nullable String name)
throws XmlPullParserException {
- if (sLayoutlibCallback == null) {
+ if (sParserFactory == null) {
throw new XmlPullParserException("ParserFactory not initialized.");
}
- XmlPullParser parser = sLayoutlibCallback.createParser(name);
+ XmlPullParser parser = sParserFactory.createParser(name);
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
return parser;
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
index 66b0023..2b95488 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java
@@ -39,8 +39,6 @@ import android.view.inputmethod.InputMethodManager_Accessor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
-import javax.swing.text.html.parser.Parser;
-
import static com.android.ide.common.rendering.api.Result.Status.ERROR_LOCK_INTERRUPTED;
import static com.android.ide.common.rendering.api.Result.Status.ERROR_TIMEOUT;
import static com.android.ide.common.rendering.api.Result.Status.SUCCESS;
@@ -102,7 +100,7 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
}
// setup the ParserFactory
- ParserFactory.setLayoutlibCallback(mParams.getLayoutlibCallback());
+ ParserFactory.setParserFactory(mParams.getLayoutlibCallback().getParserFactory());
HardwareConfig hardwareConfig = mParams.getHardwareConfig();
@@ -276,7 +274,7 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
mContext.getRenderResources().setFrameworkResourceIdProvider(null);
mContext.getRenderResources().setLogger(null);
}
- ParserFactory.setLayoutlibCallback(null);
+ ParserFactory.setParserFactory(null);
}
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java
index 509f5eb..4623f69 100644
--- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java
@@ -17,15 +17,7 @@
package com.android.layoutlib.bridge.android;
import com.android.annotations.NonNull;
-import com.android.ide.common.rendering.api.ActionBarCallback;
-import com.android.ide.common.rendering.api.AdapterBinding;
-import com.android.ide.common.rendering.api.ILayoutPullParser;
-import com.android.ide.common.rendering.api.LayoutlibCallback;
-import com.android.ide.common.rendering.api.ResourceReference;
-import com.android.ide.common.rendering.api.ResourceValue;
import com.android.layoutlib.bridge.impl.ParserFactory;
-import com.android.resources.ResourceType;
-import com.android.util.Pair;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -41,7 +33,7 @@ public class BridgeXmlBlockParserTest {
@BeforeClass
public static void setUp() {
- ParserFactory.setLayoutlibCallback(new LayoutlibTestCallback());
+ ParserFactory.setParserFactory(new ParserFactoryImpl());
}
@Test
@@ -129,78 +121,16 @@ public class BridgeXmlBlockParserTest {
@AfterClass
public static void tearDown() {
- ParserFactory.setLayoutlibCallback(null);
+ ParserFactory.setParserFactory(null);
}
- private static class LayoutlibTestCallback extends LayoutlibCallback {
+ private static class ParserFactoryImpl
+ extends com.android.ide.common.rendering.api.ParserFactory {
@NonNull
@Override
public XmlPullParser createParser(String displayName) throws XmlPullParserException {
return new KXmlParser();
}
-
- @Override
- public boolean supports(int ideFeature) {
- throw new AssertionError();
- }
-
- @Override
- public Object loadView(String name, Class[] constructorSignature, Object[] constructorArgs)
- throws Exception {
- throw new AssertionError();
- }
-
- @Override
- public String getNamespace() {
- throw new AssertionError();
- }
-
- @Override
- @SuppressWarnings("deprecation")
- public Pair<ResourceType, String> resolveResourceId(int id) {
- throw new AssertionError();
- }
-
- @Override
- public String resolveResourceId(int[] id) {
- throw new AssertionError();
- }
-
- @Override
- public Integer getResourceId(ResourceType type, String name) {
- throw new AssertionError();
- }
-
- @Override
- @SuppressWarnings("deprecation")
- public ILayoutPullParser getParser(String layoutName) {
- throw new AssertionError();
- }
-
- @Override
- public ILayoutPullParser getParser(ResourceValue layoutResource) {
- throw new AssertionError();
- }
-
- @Override
- public Object getAdapterItemValue(ResourceReference adapterView, Object adapterCookie,
- ResourceReference itemRef, int fullPosition, int positionPerType,
- int fullParentPosition, int parentPositionPerType, ResourceReference viewRef,
- ViewAttribute viewAttribute, Object defaultValue) {
- throw new AssertionError();
- }
-
- @Override
- public AdapterBinding getAdapterBinding(ResourceReference adapterViewRef,
- Object adapterCookie,
- Object viewObject) {
- throw new AssertionError();
- }
-
- @Override
- public ActionBarCallback getActionBarCallback() {
- throw new AssertionError();
- }
}
}
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java
index b1a1f4d..ab682fd 100644
--- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java
@@ -23,6 +23,7 @@ import com.android.ide.common.rendering.api.ActionBarCallback;
import com.android.ide.common.rendering.api.AdapterBinding;
import com.android.ide.common.rendering.api.ILayoutPullParser;
import com.android.ide.common.rendering.api.LayoutlibCallback;
+import com.android.ide.common.rendering.api.ParserFactory;
import com.android.ide.common.rendering.api.ResourceReference;
import com.android.ide.common.rendering.api.ResourceValue;
import com.android.ide.common.resources.IntArrayWrapper;
@@ -32,6 +33,7 @@ import com.android.utils.ILogger;
import org.kxml2.io.KXmlParser;
import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
import java.io.File;
import java.lang.reflect.Constructor;
@@ -163,7 +165,14 @@ public class LayoutLibTestCallback extends LayoutlibCallback {
@NonNull
@Override
- public XmlPullParser createParser(@Nullable String name) {
- return new KXmlParser();
+ public ParserFactory getParserFactory() {
+ return new ParserFactory() {
+ @NonNull
+ @Override
+ public XmlPullParser createParser(@Nullable String debugName)
+ throws XmlPullParserException {
+ return new KXmlParser();
+ }
+ };
}
}