diff options
Diffstat (limited to 'core')
37 files changed, 334 insertions, 255 deletions
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java index 8b70ae6..9709555 100644 --- a/core/java/android/animation/ValueAnimator.java +++ b/core/java/android/animation/ValueAnimator.java @@ -1273,8 +1273,7 @@ public class ValueAnimator extends Animator { } } if (fraction >= 1f) { - if (mCurrentIteration < mRepeatCount || - (mRepeatCount == INFINITE && mDuration != 0)) { + if (mCurrentIteration < mRepeatCount || mRepeatCount == INFINITE) { // Time to repeat if (mListeners != null) { int numListeners = mListeners.size(); diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 38cd126..9568897 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -2377,8 +2377,10 @@ public class Activity extends ContextThemeWrapper if (mDefaultKeyMode == DEFAULT_KEYS_DISABLE) { return false; } else if (mDefaultKeyMode == DEFAULT_KEYS_SHORTCUT) { - if (getWindow().performPanelShortcut(Window.FEATURE_OPTIONS_PANEL, - keyCode, event, Menu.FLAG_ALWAYS_PERFORM_CLOSE)) { + Window w = getWindow(); + if (w.hasFeature(Window.FEATURE_OPTIONS_PANEL) && + w.performPanelShortcut(Window.FEATURE_OPTIONS_PANEL, keyCode, event, + Menu.FLAG_ALWAYS_PERFORM_CLOSE)) { return true; } return false; @@ -2943,7 +2945,8 @@ public class Activity extends ContextThemeWrapper * time it needs to be displayed. */ public void invalidateOptionsMenu() { - if (mActionBar == null || !mActionBar.invalidateOptionsMenu()) { + if (mWindow.hasFeature(Window.FEATURE_OPTIONS_PANEL) && + (mActionBar == null || !mActionBar.invalidateOptionsMenu())) { mWindow.invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL); } } @@ -3155,7 +3158,8 @@ public class Activity extends ContextThemeWrapper * open, this method does nothing. */ public void openOptionsMenu() { - if (mActionBar == null || !mActionBar.openOptionsMenu()) { + if (mWindow.hasFeature(Window.FEATURE_OPTIONS_PANEL) && + (mActionBar == null || !mActionBar.openOptionsMenu())) { mWindow.openPanel(Window.FEATURE_OPTIONS_PANEL, null); } } @@ -3165,7 +3169,9 @@ public class Activity extends ContextThemeWrapper * closed, this method does nothing. */ public void closeOptionsMenu() { - mWindow.closePanel(Window.FEATURE_OPTIONS_PANEL); + if (mWindow.hasFeature(Window.FEATURE_OPTIONS_PANEL)) { + mWindow.closePanel(Window.FEATURE_OPTIONS_PANEL); + } } /** @@ -3224,7 +3230,9 @@ public class Activity extends ContextThemeWrapper * Programmatically closes the most recently opened context menu, if showing. */ public void closeContextMenu() { - mWindow.closePanel(Window.FEATURE_CONTEXT_MENU); + if (mWindow.hasFeature(Window.FEATURE_CONTEXT_MENU)) { + mWindow.closePanel(Window.FEATURE_CONTEXT_MENU); + } } /** diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java index d0d9d71..e3b27b5 100644 --- a/core/java/android/app/ActivityTransitionCoordinator.java +++ b/core/java/android/app/ActivityTransitionCoordinator.java @@ -799,6 +799,15 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { mIsStartingTransition = false; } + /** + * Cancels any pending transitions and returns true if there is a transition is in + * the middle of starting. + */ + protected boolean cancelPendingTransitions() { + mPendingTransition = null; + return mIsStartingTransition; + } + protected void moveSharedElementsToOverlay() { if (mWindow == null || !mWindow.getSharedElementsUseOverlay()) { return; diff --git a/core/java/android/app/ActivityTransitionState.java b/core/java/android/app/ActivityTransitionState.java index 555d20b..a2bfa4e 100644 --- a/core/java/android/app/ActivityTransitionState.java +++ b/core/java/android/app/ActivityTransitionState.java @@ -22,6 +22,7 @@ import android.util.ArrayMap; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; +import android.view.ViewTreeObserver; import android.view.Window; import java.lang.ref.WeakReference; @@ -252,7 +253,7 @@ class ActivityTransitionState { } } - public boolean startExitBackTransition(Activity activity) { + public boolean startExitBackTransition(final Activity activity) { if (mEnteringNames == null) { return false; } else { @@ -260,10 +261,11 @@ class ActivityTransitionState { mHasExited = true; Transition enterViewsTransition = null; ViewGroup decor = null; + boolean delayExitBack = false; if (mEnterTransitionCoordinator != null) { enterViewsTransition = mEnterTransitionCoordinator.getEnterViewsTransition(); decor = mEnterTransitionCoordinator.getDecor(); - mEnterTransitionCoordinator.cancelEnter(); + delayExitBack = mEnterTransitionCoordinator.cancelEnter(); mEnterTransitionCoordinator = null; if (enterViewsTransition != null && decor != null) { enterViewsTransition.pause(decor); @@ -275,7 +277,23 @@ class ActivityTransitionState { if (enterViewsTransition != null && decor != null) { enterViewsTransition.resume(decor); } - mReturnExitCoordinator.startExit(activity.mResultCode, activity.mResultData); + if (delayExitBack && decor != null) { + final ViewGroup finalDecor = decor; + decor.getViewTreeObserver().addOnPreDrawListener( + new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + finalDecor.getViewTreeObserver().removeOnPreDrawListener(this); + if (mReturnExitCoordinator != null) { + mReturnExitCoordinator.startExit(activity.mResultCode, + activity.mResultData); + } + return true; + } + }); + } else { + mReturnExitCoordinator.startExit(activity.mResultCode, activity.mResultData); + } } return true; } diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index 12d4513..067073a 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -910,21 +910,27 @@ public class Dialog implements DialogInterface, Window.Callback, * @see Activity#openOptionsMenu() */ public void openOptionsMenu() { - mWindow.openPanel(Window.FEATURE_OPTIONS_PANEL, null); + if (mWindow.hasFeature(Window.FEATURE_OPTIONS_PANEL)) { + mWindow.openPanel(Window.FEATURE_OPTIONS_PANEL, null); + } } - + /** * @see Activity#closeOptionsMenu() */ public void closeOptionsMenu() { - mWindow.closePanel(Window.FEATURE_OPTIONS_PANEL); + if (mWindow.hasFeature(Window.FEATURE_OPTIONS_PANEL)) { + mWindow.closePanel(Window.FEATURE_OPTIONS_PANEL); + } } /** * @see Activity#invalidateOptionsMenu() */ public void invalidateOptionsMenu() { - mWindow.invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL); + if (mWindow.hasFeature(Window.FEATURE_OPTIONS_PANEL)) { + mWindow.invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL); + } } /** diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java index ecf19c7..c053c83 100644 --- a/core/java/android/app/EnterTransitionCoordinator.java +++ b/core/java/android/app/EnterTransitionCoordinator.java @@ -18,7 +18,6 @@ package android.app; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; -import android.graphics.Matrix; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.ResultReceiver; @@ -565,7 +564,12 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator { clearState(); } - public void cancelEnter() { + /** + * Cancels the enter transition. + * @return True if the enter transition is still pending capturing the target state. If so, + * any transition started on the decor will do nothing. + */ + public boolean cancelEnter() { setGhostVisibility(View.INVISIBLE); mHasStopped = true; mIsCanceled = true; @@ -576,6 +580,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator { } mActivity = null; clearState(); + return super.cancelPendingTransitions(); } private void makeOpaque() { diff --git a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java index e76c23b..67d9de5 100644 --- a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java +++ b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java @@ -119,7 +119,7 @@ public final class BluetoothLeAdvertiser { } boolean isConnectable = settings.isConnectable(); if (totalBytes(advertiseData, isConnectable) > MAX_ADVERTISING_DATA_BYTES || - totalBytes(scanResponse, isConnectable) > MAX_ADVERTISING_DATA_BYTES) { + totalBytes(scanResponse, false) > MAX_ADVERTISING_DATA_BYTES) { postStartFailure(callback, AdvertiseCallback.ADVERTISE_FAILED_DATA_TOO_LARGE); return; } @@ -171,11 +171,11 @@ public final class BluetoothLeAdvertiser { mLeAdvertisers.clear(); } - // Compute the size of the advertise data. - private int totalBytes(AdvertiseData data, boolean isConnectable) { + // Compute the size of advertisement data or scan resp + private int totalBytes(AdvertiseData data, boolean isFlagsIncluded) { if (data == null) return 0; // Flags field is omitted if the advertising is not connectable. - int size = isConnectable ? FLAGS_FIELD_BYTES : 0; + int size = (isFlagsIncluded) ? FLAGS_FIELD_BYTES : 0; if (data.getServiceUuids() != null) { int num16BitUuids = 0; int num32BitUuids = 0; diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java index 9e90d01..482b1f0 100644 --- a/core/java/android/hardware/camera2/CameraDevice.java +++ b/core/java/android/hardware/camera2/CameraDevice.java @@ -147,20 +147,20 @@ public abstract class CameraDevice implements AutoCloseable { * <ul> * * <li>For drawing to a {@link android.view.SurfaceView SurfaceView}: Once the SurfaceView's - * Surface is {@link android.view.SurfaceHolder.Callback#surfaceCreated created}, set the - * size of the Surface with {@link android.view.SurfaceHolder#setFixedSize} to be one of the - * sizes returned by - * {@link StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(SurfaceHolder.class)} - * and then obtain the Surface by calling {@link android.view.SurfaceHolder#getSurface}.</li> - * - * <li>For accessing through an OpenGL texture via a - * {@link android.graphics.SurfaceTexture SurfaceTexture}: Set the size of - * the SurfaceTexture with - * {@link android.graphics.SurfaceTexture#setDefaultBufferSize} to be one - * of the sizes returned by + * Surface is {@link android.view.SurfaceHolder.Callback#surfaceCreated created}, set the size + * of the Surface with {@link android.view.SurfaceHolder#setFixedSize} to be one of the sizes + * returned by {@link StreamConfigurationMap#getOutputSizes(Class) + * getOutputSizes(SurfaceHolder.class)} and then obtain the Surface by calling {@link + * android.view.SurfaceHolder#getSurface}. If the size is not set by the application, it will + * be rounded to the nearest supported size less than 1080p, by the camera device.</li> + * + * <li>For accessing through an OpenGL texture via a {@link android.graphics.SurfaceTexture + * SurfaceTexture}: Set the size of the SurfaceTexture with {@link + * android.graphics.SurfaceTexture#setDefaultBufferSize} to be one of the sizes returned by * {@link StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(SurfaceTexture.class)} - * before creating a Surface from the SurfaceTexture with - * {@link Surface#Surface}.</li> + * before creating a Surface from the SurfaceTexture with {@link Surface#Surface}. If the size + * is not set by the application, it will be set to be the smallest supported size less than + * 1080p, by the camera device.</li> * * <li>For recording with {@link android.media.MediaCodec}: Call * {@link android.media.MediaCodec#createInputSurface} after configuring @@ -189,6 +189,8 @@ public abstract class CameraDevice implements AutoCloseable { * corresponding supported sizes by passing the chosen output format into * {@link StreamConfigurationMap#getOutputSizes(int)}. Then obtain a * {@link android.view.Surface} from it with {@link android.media.ImageReader#getSurface()}. + * If the ImageReader size is not set to a supported size, it will be rounded to a supported + * size less than 1080p by the camera device. * </li> * * </ul> diff --git a/core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java b/core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java index 3043d13..367a078 100644 --- a/core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java +++ b/core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java @@ -85,7 +85,7 @@ public class LegacyCameraDevice implements AutoCloseable { private static final int GRALLOC_USAGE_HW_COMPOSER = 0x00000800; private static final int GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000; - private static final int MAX_DIMEN_FOR_ROUNDING = 1080; // maximum allowed width for rounding + public static final int MAX_DIMEN_FOR_ROUNDING = 1080; // maximum allowed width for rounding private CaptureResultExtras getExtrasFromRequest(RequestHolder holder) { if (holder == null) { @@ -299,15 +299,8 @@ public class LegacyCameraDevice implements AutoCloseable { try { Size s = getSurfaceSize(output); int surfaceType = detectSurfaceType(output); - int usageFlags = detectSurfaceUsageFlags(output); - // Keep up to date with allowed consumer types in - // frameworks/av/services/camera/libcameraservice/api2/CameraDeviceClient.cpp - int disallowedFlags = GRALLOC_USAGE_HW_VIDEO_ENCODER | GRALLOC_USAGE_RENDERSCRIPT; - int allowedFlags = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_SW_READ_OFTEN | - GRALLOC_USAGE_HW_COMPOSER; - boolean flexibleConsumer = ((usageFlags & disallowedFlags) == 0 && - (usageFlags & allowedFlags) != 0); + boolean flexibleConsumer = isFlexibleConsumer(output); Size[] sizes = streamConfigurations.getOutputSizes(surfaceType); if (sizes == null) { @@ -531,7 +524,7 @@ public class LegacyCameraDevice implements AutoCloseable { * @throws NullPointerException if the {@code surface} was {@code null} * @throws IllegalStateException if the {@code surface} was invalid */ - static Size getSurfaceSize(Surface surface) throws BufferQueueAbandonedException { + public static Size getSurfaceSize(Surface surface) throws BufferQueueAbandonedException { checkNotNull(surface); int[] dimens = new int[2]; @@ -540,12 +533,31 @@ public class LegacyCameraDevice implements AutoCloseable { return new Size(dimens[0], dimens[1]); } + public static boolean isFlexibleConsumer(Surface output) { + int usageFlags = detectSurfaceUsageFlags(output); + + // Keep up to date with allowed consumer types in + // frameworks/av/services/camera/libcameraservice/api2/CameraDeviceClient.cpp + int disallowedFlags = GRALLOC_USAGE_HW_VIDEO_ENCODER | GRALLOC_USAGE_RENDERSCRIPT; + int allowedFlags = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_SW_READ_OFTEN | + GRALLOC_USAGE_HW_COMPOSER; + boolean flexibleConsumer = ((usageFlags & disallowedFlags) == 0 && + (usageFlags & allowedFlags) != 0); + return flexibleConsumer; + } + + /** + * Query the surface for its currently configured usage flags + */ static int detectSurfaceUsageFlags(Surface surface) { checkNotNull(surface); return nativeDetectSurfaceUsageFlags(surface); } - static int detectSurfaceType(Surface surface) throws BufferQueueAbandonedException { + /** + * Query the surface for its currently configured format + */ + public static int detectSurfaceType(Surface surface) throws BufferQueueAbandonedException { checkNotNull(surface); return LegacyExceptionUtils.throwOnError(nativeDetectSurfaceType(surface)); } diff --git a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java index 03540e1..347db05 100644 --- a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java +++ b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java @@ -328,15 +328,15 @@ public class LegacyMetadataMapper { appendStreamConfig(availableStreamConfigs, ImageFormat.YUV_420_888, previewSizes); for (int format : p.getSupportedPreviewFormats()) { - if (ImageFormat.isPublicFormat(format)) { + if (ImageFormat.isPublicFormat(format) && format != ImageFormat.NV21) { appendStreamConfig(availableStreamConfigs, format, previewSizes); - } else { + } else if (VERBOSE) { /* * Do not add any formats unknown to us * (since it would fail runtime checks in StreamConfigurationMap) */ - Log.w(TAG, - String.format("mapStreamConfigs - Skipping non-public format %x", format)); + Log.v(TAG, + String.format("mapStreamConfigs - Skipping format %x", format)); } } @@ -389,8 +389,8 @@ public class LegacyMetadataMapper { int j = 0; for (String mode : antiBandingModes) { int convertedMode = convertAntiBandingMode(mode); - if (convertedMode == -1) { - Log.w(TAG, "Antibanding mode " + ((mode == null) ? "NULL" : mode) + + if (VERBOSE && convertedMode == -1) { + Log.v(TAG, "Antibanding mode " + ((mode == null) ? "NULL" : mode) + " not supported, skipping..."); } else { modes[j++] = convertedMode; diff --git a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java index 5d226e3..479c842 100644 --- a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java +++ b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java @@ -22,6 +22,9 @@ import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.utils.HashCodeHelpers; +import android.hardware.camera2.legacy.LegacyCameraDevice; +import android.hardware.camera2.legacy.LegacyMetadataMapper; +import android.hardware.camera2.legacy.LegacyExceptionUtils.BufferQueueAbandonedException; import android.view.Surface; import android.util.Log; import android.util.Range; @@ -292,13 +295,21 @@ public final class StreamConfigurationMap { * </li> * </ul> * - * This is not an exhaustive list; see the particular class's documentation for further + * <p>Surfaces from flexible sources will return true even if the exact size of the Surface does + * not match a camera-supported size, as long as the format (or class) is supported and the + * camera device supports a size that is equal to or less than 1080p in that format. If such as + * Surface is used to create a capture session, it will have its size rounded to the nearest + * supported size, below or equal to 1080p. Flexible sources include SurfaceView, SurfaceTexture, + * and ImageReader.</p> + * + * <p>This is not an exhaustive list; see the particular class's documentation for further * possible reasons of incompatibility.</p> * * @param surface a non-{@code null} {@link Surface} object reference * @return {@code true} if this is supported, {@code false} otherwise * * @throws NullPointerException if {@code surface} was {@code null} + * @throws IllegalArgumentException if the Surface endpoint is no longer valid * * @see CameraDevice#createCaptureSession * @see #isOutputSupportedFor(Class) @@ -306,9 +317,37 @@ public final class StreamConfigurationMap { public boolean isOutputSupportedFor(Surface surface) { checkNotNull(surface, "surface must not be null"); - throw new UnsupportedOperationException("Not implemented yet"); + Size surfaceSize; + int surfaceFormat = -1; + try { + surfaceSize = LegacyCameraDevice.getSurfaceSize(surface); + surfaceFormat = LegacyCameraDevice.detectSurfaceType(surface); + } catch(BufferQueueAbandonedException e) { + throw new IllegalArgumentException("Abandoned surface", e); + } + + // See if consumer is flexible. + boolean isFlexible = LegacyCameraDevice.isFlexibleConsumer(surface); - // TODO: JNI function that checks the Surface's IGraphicBufferProducer state + // Override RGB formats to IMPLEMENTATION_DEFINED, b/9487482 + if ((surfaceFormat >= LegacyMetadataMapper.HAL_PIXEL_FORMAT_RGBA_8888 && + surfaceFormat <= LegacyMetadataMapper.HAL_PIXEL_FORMAT_BGRA_8888)) { + surfaceFormat = LegacyMetadataMapper.HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED; + } + + for (StreamConfiguration config : mConfigurations) { + if (config.getFormat() == surfaceFormat && config.isOutput()) { + // Mathing format, either need exact size match, or a flexible consumer + // and a size no bigger than MAX_DIMEN_FOR_ROUNDING + if (config.getSize().equals(surfaceSize)) { + return true; + } else if (isFlexible && + (config.getSize().getWidth() <= LegacyCameraDevice.MAX_DIMEN_FOR_ROUNDING)) { + return true; + } + } + } + return false; } /** @@ -1027,7 +1066,8 @@ public final class StreamConfigurationMap { int i = 0; for (int format : getFormatsMap(output).keySet()) { - if (format != HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) { + if (format != HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED && + format != HAL_PIXEL_FORMAT_RAW_OPAQUE) { formats[i++] = format; } } @@ -1089,6 +1129,10 @@ public final class StreamConfigurationMap { if (formatsMap.containsKey(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED)) { size -= 1; } + if (formatsMap.containsKey(HAL_PIXEL_FORMAT_RAW_OPAQUE)) { + size -= 1; + } + return size; } diff --git a/core/java/android/hardware/camera2/utils/ArrayUtils.java b/core/java/android/hardware/camera2/utils/ArrayUtils.java index 5a78bbd..79a335c 100644 --- a/core/java/android/hardware/camera2/utils/ArrayUtils.java +++ b/core/java/android/hardware/camera2/utils/ArrayUtils.java @@ -117,7 +117,7 @@ public class ArrayUtils { // Guard against unexpected values if (strIndex < 0) { - Log.w(TAG, "Ignoring invalid value " + str); + if (VERBOSE) Log.v(TAG, "Ignoring invalid value " + str); continue; } diff --git a/core/java/android/hardware/hdmi/HdmiDeviceInfo.java b/core/java/android/hardware/hdmi/HdmiDeviceInfo.java index c4c7f2d..48ea9a6 100644 --- a/core/java/android/hardware/hdmi/HdmiDeviceInfo.java +++ b/core/java/android/hardware/hdmi/HdmiDeviceInfo.java @@ -77,10 +77,19 @@ public class HdmiDeviceInfo implements Parcelable { /** Invalid port ID */ public static final int PORT_INVALID = -1; + /** Invalid device ID */ + public static final int ID_INVALID = 0xFFFF; + + /** Device info used to indicate an inactivated device. */ + public static final HdmiDeviceInfo INACTIVE_DEVICE = new HdmiDeviceInfo(); + private static final int HDMI_DEVICE_TYPE_CEC = 0; private static final int HDMI_DEVICE_TYPE_MHL = 1; private static final int HDMI_DEVICE_TYPE_HARDWARE = 2; + // Type used to indicate the device that has relinquished its active source status. + private static final int HDMI_DEVICE_TYPE_INACTIVE = 100; + // Offset used for id value. MHL devices, for instance, will be assigned the value from // ID_OFFSET_MHL. private static final int ID_OFFSET_CEC = 0x0; @@ -130,6 +139,8 @@ public class HdmiDeviceInfo implements Parcelable { return new HdmiDeviceInfo(physicalAddress, portId, adopterId, deviceId); case HDMI_DEVICE_TYPE_HARDWARE: return new HdmiDeviceInfo(physicalAddress, portId); + case HDMI_DEVICE_TYPE_INACTIVE: + return HdmiDeviceInfo.INACTIVE_DEVICE; default: return null; } @@ -208,7 +219,6 @@ public class HdmiDeviceInfo implements Parcelable { mDeviceId = -1; mAdopterId = -1; - } /** @@ -237,6 +247,28 @@ public class HdmiDeviceInfo implements Parcelable { } /** + * Constructor. Used to initialize the instance representing an inactivated device. + * Can be passed input change listener to indicate the active source yielded + * its status, hence the listener should take an appropriate action such as + * switching to other input. + */ + public HdmiDeviceInfo() { + mHdmiDeviceType = HDMI_DEVICE_TYPE_INACTIVE; + mPhysicalAddress = PATH_INVALID; + mId = ID_INVALID; + + mLogicalAddress = -1; + mDeviceType = DEVICE_INACTIVE; + mPortId = PORT_INVALID; + mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN; + mDisplayName = "Inactive"; + mVendorId = 0; + + mDeviceId = -1; + mAdopterId = -1; + } + + /** * Returns the id of the device. */ public int getId() { @@ -364,6 +396,14 @@ public class HdmiDeviceInfo implements Parcelable { } /** + * Return {@code true} if the device represents an inactivated device that relinquishes + * its status as active source by <Active Source> (HDMI-CEC) or Content-off (MHL). + */ + public boolean isInactivated() { + return mHdmiDeviceType == HDMI_DEVICE_TYPE_INACTIVE; + } + + /** * Returns display (OSD) name of the device. */ public String getDisplayName() { @@ -411,6 +451,8 @@ public class HdmiDeviceInfo implements Parcelable { dest.writeInt(mDeviceId); dest.writeInt(mAdopterId); break; + case HDMI_DEVICE_TYPE_INACTIVE: + // flow through default: // no-op } @@ -438,6 +480,9 @@ public class HdmiDeviceInfo implements Parcelable { case HDMI_DEVICE_TYPE_HARDWARE: s.append("Hardware: "); break; + case HDMI_DEVICE_TYPE_INACTIVE: + s.append("Inactivated: "); + break; default: return ""; } diff --git a/core/java/android/hardware/hdmi/HdmiRecordSources.java b/core/java/android/hardware/hdmi/HdmiRecordSources.java index 922b8e7..7e94b89 100644 --- a/core/java/android/hardware/hdmi/HdmiRecordSources.java +++ b/core/java/android/hardware/hdmi/HdmiRecordSources.java @@ -759,6 +759,8 @@ public final class HdmiRecordSources { */ @SystemApi public static boolean checkRecordSource(byte[] recordSource) { + if (recordSource == null || recordSource.length == 0) return false; + int recordSourceType = recordSource[0]; int extraDataSize = recordSource.length - 1; switch (recordSourceType) { diff --git a/core/java/android/net/StaticIpConfiguration.java b/core/java/android/net/StaticIpConfiguration.java index 598a503..365f2b6 100644 --- a/core/java/android/net/StaticIpConfiguration.java +++ b/core/java/android/net/StaticIpConfiguration.java @@ -76,15 +76,22 @@ public class StaticIpConfiguration implements Parcelable { /** * Returns the network routes specified by this object. Will typically include a - * directly-connected route for the IP address's local subnet and a default route. + * directly-connected route for the IP address's local subnet and a default route. If the + * default gateway is not covered by the directly-connected route, it will also contain a host + * route to the gateway as well. This configuration is arguably invalid, but it used to work + * in K and earlier, and other OSes appear to accept it. */ public List<RouteInfo> getRoutes(String iface) { - List<RouteInfo> routes = new ArrayList<RouteInfo>(2); + List<RouteInfo> routes = new ArrayList<RouteInfo>(3); if (ipAddress != null) { - routes.add(new RouteInfo(ipAddress, null, iface)); + RouteInfo connectedRoute = new RouteInfo(ipAddress, null, iface); + routes.add(connectedRoute); + if (gateway != null && !connectedRoute.matches(gateway)) { + routes.add(RouteInfo.makeHostRoute(gateway, iface)); + } } if (gateway != null) { - routes.add(new RouteInfo((LinkAddress) null, gateway, iface)); + routes.add(new RouteInfo((IpPrefix) null, gateway, iface)); } return routes; } diff --git a/core/java/android/net/VpnService.java b/core/java/android/net/VpnService.java index f6b6978..c26af06 100644 --- a/core/java/android/net/VpnService.java +++ b/core/java/android/net/VpnService.java @@ -501,7 +501,7 @@ public class VpnService extends Service { } } } - mRoutes.add(new RouteInfo(new LinkAddress(address, prefixLength), null)); + mRoutes.add(new RouteInfo(new IpPrefix(address, prefixLength), null)); mConfig.updateAllowedFamilies(address); return this; } diff --git a/core/java/android/util/NtpTrustedTime.java b/core/java/android/util/NtpTrustedTime.java index 602a68c..8ebcacd 100644 --- a/core/java/android/util/NtpTrustedTime.java +++ b/core/java/android/util/NtpTrustedTime.java @@ -19,6 +19,8 @@ package android.util; import android.content.ContentResolver; import android.content.Context; import android.content.res.Resources; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; import android.net.SntpClient; import android.os.SystemClock; import android.provider.Settings; @@ -34,10 +36,13 @@ public class NtpTrustedTime implements TrustedTime { private static final boolean LOGD = false; private static NtpTrustedTime sSingleton; + private static Context sContext; private final String mServer; private final long mTimeout; + private ConnectivityManager mCM; + private boolean mHasCache; private long mCachedNtpTime; private long mCachedNtpElapsedRealtime; @@ -66,6 +71,7 @@ public class NtpTrustedTime implements TrustedTime { final String server = secureServer != null ? secureServer : defaultServer; sSingleton = new NtpTrustedTime(server, timeout); + sContext = context; } return sSingleton; @@ -78,6 +84,20 @@ public class NtpTrustedTime implements TrustedTime { return false; } + // We can't do this at initialization time: ConnectivityService might not be running yet. + synchronized (this) { + if (mCM == null) { + mCM = (ConnectivityManager) sContext.getSystemService(Context.CONNECTIVITY_SERVICE); + } + } + + final NetworkInfo ni = mCM == null ? null : mCM.getActiveNetworkInfo(); + if (ni == null || !ni.isConnected()) { + if (LOGD) Log.d(TAG, "forceRefresh: no connectivity"); + return false; + } + + if (LOGD) Log.d(TAG, "forceRefresh() from cache miss"); final SntpClient client = new SntpClient(); if (client.requestTime(mServer, (int) mTimeout)) { diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 6a36c26..ed75de3 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -5932,23 +5932,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return true; } - /** - * Adds the clickable rectangles withing the bounds of this view. They - * may overlap. This method is intended for use only by the accessibility - * layer. - * - * @param outRects List to which to add clickable areas. - * - * @hide - */ - public void addClickableRectsForAccessibility(List<RectF> outRects) { - if (isClickable() || isLongClickable()) { - RectF bounds = new RectF(); - bounds.set(0, 0, getWidth(), getHeight()); - outRects.add(bounds); - } - } - static void offsetRects(List<RectF> rects, float offsetX, float offsetY) { final int rectCount = rects.size(); for (int i = 0; i < rectCount; i++) { @@ -16650,6 +16633,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (changed) { requestLayout(); + invalidateOutline(); } } diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 6678ff2..0b1a2d4 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -829,8 +829,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // Clip the bounds by our bounds. bounds.left = Math.max(bounds.left, 0); bounds.top = Math.max(bounds.top, 0); - bounds.right = Math.min(bounds.right, mRight); - bounds.bottom = Math.min(bounds.bottom, mBottom); + bounds.right = Math.min(bounds.right, getWidth()); + bounds.bottom = Math.min(bounds.bottom, getHeight()); Iterator<View> iterator = obtainOrderedChildIterator(); while (iterator.hasNext()) { @@ -855,27 +855,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // Compute the intersection between the child and the sibling. if (siblingBounds.intersect(bounds)) { - List<RectF> clickableRects = new ArrayList<>(); - sibling.addClickableRectsForAccessibility(clickableRects); - - final int clickableRectCount = clickableRects.size(); - for (int j = 0; j < clickableRectCount; j++) { - RectF clickableRect = clickableRects.get(j); - - // Translate the clickable rect to our coordinates. - offsetChildRectToMyCoords(clickableRect, sibling); - - // Compute the intersection between the child and the clickable rects. - if (clickableRect.intersect(bounds)) { - // If a clickable rect completely covers the child, done. - if (clickableRect.equals(bounds)) { - releaseOrderedChildIterator(); - return false; - } - // Keep track of the intersection rectangle. - intersections.add(clickableRect); - } - } + // Conservatively we consider an overlapping sibling to be + // interactive and ignore it. This is not ideal as if the + // sibling completely covers the view despite handling no + // touch events we will not be able to click on the view. + intersections.add(siblingBounds); } } @@ -890,54 +874,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager return true; } - /** - * @hide - */ - @Override - public void addClickableRectsForAccessibility(List<RectF> outRects) { - int sizeBefore = outRects.size(); - - super.addClickableRectsForAccessibility(outRects); - - // If we added ourselves, then no need to visit children. - if (outRects.size() > sizeBefore) { - return; - } - - Iterator<View> iterator = obtainOrderedChildIterator(); - while (iterator.hasNext()) { - View child = iterator.next(); - - // Cannot click on an invisible view. - if (!isVisible(child)) { - continue; - } - - sizeBefore = outRects.size(); - - // Add clickable rects in the child bounds. - child.addClickableRectsForAccessibility(outRects); - - // Offset the clickable rects for out children to our coordinates. - final int sizeAfter = outRects.size(); - for (int j = sizeBefore; j < sizeAfter; j++) { - RectF rect = outRects.get(j); - - // Translate the clickable rect to our coordinates. - offsetChildRectToMyCoords(rect, child); - - // If a clickable rect fills the parent, done. - if ((int) rect.left == 0 && (int) rect.top == 0 - && (int) rect.right == mRight && (int) rect.bottom == mBottom) { - releaseOrderedChildIterator(); - return; - } - } - } - - releaseOrderedChildIterator(); - } - private void offsetChildRectToMyCoords(RectF rect, View child) { if (!child.hasIdentityMatrix()) { child.getMatrix().mapRect(rect); diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index 371b480..1b93b97 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -762,18 +762,6 @@ public class HorizontalScrollView extends FrameLayout { awakenScrollBars(); } - /** - * @hide - */ - @Override - public void addClickableRectsForAccessibility(List<RectF> outRects) { - // This class always consumes touch events, therefore if it - // covers a view we do not want to send a click over it. - RectF bounds = new RectF(); - bounds.set(0, 0, getWidth(), getHeight()); - outRects.add(bounds); - } - @Override public boolean performAccessibilityAction(int action, Bundle arguments) { if (super.performAccessibilityAction(action, arguments)) { diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java index fe8b08b..d85bbb9 100644 --- a/core/java/android/widget/ListPopupWindow.java +++ b/core/java/android/widget/ListPopupWindow.java @@ -1648,19 +1648,32 @@ public class ListPopupWindow { private void setPressedItem(View child, int position, float x, float y) { mDrawsInPressedState = true; - // Ordering is essential. First update the pressed state and layout - // the children. This will ensure the selector actually gets drawn. - setPressed(true); - layoutChildren(); + // Ordering is essential. First, update the container's pressed state. + drawableHotspotChanged(x, y); + if (!isPressed()) { + setPressed(true); + } + + // Next, run layout if we need to stabilize child positions. + if (mDataChanged) { + layoutChildren(); + } // Manage the pressed view based on motion position. This allows us to // play nicely with actual touch and scroll events. final View motionView = getChildAt(mMotionPosition - mFirstPosition); - if (motionView != null) { + if (motionView != null && motionView != child && motionView.isPressed()) { motionView.setPressed(false); } mMotionPosition = position; - child.setPressed(true); + + // Offset for child coordinates. + final float childX = x - child.getLeft(); + final float childY = y - child.getTop(); + child.drawableHotspotChanged(childX, childY); + if (!child.isPressed()) { + child.setPressed(true); + } // Ensure that keyboard focus starts from the last touched position. setSelectedPositionInt(position); diff --git a/core/java/android/widget/RadialTimePickerView.java b/core/java/android/widget/RadialTimePickerView.java index 7b64cf5..11fda2c 100644 --- a/core/java/android/widget/RadialTimePickerView.java +++ b/core/java/android/widget/RadialTimePickerView.java @@ -1381,11 +1381,19 @@ public class RadialTimePickerView extends View implements View.OnTouchListener { @Override protected int getVirtualViewAt(float x, float y) { final int id; + + // Calling getDegreesXY() has side-effects, so we need to cache the + // current inner circle value and restore after the call. + final boolean wasOnInnerCircle = mIsOnInnerCircle; final int degrees = getDegreesFromXY(x, y); + final boolean isOnInnerCircle = mIsOnInnerCircle; + mIsOnInnerCircle = wasOnInnerCircle; + if (degrees != -1) { final int snapDegrees = snapOnly30s(degrees, 0) % 360; if (mShowHours) { - final int hour = getHourForDegrees(snapDegrees, mIsOnInnerCircle); + final int hour24 = getHourForDegrees(snapDegrees, isOnInnerCircle); + final int hour = mIs24HourMode ? hour24 : hour24To12(hour24); id = makeId(TYPE_HOUR, hour); } else { final int current = getCurrentMinute(); @@ -1514,6 +1522,16 @@ public class RadialTimePickerView extends View implements View.OnTouchListener { return hour24; } + private int hour24To12(int hour24) { + if (hour24 == 0) { + return 12; + } else if (hour24 > 12) { + return hour24 - 12; + } else { + return hour24; + } + } + private void getBoundsForVirtualView(int virtualViewId, Rect bounds) { final float radius; final int type = getTypeFromId(virtualViewId); diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index cc5d457..7dc64bd 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -658,6 +658,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener ColorStateList textColorLink = null; int textSize = 15; String fontFamily = null; + boolean fontFamilyExplicit = false; int typefaceIndex = -1; int styleIndex = -1; boolean allCaps = false; @@ -1012,6 +1013,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener case com.android.internal.R.styleable.TextView_fontFamily: fontFamily = a.getString(attr); + fontFamilyExplicit = true; break; case com.android.internal.R.styleable.TextView_password: @@ -1300,6 +1302,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener typefaceIndex = MONOSPACE; } + if (typefaceIndex != -1 && !fontFamilyExplicit) { + fontFamily = null; + } setTypefaceFromAttrs(fontFamily, typefaceIndex, styleIndex); if (shadowcolor != 0) { diff --git a/core/java/android/widget/Toolbar.java b/core/java/android/widget/Toolbar.java index f90d64a..c5325c4 100644 --- a/core/java/android/widget/Toolbar.java +++ b/core/java/android/widget/Toolbar.java @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.app.ActionBar; import android.content.Context; import android.content.res.TypedArray; +import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; diff --git a/core/java/com/android/internal/net/VpnConfig.java b/core/java/com/android/internal/net/VpnConfig.java index c5d9db4..921f1fe 100644 --- a/core/java/com/android/internal/net/VpnConfig.java +++ b/core/java/com/android/internal/net/VpnConfig.java @@ -24,6 +24,7 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.res.Resources; +import android.net.IpPrefix; import android.net.LinkAddress; import android.net.Network; import android.net.RouteInfo; @@ -117,9 +118,7 @@ public class VpnConfig implements Parcelable { String[] routes = routesStr.trim().split(" "); for (String route : routes) { //each route is ip/prefix - String[] split = route.split("/"); - RouteInfo info = new RouteInfo(new LinkAddress - (InetAddress.parseNumericAddress(split[0]), Integer.parseInt(split[1])), null); + RouteInfo info = new RouteInfo(new IpPrefix(route), null); this.routes.add(info); updateAllowedFamilies(info.getDestination().getAddress()); } @@ -132,9 +131,7 @@ public class VpnConfig implements Parcelable { String[] addresses = addressesStr.trim().split(" "); for (String address : addresses) { //each address is ip/prefix - String[] split = address.split("/"); - LinkAddress addr = new LinkAddress(InetAddress.parseNumericAddress(split[0]), - Integer.parseInt(split[1])); + LinkAddress addr = new LinkAddress(address); this.addresses.add(addr); updateAllowedFamilies(addr.getAddress()); } diff --git a/core/java/com/android/internal/widget/ActionBarContainer.java b/core/java/com/android/internal/widget/ActionBarContainer.java index 847a47d..7937a95 100644 --- a/core/java/com/android/internal/widget/ActionBarContainer.java +++ b/core/java/com/android/internal/widget/ActionBarContainer.java @@ -23,6 +23,7 @@ import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Outline; import android.graphics.PixelFormat; +import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.ActionMode; @@ -31,6 +32,8 @@ import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; +import java.util.List; + /** * This class acts as a container for the action bar view and action mode context views. * It applies special styles as needed to help handle animated transitions between them. diff --git a/core/jni/android/graphics/NinePatchPeeker.cpp b/core/jni/android/graphics/NinePatchPeeker.cpp index 1dafa1b..d99ddeb 100644 --- a/core/jni/android/graphics/NinePatchPeeker.cpp +++ b/core/jni/android/graphics/NinePatchPeeker.cpp @@ -24,7 +24,9 @@ bool NinePatchPeeker::peek(const char tag[], const void* data, size_t length) { if (!strcmp("npTc", tag) && length >= sizeof(Res_png_9patch)) { Res_png_9patch* patch = (Res_png_9patch*) data; size_t patchSize = patch->serializedSize(); - assert(length == patchSize); + if (length != patchSize) { + return false; + } // You have to copy the data because it is owned by the png reader Res_png_9patch* patchNew = (Res_png_9patch*) malloc(patchSize); memcpy(patchNew, patch, patchSize); diff --git a/core/res/res/drawable/ic_corp_badge.xml b/core/res/res/drawable/ic_corp_badge.xml index 3a66507..8917431 100644 --- a/core/res/res/drawable/ic_corp_badge.xml +++ b/core/res/res/drawable/ic_corp_badge.xml @@ -14,23 +14,20 @@ Copyright (C) 2014 The Android Open Source Project limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="19.0dp" - android:height="19.0dp" - android:viewportWidth="19.0" - android:viewportHeight="19.0"> + android:width="20.0dp" + android:height="20.0dp" + android:viewportWidth="20.0" + android:viewportHeight="20.0"> <path - android:pathData="M9.5,9.5m-9.5,0a9.5,9.5 0,1 1,19 0a9.5,9.5 0,1 1,-19 0" + android:pathData="M10.0,10.0m-10.0,0.0a10.0,10.0 0.0,1.0 1.0,20.0 0.0a10.0,10.0 0.0,1.0 1.0,-20.0 0.0" android:fillColor="#FF5722"/> <path - android:pathData="M13.741,6.286l-1.53,0L12.211,5.247l-1.039,-1.039L8.025,4.208L6.986,5.247l0,1.039L5.429,6.286c-0.574,0 -1.034,0.465 -1.034,1.039L4.39,13.039c0.0,0.574 0.465,1.039 1.039,1.039l8.312,0c0.574,0 1.039,-0.465 1.039,-1.039L14.780001,7.325C14.78,6.751 14.316,6.286 13.741,6.286zM11.173,6.286L8.025,6.286L8.025,5.247l3.147,0L11.172,6.286z" + android:pathData="M15.2,6.2L4.8,6.2c-0.5,0.0 -0.9,0.4 -0.9,1.0L3.9,10.0c0.0,0.5 0.4,1.0 0.9,1.0l3.8,0.0l0.0,-1.0l2.9,0.0l0.0,1.0l3.8,0.0c0.5,0.0 1.0,-0.4 1.0,-1.0L16.3,7.1C16.2,6.6 15.8,6.2 15.2,6.2z" android:fillColor="#FFFFFF"/> <path - android:pathData="M15.172,7.039c0.0,-0.58 -0.501,-1.05 -1.12,-1.05L5.113,5.989c-0.619,0 -1.115,0.47 -1.115,1.05l0.002,2.193c0,0.618 0.5,1.118 1.118,1.118l8.931,0c0.618,0 1.118,-0.5 1.118,-1.118L15.172,7.039z" + android:pathData="M8.6,12.9l0.0,-1.0L4.3,11.9l0.0,2.4c0.0,0.5 0.4,0.9 0.9,0.9l9.5,0.0c0.5,0.0 0.9,-0.4 0.9,-0.9l0.0,-2.4l-4.3,0.0l0.0,1.0L8.6,12.9z" android:fillColor="#FFFFFF"/> <path - android:pathData="M3.5,9.812l12,0l0,1l-12,0z" - android:fillColor="#FF5722"/> - <path - android:pathData="M8.567,9.467l2.037,0l0,2.037l-2.037,0z" - android:fillColor="#FF5722"/> + android:pathData="M7.1,5.2l0.0,1.0 1.0,0.0 0.0,-1.0 3.799999,0.0 0.0,1.0 1.0,0.0 0.0,-1.0 -1.0,-0.9 -3.799999,0.0z" + android:fillColor="#FFFFFF"/> </vector> diff --git a/core/res/res/drawable/ic_corp_icon_badge.xml b/core/res/res/drawable/ic_corp_icon_badge.xml index 538dade..0273545 100644 --- a/core/res/res/drawable/ic_corp_icon_badge.xml +++ b/core/res/res/drawable/ic_corp_icon_badge.xml @@ -20,25 +20,22 @@ Copyright (C) 2014 The Android Open Source Project android:viewportHeight="64.0"> <path android:fillColor="#FF000000" - android:pathData="M49.062,50.0m-14.0,0.0a14.0,14.0 0.0,1.0 1.0,28.0 0.0a14.0,14.0 0.0,1.0 1.0,-28.0 0.0" + android:pathData="M49.1,50.1m-13.9,0.0a13.9,13.9 0.0,1.0 1.0,27.8 0.0a13.9,13.9 0.0,1.0 1.0,-27.8 0.0" android:fillAlpha="0.2"/> <path android:fillColor="#FF000000" - android:pathData="M49.0,49.5m-14.0,0.0a14.0,14.0 0.0,1.0 1.0,28.0 0.0a14.0,14.0 0.0,1.0 1.0,-28.0 0.0" + android:pathData="M49.1,49.4m-13.9,0.0a13.9,13.9 0.0,1.0 1.0,27.8 0.0a13.9,13.9 0.0,1.0 1.0,-27.8 0.0" android:fillAlpha="0.2"/> <path - android:pathData="M49.0,49.0m-14.0,0.0a14.0,14.0 0.0,1.0 1.0,28.0 0.0a14.0,14.0 0.0,1.0 1.0,-28.0 0.0" + android:pathData="M49.1,48.8m-13.9,0.0a13.9,13.9 0.0,1.0 1.0,27.8 0.0a13.9,13.9 0.0,1.0 1.0,-27.8 0.0" android:fillColor="#FF5722"/> <path - android:pathData="M55.801,43.688l-2.837,-0.001l0.0,-1.137l-1.587,-1.588l-4.72,-0.001l-1.588,1.587l0.0,1.137l-2.867,-0.001c-0.94,0.0 -1.691,0.76 -1.691,1.699L40.5,48.654c0.0,0.94 0.76,1.7 1.699,1.7l5.255,0.001l0.0,-1.271l0.225,0.0l2.589,0.0l0.225,0.0l0.0,1.271l5.303,0.001c0.939,0.0 1.7,-0.76 1.7,-1.699l0.002,-3.269C57.5,44.449 56.74,43.689 55.801,43.688zM51.377,43.687l-4.72,-0.001l0.0,-1.137l4.72,0.001L51.377,43.687z" + android:pathData="M56.4,43.5L41.8,43.5c-0.7,0.0 -1.3,0.6 -1.3,1.3l0.0,4.0c0.0,0.7 0.6,1.3 1.3,1.3L47.0,50.1l0.0,-1.3l4.0,0.0l0.0,1.4l5.4,0.0c0.7,0.0 1.3,-0.6 1.3,-1.3l0.0,-4.0C57.6,44.1 57.0,43.5 56.4,43.5z" android:fillColor="#FFFFFF"/> <path - android:pathData="M50.494,52.012l-3.04,0.0l0.0,-0.901l-6.417,0.0l0.0,3.172c0.0,0.94 0.741,1.7 1.68,1.7l12.464,0.003c0.939,0.0 1.702,-0.76 1.703,-1.699l0.0,-3.176l-6.39,0.0L50.494,52.012z" + android:pathData="M47.1,52.8l0.0,-1.3l-6.0,0.0l0.0,3.3c0.0,0.7 0.6,1.3 1.3,1.3l13.2,0.0c0.7,0.0 1.3,-0.6 1.3,-1.3l0.0,-3.3l-6.0,0.0l0.0,1.3L47.1,52.8z" android:fillColor="#FFFFFF"/> <path - android:pathData="M40.726,40.726 h16.13 v16.13 h-16.13z" - android:fillColor="#00000000"/> - <path - android:pathData="M46.657,42.55 h4.72 v1.137 h-4.72z" - android:fillColor="#00000000"/> + android:pathData="M45.1,42.2l0.0,1.299999 1.300003,0.0 0.0,-1.299999 5.299999,0.0 0.0,1.299999 1.399998,0.0 0.0,-1.299999 -1.399998,-1.299999 -5.299999,0.0z" + android:fillColor="#FFFFFF"/> </vector> diff --git a/core/res/res/values-mcc214-mnc03/config.xml b/core/res/res/values-mcc214-mnc03/config.xml deleted file mode 100644 index aa16468..0000000 --- a/core/res/res/values-mcc214-mnc03/config.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** Copyright 2009, 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. -*/ ---> - -<!-- These resources are around just to allow their values to be customized - for different hardware and product builds. Do not translate. --> -<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - - <!-- String containing the apn value for tethering. May be overriden by secure settings - TETHER_DUN_APN. Value is a comma separated series of strings: - "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type", - Or string format of ApnSettingV3. - note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" --> - <string-array translatable="false" name="config_tether_apndata"> - <item>Orange Internet PC,internet,,,orange,orange,,,,,214,03,1,DUN</item> - </string-array> - -</resources> diff --git a/core/res/res/values-mcc234-mnc33/config.xml b/core/res/res/values-mcc234-mnc33/config.xml index 4637519..776b570 100644 --- a/core/res/res/values-mcc234-mnc33/config.xml +++ b/core/res/res/values-mcc234-mnc33/config.xml @@ -29,13 +29,4 @@ <item>23434</item> <item>23486</item> </string-array> - - <!-- String containing the apn value for tethering. May be overriden by secure settings - TETHER_DUN_APN. Value is a comma separated series of strings: - "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type", - Or string format of ApnSettingV3. - note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" --> - <string-array translatable="false" name="config_tether_apndata"> - <item>Consumer Broadband,consumerbroadband,,,,,,,,,234,33,,DUN</item> - </string-array> </resources> diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml index 7a42f3e..ebe0f87 100644 --- a/core/res/res/values-pl/strings.xml +++ b/core/res/res/values-pl/strings.xml @@ -1198,7 +1198,7 @@ <item quantity="other" msgid="2973062968038355991">"za <xliff:g id="COUNT">%d</xliff:g> dni"</item> </plurals> <string name="preposition_for_date" msgid="9093949757757445117">"w dniu <xliff:g id="DATE">%s</xliff:g>"</string> - <string name="preposition_for_time" msgid="5506831244263083793">"o godzinie <xliff:g id="TIME">%s</xliff:g>"</string> + <string name="preposition_for_time" msgid="5506831244263083793">"o godzinie <xliff:g id="TIME">%s</xliff:g>"</string> <string name="preposition_for_year" msgid="5040395640711867177">"w <xliff:g id="YEAR">%s</xliff:g> r."</string> <string name="day" msgid="8144195776058119424">"dzień"</string> <string name="days" msgid="4774547661021344602">"dni"</string> diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml index 2f9cd10..30f27db 100644 --- a/core/res/res/values-ru/strings.xml +++ b/core/res/res/values-ru/strings.xml @@ -1841,7 +1841,7 @@ <string name="lock_to_app_unlock_pin" msgid="2552556656504331634">"Запрашивать PIN-код для отключения блокировки"</string> <string name="lock_to_app_unlock_pattern" msgid="4182192144797225137">"Запрашивать графический ключ для отключения блокировки"</string> <string name="lock_to_app_unlock_password" msgid="6380979775916974414">"Запрашивать пароль для отключения блокировки"</string> - <string name="battery_saver_description" msgid="1960431123816253034">"Чтобы заряд батареи расходовался медленнее, режим энергосбережения уменьшает быстродействие устройства и ограничивает количество ресурсов, затрачиваемых на вибрацию, Геолокацию и большинство процессов обработки данных в фоновом режиме. Приложения, которые используют синхронизацию (например, для электронной почты и обмена SMS), могут не обновляться, пока вы их не откроете.\n\nКогда устройство заряжается, режим энергосбережения отключается автоматически."</string> + <string name="battery_saver_description" msgid="1960431123816253034">"Чтобы продлить время работы устройства от батареи, в режиме энергосбережения снижается производительность, а также ограничивается использование вибрации, геолокации и фоновой передачи данных. Данные, требующие синхронизации, могут обновляться только когда вы откроете приложение.\n\nРежим энергосбережения автоматически отключается во время зарядки устройства."</string> <string name="downtime_condition_summary" msgid="8761776337475705749">"До отключения режима (в <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>)"</string> <string name="downtime_condition_line_one" msgid="8762708714645352010">"До отключения режима"</string> <plurals name="zen_mode_duration_minutes_summary"> diff --git a/core/res/res/values-mcc222-mnc01/config.xml b/core/res/res/values-television/config.xml index 4b1981f..3435474 100644 --- a/core/res/res/values-mcc222-mnc01/config.xml +++ b/core/res/res/values-television/config.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- /* -** Copyright 2009, The Android Open Source Project +** Copyright 2015, 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. @@ -18,15 +18,9 @@ --> <!-- These resources are around just to allow their values to be customized - for different hardware and product builds. Do not translate. --> + for TV products. Do not translate. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <!-- String containing the apn value for tethering. May be overriden by secure settings - TETHER_DUN_APN. Value is a comma separated series of strings: - "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type", - Or string format of ApnSettingV3. - note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" --> - <string-array translatable="false" name="config_tether_apndata"> - <item>TIM WEB,ibox.tim.it,,,,,,,,,222,01,,DUN</item> - </string-array> + <!-- Flags enabling default window features. See Window.java --> + <bool name="config_defaultWindowFeatureOptionsPanel">false</bool> </resources> diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml index 24ec7ce..fd30ce9 100644 --- a/core/res/res/values-zh-rCN/strings.xml +++ b/core/res/res/values-zh-rCN/strings.xml @@ -968,7 +968,7 @@ <string name="lockscreen_pattern_wrong" msgid="4317955014948108794">"重试"</string> <string name="lockscreen_password_wrong" msgid="5737815393253165301">"重试"</string> <string name="faceunlock_multiple_failures" msgid="754137583022792429">"已超过“人脸解锁”尝试次数上限"</string> - <string name="lockscreen_missing_sim_message_short" msgid="5099439277819215399">"没有SIM卡"</string> + <string name="lockscreen_missing_sim_message_short" msgid="5099439277819215399">"没有 SIM 卡"</string> <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"平板电脑中没有SIM卡。"</string> <string name="lockscreen_missing_sim_message" product="tv" msgid="1943633865476989599">"电视中没有 SIM 卡。"</string> <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"手机中无SIM卡"</string> @@ -1460,9 +1460,9 @@ <string name="permdesc_copyProtectedData" msgid="4390697124288317831">"允许应用调用默认的容器服务,以便复制内容。普通应用不应使用此权限。"</string> <string name="permlab_route_media_output" msgid="1642024455750414694">"更改媒体输出线路"</string> <string name="permdesc_route_media_output" msgid="4932818749547244346">"允许该应用将媒体输出线路更改到其他外部设备。"</string> - <string name="permlab_access_keyguard_secure_storage" msgid="7565552237977815047">"访问密钥保护安全存储空间"</string> + <string name="permlab_access_keyguard_secure_storage" msgid="7565552237977815047">"访问锁屏安全存储空间"</string> <string name="permdesc_access_keyguard_secure_storage" msgid="5866245484303285762">"允许应用访问密钥保护安全存储空间。"</string> - <string name="permlab_control_keyguard" msgid="172195184207828387">"控制是显示还是隐藏锁屏"</string> + <string name="permlab_control_keyguard" msgid="172195184207828387">"控制锁屏界面的显示和隐藏状态"</string> <string name="permdesc_control_keyguard" msgid="3043732290518629061">"允许应用控制锁屏。"</string> <string name="permlab_trust_listener" msgid="1765718054003704476">"检测信任状态的变化。"</string> <string name="permdesc_trust_listener" msgid="8233895334214716864">"允许应用检测信任状态的变化。"</string> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index d036140..68df6f1 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -424,6 +424,10 @@ <!-- Integer indicating wpa_supplicant scan interval in milliseconds --> <integer translatable="false" name="config_wifi_supplicant_scan_interval">15000</integer> + <!-- Integer indicating amount of time failed networks areblacklisted for the purpose + of network switching in milliseconds --> + <integer translatable="false" name="config_wifi_network_switching_blacklist_time">172800000</integer> + <!-- Integer indicating wpa_supplicant scan interval when p2p is connected in milliseconds --> <integer translatable="false" name="config_wifi_scan_interval_p2p_connected">60000</integer> @@ -2021,4 +2025,7 @@ <!-- Use ERI text for network name on CDMA LTE --> <bool name="config_LTE_eri_for_network_name">true</bool> + + <!-- Whether to start in touch mode --> + <bool name="config_defaultInTouchMode">true</bool> </resources> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 4a1ed55..1055547 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -327,6 +327,7 @@ <java-symbol type="integer" name="config_wifi_framework_scan_result_rssi_level_patchup_value" /> <java-symbol type="integer" name="config_wifi_framework_current_network_boost" /> <java-symbol type="string" name="config_wifi_random_mac_oui" /> + <java-symbol type="integer" name="config_wifi_network_switching_blacklist_time" /> <java-symbol type="bool" name="editable_voicemailnumber" /> @@ -2155,4 +2156,5 @@ <java-symbol type="bool" name="config_use_sim_language_file" /> <java-symbol type="bool" name="config_LTE_eri_for_network_name" /> + <java-symbol type="bool" name="config_defaultInTouchMode" /> </resources> |