diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/ActivityManagerNative.java | 17 | ||||
| -rw-r--r-- | core/java/android/app/IActivityManager.java | 3 | ||||
| -rw-r--r-- | core/java/android/content/Context.java | 20 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CameraMetadata.java | 70 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CameraProperties.java | 74 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CaptureRequest.java | 2 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CaptureResult.java | 98 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/Face.java | 252 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/impl/CameraMetadataNative.java | 1 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/utils/CameraBinderDecorator.java | 5 | ||||
| -rw-r--r-- | core/java/android/provider/Settings.java | 3 | ||||
| -rw-r--r-- | core/java/android/transition/Fade.java | 34 | ||||
| -rw-r--r-- | core/java/android/transition/Transition.java | 7 | ||||
| -rw-r--r-- | core/java/android/transition/TransitionManager.java | 32 | ||||
| -rw-r--r-- | core/java/com/android/internal/app/PlatLogoActivity.java | 45 |
15 files changed, 533 insertions, 130 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index 370db31..a727b07 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -1995,6 +1995,13 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM reply.writeParcelableArray(uris, 0); return true; } + + case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { + data.enforceInterface(IActivityManager.descriptor); + performIdleMaintenance(); + reply.writeNoException(); + return true; + } } return super.onTransact(code, data, reply, flags); @@ -4578,5 +4585,15 @@ class ActivityManagerProxy implements IActivityManager return uris; } + public void performIdleMaintenance() throws RemoteException { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); + data.writeInterfaceToken(IActivityManager.descriptor); + mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); + reply.readException(); + data.recycle(); + reply.recycle(); + } + private IBinder mRemote; } diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index b2ae298..25c02df 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -403,6 +403,8 @@ public interface IActivityManager extends IInterface { String sourcePackage, String targetPackage, int modeFlags, int modeMask) throws RemoteException; + public void performIdleMaintenance() throws RemoteException; + /* * Private non-Binder interfaces */ @@ -685,4 +687,5 @@ public interface IActivityManager extends IInterface { int REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+176; int RESTART_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+177; int GET_GRANTED_URI_PERMISSIONS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+178; + int PERFORM_IDLE_MAINTENANCE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+179; } diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 92a9c7c..02ccaa5 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -2132,13 +2132,8 @@ public abstract class Context { public static final String UPDATE_LOCK_SERVICE = "updatelock"; /** - * Use with {@link #getSystemService} to retrieve a {@link - * android.net.NetworkManagementService} for handling management of - * system network services - * + * Constant for the internal network management service, not really a Context service. * @hide - * @see #getSystemService - * @see android.net.NetworkManagementService */ public static final String NETWORKMANAGEMENT_SERVICE = "network_management"; @@ -2327,7 +2322,7 @@ public abstract class Context { * android.hardware.SerialManager} for access to serial ports. * * @see #getSystemService - * @see android.harware.SerialManager + * @see android.hardware.SerialManager * * @hide */ @@ -2353,17 +2348,6 @@ public abstract class Context { /** * Use with {@link #getSystemService} to retrieve a - * {@link android.os.SchedulingPolicyService} for managing scheduling policy. - * - * @see #getSystemService - * @see android.os.SchedulingPolicyService - * - * @hide - */ - public static final String SCHEDULING_POLICY_SERVICE = "scheduling_policy"; - - /** - * Use with {@link #getSystemService} to retrieve a * {@link android.os.UserManager} for managing users on devices that support multiple users. * * @see #getSystemService diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index ec23f08..7f4ba4f 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -18,12 +18,25 @@ package android.hardware.camera2; import android.hardware.camera2.impl.CameraMetadataNative; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + /** * The base class for camera controls and information. * + * <p> * This class defines the basic key/value map used for querying for camera * characteristics or capture results, and for setting camera request * parameters. + * </p> + * + * <p> + * All instances of CameraMetadata are immutable. The list of keys with {@link #getKeys()} + * never changes, nor do the values returned by any key with {@link #get} throughout + * the lifetime of the object. + * </p> * * @see CameraDevice * @see CameraManager @@ -38,9 +51,14 @@ public abstract class CameraMetadata { } /** - * Get a camera metadata field value. The field definitions can be + * Get a camera metadata field value. + * + * <p>The field definitions can be * found in {@link CameraProperties}, {@link CaptureResult}, and - * {@link CaptureRequest}. + * {@link CaptureRequest}.</p> + * + * <p>Querying the value for the same key more than once will return a value + * which is equal to the previous queried value.</p> * * @throws IllegalArgumentException if the key was not valid * @@ -49,6 +67,54 @@ public abstract class CameraMetadata { */ public abstract <T> T get(Key<T> key); + /** + * Returns a list of the keys contained in this map. + * + * <p>The list returned is not modifiable, so any attempts to modify it will throw + * a {@code UnsupportedOperationException}.</p> + * + * <p>All values retrieved by a key from this list with {@link #get} are guaranteed to be + * non-{@code null}. Each key is only listed once in the list. The order of the keys + * is undefined.</p> + * + * @return List of the keys contained in this map. + */ + public List<Key<?>> getKeys() { + return Collections.unmodifiableList(getKeysStatic(this.getClass(), this)); + } + + /** + * Return a list of all the Key<?> that are declared as a field inside of the class + * {@code type}. + * + * <p> + * Optionally, if {@code instance} is not null, then filter out any keys with null values. + * </p> + */ + /*package*/ static ArrayList<Key<?>> getKeysStatic(Class<? extends CameraMetadata> type, + CameraMetadata instance) { + ArrayList<Key<?>> keyList = new ArrayList<Key<?>>(); + + Field[] fields = type.getDeclaredFields(); + for (Field field : fields) { + if (field.getDeclaringClass().isAssignableFrom(Key.class)) { + Key<?> key; + try { + key = (Key<?>) field.get(instance); + } catch (IllegalAccessException e) { + throw new AssertionError("Can't get IllegalAccessException", e); + } catch (IllegalArgumentException e) { + throw new AssertionError("Can't get IllegalArgumentException", e); + } + if (instance == null || instance.get(key) != null) { + keyList.add(key); + } + } + } + + return keyList; + } + public static class Key<T> { private boolean mHasTag; diff --git a/core/java/android/hardware/camera2/CameraProperties.java b/core/java/android/hardware/camera2/CameraProperties.java index 45c009f..58a1ee3 100644 --- a/core/java/android/hardware/camera2/CameraProperties.java +++ b/core/java/android/hardware/camera2/CameraProperties.java @@ -18,6 +18,9 @@ package android.hardware.camera2; import android.hardware.camera2.impl.CameraMetadataNative; +import java.util.Collections; +import java.util.List; + /** * <p>The properties describing a * {@link CameraDevice CameraDevice}.</p> @@ -32,6 +35,8 @@ import android.hardware.camera2.impl.CameraMetadataNative; public final class CameraProperties extends CameraMetadata { private final CameraMetadataNative mProperties; + private List<Key<?>> mAvailableRequestKeys; + private List<Key<?>> mAvailableResultKeys; /** * Takes ownership of the passed-in properties object @@ -46,6 +51,75 @@ public final class CameraProperties extends CameraMetadata { return mProperties.get(key); } + /** + * Returns the list of keys supported by this {@link CameraDevice} for querying + * with a {@link CaptureRequest}. + * + * <p>The list returned is not modifiable, so any attempts to modify it will throw + * a {@code UnsupportedOperationException}.</p> + * + * <p>Each key is only listed once in the list. The order of the keys is undefined.</p> + * + * <p>Note that there is no {@code getAvailableCameraPropertiesKeys()} -- use + * {@link #getKeys()} instead.</p> + * + * @return List of keys supported by this CameraDevice for CaptureRequests. + */ + public List<Key<?>> getAvailableCaptureRequestKeys() { + if (mAvailableRequestKeys == null) { + mAvailableRequestKeys = getAvailableKeyList(CaptureRequest.class); + } + return mAvailableRequestKeys; + } + + /** + * Returns the list of keys supported by this {@link CameraDevice} for querying + * with a {@link CaptureResult}. + * + * <p>The list returned is not modifiable, so any attempts to modify it will throw + * a {@code UnsupportedOperationException}.</p> + * + * <p>Each key is only listed once in the list. The order of the keys is undefined.</p> + * + * <p>Note that there is no {@code getAvailableCameraPropertiesKeys()} -- use + * {@link #getKeys()} instead.</p> + * + * @return List of keys supported by this CameraDevice for CaptureResults. + */ + public List<Key<?>> getAvailableCaptureResultKeys() { + if (mAvailableResultKeys == null) { + mAvailableResultKeys = getAvailableKeyList(CaptureResult.class); + } + return mAvailableResultKeys; + } + + /** + * Returns the list of keys supported by this {@link CameraDevice} by metadataClass. + * + * <p>The list returned is not modifiable, so any attempts to modify it will throw + * a {@code UnsupportedOperationException}.</p> + * + * <p>Each key is only listed once in the list. The order of the keys is undefined.</p> + * + * @param metadataClass The subclass of CameraMetadata that you want to get the keys for. + * + * @return List of keys supported by this CameraDevice for metadataClass. + * + * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata + */ + private <T extends CameraMetadata> List<Key<?>> getAvailableKeyList(Class<T> metadataClass) { + + if (metadataClass.equals(CameraMetadata.class)) { + throw new AssertionError( + "metadataClass must be a strict subclass of CameraMetadata"); + } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) { + throw new AssertionError( + "metadataClass must be a subclass of CameraMetadata"); + } + + return Collections.unmodifiableList(getKeysStatic(metadataClass, /*instance*/null)); + } + /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * The key entries below this point are generated from metadata * definitions in /system/media/camera/docs. Do not modify by hand or diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index 4608ab9..3ec5ca0 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -176,7 +176,7 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable { */ public final static class Builder { - private CaptureRequest mRequest; + private final CaptureRequest mRequest; /** * Initialize the builder using the template; the request takes diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 3fcd2f9..377e78a 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -51,89 +51,6 @@ public final class CaptureResult extends CameraMetadata { return mResults.get(key); } - /** - * Describes a face detected in an image. - */ - public static class Face { - - /** - * <p>Bounds of the face. A rectangle relative to the sensor's - * {@link CameraProperties#SENSOR_INFO_ACTIVE_ARRAY_SIZE}, with (0,0) - * representing the top-left corner of the active array rectangle.</p> - */ - public Rect getBounds() { - return mBounds; - } - - /** <p>The confidence level for the detection of the face. The range is 1 to - * 100. 100 is the highest confidence.</p> - * - * <p>Depending on the device, even very low-confidence faces may be - * listed, so applications should filter out faces with low confidence, - * depending on the use case. For a typical point-and-shoot camera - * application that wishes to display rectangles around detected faces, - * filtering out faces with confidence less than 50 is recommended.</p> - * - */ - public int getScore() { - return mScore; - } - - /** - * An unique id per face while the face is visible to the tracker. If - * the face leaves the field-of-view and comes back, it will get a new - * id. This is an optional field, may not be supported on all devices. - * If not supported, id will always be set to -1. The optional fields - * are supported as a set. Either they are all valid, or none of them - * are. - */ - public int getId() { - return mId; - } - - /** - * The coordinates of the center of the left eye. The coordinates are in - * the same space as the ones for {@link #getBounds}. This is an - * optional field, may not be supported on all devices. If not - * supported, the value will always be set to null. The optional fields - * are supported as a set. Either they are all valid, or none of them - * are. - */ - public Point getLeftEye() { - return mLeftEye; - } - - /** - * The coordinates of the center of the right eye. The coordinates are - * in the same space as the ones for {@link #getBounds}.This is an - * optional field, may not be supported on all devices. If not - * supported, the value will always be set to null. The optional fields - * are supported as a set. Either they are all valid, or none of them - * are. - */ - public Point getRightEye() { - return mRightEye; - } - - /** - * The coordinates of the center of the mouth. The coordinates are in - * the same space as the ones for {@link #getBounds}. This is an optional - * field, may not be supported on all devices. If not supported, the - * value will always be set to null. The optional fields are supported - * as a set. Either they are all valid, or none of them are. - */ - public Point getMouth() { - return mMouth; - } - - private Rect mBounds; - private int mScore; - private int mId; - private Point mLeftEye; - private Point mRightEye; - private Point mMouth; - } - /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * The key entries below this point are generated from metadata * definitions in /system/media/camera/docs. Do not modify by hand or @@ -1003,4 +920,19 @@ public final class CaptureResult extends CameraMetadata { /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * End generated code *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ + + /** + * <p> + * List of the {@link Face Faces} detected through camera face detection + * in this result. + * </p> + * <p> + * Only available if {@link #STATISTICS_FACE_DETECT_MODE} {@code !=} + * {@link CameraMetadata#STATISTICS_FACE_DETECT_MODE_OFF OFF}. + * </p> + * + * @see Face + */ + public static final Key<Face[]> STATISTICS_FACES = + new Key<Face[]>("android.statistics.faces", Face[].class); } diff --git a/core/java/android/hardware/camera2/Face.java b/core/java/android/hardware/camera2/Face.java new file mode 100644 index 0000000..6bfc535 --- /dev/null +++ b/core/java/android/hardware/camera2/Face.java @@ -0,0 +1,252 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package android.hardware.camera2; + +import android.graphics.Point; +import android.graphics.Rect; + +/** + * Describes a face detected in an image. + */ +public final class Face { + + /** + * The ID is {@code -1} when the optional set of fields is unsupported. + * + * @see Face#Face(Rect, int) + * @see #getId() + */ + public static final int ID_UNSUPPORTED = -1; + + /** + * The minimum possible value for the confidence level. + * + * @see #getScore() + */ + public static final int SCORE_MIN = 1; + + /** + * The maximum possible value for the confidence level. + * + * @see #getScore() + */ + public static final int SCORE_MAX = 100; + + private final Rect mBounds; + private final int mScore; + private final int mId; + private final Point mLeftEye; + private final Point mRightEye; + private final Point mMouth; + + /** + * Create a new face with all fields set. + * + * <p>The id, leftEyePosition, rightEyePosition, and mouthPosition are considered optional. + * If the id is {@value #ID_UNSUPPORTED} then the leftEyePosition, rightEyePosition, and + * mouthPositions are guaranteed to be {@code null}. Otherwise, each of leftEyePosition, + * rightEyePosition, and mouthPosition may be independently null or not-null.</p> + * + * @param bounds Bounds of the face. + * @param score Confidence level between {@value #SCORE_MIN}-{@value #SCORE_MAX}. + * @param id A unique ID per face visible to the tracker. + * @param leftEyePosition The position of the left eye. + * @param rightEyePosition The position of the right eye. + * @param mouthPosition The position of the mouth. + * + * @throws IllegalArgumentException + * if bounds is {@code null}, + * or if the confidence is not in the range of + * {@value #SCORE_MIN}-{@value #SCORE_MAX}, + * or if id is {@value #ID_UNSUPPORTED} and + * leftEyePosition/rightEyePosition/mouthPosition aren't all null, + * or else if id is negative. + * + * @hide + */ + public Face(Rect bounds, int score, int id, + Point leftEyePosition, Point rightEyePosition, Point mouthPosition) { + checkNotNull("bounds", bounds); + if (score < SCORE_MIN || score > SCORE_MAX) { + throw new IllegalArgumentException("Confidence out of range"); + } else if (id < 0 && id != ID_UNSUPPORTED) { + throw new IllegalArgumentException("Id out of range"); + } + if (id == ID_UNSUPPORTED) { + checkNull("leftEyePosition", leftEyePosition); + checkNull("rightEyePosition", rightEyePosition); + checkNull("mouthPosition", mouthPosition); + } + + mBounds = bounds; + mScore = score; + mId = id; + mLeftEye = leftEyePosition; + mRightEye = rightEyePosition; + mMouth = mouthPosition; + } + + /** + * Create a new face without the optional fields. + * + * <p>The id, leftEyePosition, rightEyePosition, and mouthPosition are considered optional. + * If the id is {@value #ID_UNSUPPORTED} then the leftEyePosition, rightEyePosition, and + * mouthPositions are guaranteed to be {@code null}. Otherwise, each of leftEyePosition, + * rightEyePosition, and mouthPosition may be independently null or not-null.</p> + * + * @param bounds Bounds of the face. + * @param score Confidence level between {@value #SCORE_MIN}-{@value #SCORE_MAX}. + * + * @throws IllegalArgumentException + * if bounds is {@code null}, + * or if the confidence is not in the range of + * {@value #SCORE_MIN}-{@value #SCORE_MAX}. + * + * @hide + */ + public Face(Rect bounds, int score) { + this(bounds, score, ID_UNSUPPORTED, + /*leftEyePosition*/null, /*rightEyePosition*/null, /*mouthPosition*/null); + } + + /** + * Bounds of the face. + * + * <p>A rectangle relative to the sensor's + * {@link CameraProperties#SENSOR_INFO_ACTIVE_ARRAY_SIZE}, with (0,0) + * representing the top-left corner of the active array rectangle.</p> + * + * <p>There is no constraints on the the Rectangle value other than it + * is not-{@code null}.</p> + */ + public Rect getBounds() { + return mBounds; + } + + /** + * The confidence level for the detection of the face. + * + * <p>The range is {@value #SCORE_MIN} to {@value #SCORE_MAX}. + * {@value #SCORE_MAX} is the highest confidence.</p> + * + * <p>Depending on the device, even very low-confidence faces may be + * listed, so applications should filter out faces with low confidence, + * depending on the use case. For a typical point-and-shoot camera + * application that wishes to display rectangles around detected faces, + * filtering out faces with confidence less than half of {@value #SCORE_MAX} + * is recommended.</p> + * + * @see #SCORE_MAX + * @see #SCORE_MIN + */ + public int getScore() { + return mScore; + } + + /** + * An unique id per face while the face is visible to the tracker. + * + * <p> + * If the face leaves the field-of-view and comes back, it will get a new + * id.</p> + * + * <p>This is an optional field, may not be supported on all devices. + * If the id is {@value #ID_UNSUPPORTED} then the leftEyePosition, rightEyePosition, and + * mouthPositions are guaranteed to be {@code null}. Otherwise, each of leftEyePosition, + * rightEyePosition, and mouthPosition may be independently null or not-null.</p> + * + * <p>This value will either be {@value #ID_UNSUPPORTED} or + * otherwise greater than {@code 0}.</p> + * + * @see #ID_UNSUPPORTED + */ + public int getId() { + return mId; + } + + /** + * The coordinates of the center of the left eye. + * + * <p>The coordinates are in + * the same space as the ones for {@link #getBounds}. This is an + * optional field, may not be supported on all devices. If not + * supported, the value will always be set to null. + * This value will always be null only if {@link #getId()} returns + * {@value #ID_UNSUPPORTED}.</p> + * + * @return The left eye position, or {@code null} if unknown. + */ + public Point getLeftEyePosition() { + return mLeftEye; + } + + /** + * The coordinates of the center of the right eye. + * + * <p>The coordinates are + * in the same space as the ones for {@link #getBounds}.This is an + * optional field, may not be supported on all devices. If not + * supported, the value will always be set to null. + * This value will always be null only if {@link #getId()} returns + * {@value #ID_UNSUPPORTED}.</p> + * + * @return The right eye position, or {@code null} if unknown. + */ + public Point getRightEyePosition() { + return mRightEye; + } + + /** + * The coordinates of the center of the mouth. + * + * <p>The coordinates are in + * the same space as the ones for {@link #getBounds}. This is an optional + * field, may not be supported on all devices. If not + * supported, the value will always be set to null. + * This value will always be null only if {@link #getId()} returns + * {@value #ID_UNSUPPORTED}.</p> them are. + * </p> + * + * @return The mouth position, or {@code null} if unknown. + */ + public Point getMouthPosition() { + return mMouth; + } + + /** + * Represent the Face as a string for debugging purposes. + */ + @Override + public String toString() { + return String.format("{ bounds: %s, score: %s, id: %d, " + + "leftEyePosition: %s, rightEyePosition: %s, mouthPosition: %s }", + mBounds, mScore, mId, mLeftEye, mRightEye, mMouth); + } + + private static void checkNotNull(String name, Object obj) { + if (obj == null) { + throw new IllegalArgumentException(name + " was required, but it was null"); + } + } + + private static void checkNull(String name, Object obj) { + if (obj != null) { + throw new IllegalArgumentException(name + " was required to be null, but it wasn't"); + } + } +} diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java index 020d7b6..c13438a 100644 --- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java +++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java @@ -27,7 +27,6 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.HashMap; -import java.util.Map; /** * Implementation of camera metadata marshal/unmarshal across Binder to diff --git a/core/java/android/hardware/camera2/utils/CameraBinderDecorator.java b/core/java/android/hardware/camera2/utils/CameraBinderDecorator.java index 2c05c58..d0b3ec4 100644 --- a/core/java/android/hardware/camera2/utils/CameraBinderDecorator.java +++ b/core/java/android/hardware/camera2/utils/CameraBinderDecorator.java @@ -19,6 +19,7 @@ package android.hardware.camera2.utils; import static android.hardware.camera2.CameraAccessException.CAMERA_DISABLED; import static android.hardware.camera2.CameraAccessException.CAMERA_DISCONNECTED; import static android.hardware.camera2.CameraAccessException.CAMERA_IN_USE; +import static android.hardware.camera2.CameraAccessException.MAX_CAMERAS_IN_USE; import static android.hardware.camera2.CameraAccessException.CAMERA_DEPRECATED_HAL; import android.os.DeadObjectException; @@ -50,6 +51,7 @@ public class CameraBinderDecorator { public static final int EBUSY = -16; public static final int ENODEV = -19; public static final int EOPNOTSUPP = -95; + public static final int EDQUOT = -122; private static class CameraBinderDecoratorListener implements Decorator.DecoratorListener { @@ -83,6 +85,9 @@ public class CameraBinderDecorator { case EBUSY: UncheckedThrow.throwAnyException(new CameraRuntimeException( CAMERA_IN_USE)); + case EDQUOT: + UncheckedThrow.throwAnyException(new CameraRuntimeException( + MAX_CAMERAS_IN_USE)); case ENODEV: UncheckedThrow.throwAnyException(new CameraRuntimeException( CAMERA_DISCONNECTED)); diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index c1c826c..c8312e3 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -4365,6 +4365,9 @@ public final class Settings { /** @hide */ public static final String BAR_SERVICE_COMPONENT = "bar_service_component"; + /** @hide */ + public static final String TRANSIENT_NAV_CONFIRMATIONS = "transient_nav_confirmations"; + /** * This are the settings to be backed up. * diff --git a/core/java/android/transition/Fade.java b/core/java/android/transition/Fade.java index 12e0d73..4cc2c42 100644 --- a/core/java/android/transition/Fade.java +++ b/core/java/android/transition/Fade.java @@ -91,6 +91,9 @@ public class Fade extends Visibility { return null; } final ObjectAnimator anim = ObjectAnimator.ofFloat(view, "alpha", startAlpha, endAlpha); + if (DBG) { + Log.d(LOG_TAG, "Created animator " + anim); + } if (listener != null) { anim.addListener(listener); anim.addPauseListener(listener); @@ -146,12 +149,41 @@ public class Fade extends Visibility { final View endView = endValues.view; if (DBG) { View startView = (startValues != null) ? startValues.view : null; - Log.d(LOG_TAG, "Fade.onDisappear: startView, startVis, endView, endVis = " + + Log.d(LOG_TAG, "Fade.onAppear: startView, startVis, endView, endVis = " + startView + ", " + startVisibility + ", " + endView + ", " + endVisibility); } // if alpha < 1, just fade it in from the current value if (endView.getAlpha() == 1.0f) { endView.setAlpha(0); + TransitionListener transitionListener = new TransitionListenerAdapter() { + boolean mCanceled = false; + float mPausedAlpha; + + @Override + public void onTransitionCancel(Transition transition) { + endView.setAlpha(1); + mCanceled = true; + } + + @Override + public void onTransitionEnd(Transition transition) { + if (!mCanceled) { + endView.setAlpha(1); + } + } + + @Override + public void onTransitionPause(Transition transition) { + mPausedAlpha = endView.getAlpha(); + endView.setAlpha(1); + } + + @Override + public void onTransitionResume(Transition transition) { + endView.setAlpha(mPausedAlpha); + } + }; + addListener(transitionListener); } return createAnimation(endView, endView.getAlpha(), 1, null); } diff --git a/core/java/android/transition/Transition.java b/core/java/android/transition/Transition.java index 2fb32aa..60b4708 100644 --- a/core/java/android/transition/Transition.java +++ b/core/java/android/transition/Transition.java @@ -1240,12 +1240,13 @@ public abstract class Transition implements Cloneable { View oldView = oldInfo.view; TransitionValues newValues = mEndValues.viewValues != null ? mEndValues.viewValues.get(oldView) : null; + if (newValues == null) { + newValues = mEndValues.idValues.get(oldView.getId()); + } if (oldValues != null) { // if oldValues null, then transition didn't care to stash values, // and won't get canceled - if (newValues == null) { - cancel = true; - } else { + if (newValues != null) { for (String key : oldValues.values.keySet()) { Object oldValue = oldValues.values.get(key); Object newValue = newValues.values.get(key); diff --git a/core/java/android/transition/TransitionManager.java b/core/java/android/transition/TransitionManager.java index 727a98d..44ca4e5 100644 --- a/core/java/android/transition/TransitionManager.java +++ b/core/java/android/transition/TransitionManager.java @@ -349,23 +349,19 @@ public class TransitionManager { * value of null causes the TransitionManager to use the default transition. */ public static void beginDelayedTransition(final ViewGroup sceneRoot, Transition transition) { - - // TEMPORARY: disabling delayed transitions until a fix for the various ActionBar- - // triggered artifacts is found - -// if (!sPendingTransitions.contains(sceneRoot) && sceneRoot.isLaidOut()) { -// if (Transition.DBG) { -// Log.d(LOG_TAG, "beginDelayedTransition: root, transition = " + -// sceneRoot + ", " + transition); -// } -// sPendingTransitions.add(sceneRoot); -// if (transition == null) { -// transition = sDefaultTransition; -// } -// final Transition transitionClone = transition.clone(); -// sceneChangeSetup(sceneRoot, transitionClone); -// Scene.setCurrentScene(sceneRoot, null); -// sceneChangeRunTransition(sceneRoot, transitionClone); -// } + if (!sPendingTransitions.contains(sceneRoot) && sceneRoot.isLaidOut()) { + if (Transition.DBG) { + Log.d(LOG_TAG, "beginDelayedTransition: root, transition = " + + sceneRoot + ", " + transition); + } + sPendingTransitions.add(sceneRoot); + if (transition == null) { + transition = sDefaultTransition; + } + final Transition transitionClone = transition.clone(); + sceneChangeSetup(sceneRoot, transitionClone); + Scene.setCurrentScene(sceneRoot, null); + sceneChangeRunTransition(sceneRoot, transitionClone); + } } } diff --git a/core/java/com/android/internal/app/PlatLogoActivity.java b/core/java/com/android/internal/app/PlatLogoActivity.java index f2eee45..76b8579 100644 --- a/core/java/com/android/internal/app/PlatLogoActivity.java +++ b/core/java/com/android/internal/app/PlatLogoActivity.java @@ -30,6 +30,8 @@ import android.util.DisplayMetrics; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; +import android.view.animation.AccelerateInterpolator; +import android.view.animation.AnticipateOvershootInterpolator; import android.view.animation.DecelerateInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; @@ -41,6 +43,7 @@ public class PlatLogoActivity extends Activity { FrameLayout mContent; int mCount; final Handler mHandler = new Handler(); + static final int BGCOLOR = 0xffed1d24; @Override protected void onCreate(Bundle savedInstanceState) { @@ -53,6 +56,7 @@ public class PlatLogoActivity extends Activity { Typeface light = Typeface.create("sans-serif-light", Typeface.NORMAL); mContent = new FrameLayout(this); + mContent.setBackgroundColor(0xC0000000); final FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT, @@ -64,6 +68,10 @@ public class PlatLogoActivity extends Activity { logo.setScaleType(ImageView.ScaleType.CENTER_INSIDE); logo.setVisibility(View.INVISIBLE); + final View bg = new View(this); + bg.setBackgroundColor(BGCOLOR); + bg.setAlpha(0f); + final TextView letter = new TextView(this); letter.setTypeface(bold); @@ -84,6 +92,7 @@ public class PlatLogoActivity extends Activity { tv.setText("Android " + Build.VERSION.RELEASE); tv.setVisibility(View.INVISIBLE); + mContent.addView(bg); mContent.addView(letter, lp); mContent.addView(logo, lp); @@ -94,22 +103,52 @@ public class PlatLogoActivity extends Activity { mContent.addView(tv, lp2); mContent.setOnClickListener(new View.OnClickListener() { + int clicks; @Override public void onClick(View v) { + clicks++; + if (clicks >= 6) { + mContent.performLongClick(); + return; + } + letter.animate().cancel(); + final float offset = (int)letter.getRotation() % 360; + letter.animate() + .rotationBy((Math.random() > 0.5f ? 360 : -360) - offset) + .setInterpolator(new DecelerateInterpolator()) + .setDuration(700).start(); + } + }); + + mContent.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { if (logo.getVisibility() != View.VISIBLE) { - letter.animate().alpha(0.25f).scaleY(0.75f).scaleX(0.75f).setDuration(2000) + bg.setScaleX(0.01f); + bg.animate().alpha(1f).scaleX(1f).setStartDelay(500).start(); + letter.animate().alpha(0f).scaleY(0.5f).scaleX(0.5f) + .rotationBy(360) + .setInterpolator(new AccelerateInterpolator()) + .setDuration(1000) .start(); logo.setAlpha(0f); logo.setVisibility(View.VISIBLE); - logo.animate().alpha(1f).setDuration(1000).setStartDelay(500).start(); + logo.setScaleX(0.5f); + logo.setScaleY(0.5f); + logo.animate().alpha(1f).scaleX(1f).scaleY(1f) + .setDuration(1000).setStartDelay(500) + .setInterpolator(new AnticipateOvershootInterpolator()) + .start(); tv.setAlpha(0f); tv.setVisibility(View.VISIBLE); tv.animate().alpha(1f).setDuration(1000).setStartDelay(1000).start(); + return true; } + return false; } }); - mContent.setOnLongClickListener(new View.OnLongClickListener() { + logo.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { try { |
