diff options
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/hardware/camera2/params/StreamConfigurationMap.java | 21 | ||||
-rw-r--r-- | core/java/android/os/Build.java | 11 | ||||
-rw-r--r-- | core/java/android/widget/Editor.java | 2 | ||||
-rw-r--r-- | core/java/com/android/internal/policy/PhoneWindow.java | 32 | ||||
-rw-r--r-- | core/java/com/android/internal/view/FloatingActionMode.java | 12 |
5 files changed, 60 insertions, 18 deletions
diff --git a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java index 8e0eab2..e71e49f 100644 --- a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java +++ b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java @@ -98,9 +98,19 @@ public final class StreamConfigurationMap { HighSpeedVideoConfiguration[] highSpeedVideoConfigurations, ReprocessFormatsMap inputOutputFormatsMap, boolean listHighResolution) { - mConfigurations = checkArrayElementsNotNull(configurations, "configurations"); - mMinFrameDurations = checkArrayElementsNotNull(minFrameDurations, "minFrameDurations"); - mStallDurations = checkArrayElementsNotNull(stallDurations, "stallDurations"); + + if (configurations == null) { + // If no color configurations exist, ensure depth ones do + checkArrayElementsNotNull(depthConfigurations, "depthConfigurations"); + mConfigurations = new StreamConfiguration[0]; + mMinFrameDurations = new StreamConfigurationDuration[0]; + mStallDurations = new StreamConfigurationDuration[0]; + } else { + mConfigurations = checkArrayElementsNotNull(configurations, "configurations"); + mMinFrameDurations = checkArrayElementsNotNull(minFrameDurations, "minFrameDurations"); + mStallDurations = checkArrayElementsNotNull(stallDurations, "stallDurations"); + } + mListHighResolution = listHighResolution; if (depthConfigurations == null) { @@ -124,7 +134,7 @@ public final class StreamConfigurationMap { } // For each format, track how many sizes there are available to configure - for (StreamConfiguration config : configurations) { + for (StreamConfiguration config : mConfigurations) { int fmt = config.getFormat(); SparseIntArray map = null; if (config.isOutput()) { @@ -159,7 +169,8 @@ public final class StreamConfigurationMap { mDepthOutputFormats.get(config.getFormat()) + 1); } - if (mOutputFormats.indexOfKey(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) < 0) { + if (configurations != null && + mOutputFormats.indexOfKey(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) < 0) { throw new AssertionError( "At least one stream configuration for IMPLEMENTATION_DEFINED must exist"); } diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index a0162f7..2374899 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -157,6 +157,17 @@ public class Build { public static final String RELEASE = getString("ro.build.version.release"); /** + * The base OS build the product is based on. + */ + public static final String BASE_OS = SystemProperties.get("ro.build.version.base_os", ""); + + /** + * The user-visible security patch level. + */ + public static final String SECURITY_PATCH = SystemProperties.get( + "ro.build.version.security_patch", ""); + + /** * The user-visible SDK version of the framework in its raw String * representation; use {@link #SDK_INT} instead. * diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 010cb27..5b042c6 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -3308,7 +3308,7 @@ public class Editor { mSelectionBounds.set( primaryHorizontal, layout.getLineTop(line), - primaryHorizontal + 1, + primaryHorizontal, layout.getLineTop(line + 1) + mHandleHeight); } // Take TextView's padding and scroll into account. diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java index dd7ea45..a7bdbe0 100644 --- a/core/java/com/android/internal/policy/PhoneWindow.java +++ b/core/java/com/android/internal/policy/PhoneWindow.java @@ -2907,13 +2907,18 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mLastHasRightStableInset = hasRightStableInset; } - updateColorViewInt(mStatusColorViewState, sysUiVisibility, mStatusBarColor, - mLastTopInset, false /* matchVertical */, animate && !disallowAnimate); - boolean navBarToRightEdge = mLastBottomInset == 0 && mLastRightInset > 0; int navBarSize = navBarToRightEdge ? mLastRightInset : mLastBottomInset; updateColorViewInt(mNavigationColorViewState, sysUiVisibility, mNavigationBarColor, - navBarSize, navBarToRightEdge, animate && !disallowAnimate); + navBarSize, navBarToRightEdge, 0 /* rightInset */, + animate && !disallowAnimate); + + boolean statusBarNeedsRightInset = navBarToRightEdge + && mNavigationColorViewState.present; + int statusBarRightInset = statusBarNeedsRightInset ? mLastRightInset : 0; + updateColorViewInt(mStatusColorViewState, sysUiVisibility, mStatusBarColor, + mLastTopInset, false /* matchVertical */, statusBarRightInset, + animate && !disallowAnimate); } // When we expand the window with FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, we still need @@ -2966,15 +2971,17 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { * @param size the current size in the non-parent-matching dimension. * @param verticalBar if true the view is attached to a vertical edge, otherwise to a * horizontal edge, + * @param rightMargin rightMargin for the color view. * @param animate if true, the change will be animated. */ private void updateColorViewInt(final ColorViewState state, int sysUiVis, int color, - int size, boolean verticalBar, boolean animate) { - boolean show = size > 0 && (sysUiVis & state.systemUiHideFlag) == 0 + int size, boolean verticalBar, int rightMargin, boolean animate) { + state.present = size > 0 && (sysUiVis & state.systemUiHideFlag) == 0 && (getAttributes().flags & state.hideWindowFlag) == 0 - && (getAttributes().flags & state.translucentFlag) == 0 - && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0; + boolean show = state.present + && (color & Color.BLACK) != 0 + && (getAttributes().flags & state.translucentFlag) == 0; boolean visibilityChanged = false; View view = state.view; @@ -2993,7 +3000,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { view.setVisibility(INVISIBLE); state.targetVisibility = VISIBLE; - addView(view, new LayoutParams(resolvedWidth, resolvedHeight, resolvedGravity)); + LayoutParams lp = new LayoutParams(resolvedWidth, resolvedHeight, + resolvedGravity); + lp.rightMargin = rightMargin; + addView(view, lp); updateColorViewTranslations(); } } else { @@ -3003,10 +3013,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (show) { LayoutParams lp = (LayoutParams) view.getLayoutParams(); if (lp.height != resolvedHeight || lp.width != resolvedWidth - || lp.gravity != resolvedGravity) { + || lp.gravity != resolvedGravity || lp.rightMargin != rightMargin) { lp.height = resolvedHeight; lp.width = resolvedWidth; lp.gravity = resolvedGravity; + lp.rightMargin = rightMargin; view.setLayoutParams(lp); } view.setBackgroundColor(color); @@ -5022,6 +5033,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private static class ColorViewState { View view = null; int targetVisibility = View.INVISIBLE; + boolean present = false; final int id; final int systemUiHideFlag; diff --git a/core/java/com/android/internal/view/FloatingActionMode.java b/core/java/com/android/internal/view/FloatingActionMode.java index 41628d0..9761661 100644 --- a/core/java/com/android/internal/view/FloatingActionMode.java +++ b/core/java/com/android/internal/view/FloatingActionMode.java @@ -194,8 +194,16 @@ public class FloatingActionMode extends ActionMode { mContext.getResources().getDisplayMetrics().widthPixels, mContext.getResources().getDisplayMetrics().heightPixels); - return Rect.intersects(mContentRectOnScreen, mScreenRect) - && Rect.intersects(mContentRectOnScreen, mViewRectOnScreen); + return intersectsClosed(mContentRectOnScreen, mScreenRect) + && intersectsClosed(mContentRectOnScreen, mViewRectOnScreen); + } + + /* + * Same as Rect.intersects, but includes cases where the rectangles touch. + */ + private static boolean intersectsClosed(Rect a, Rect b) { + return a.left <= b.right && b.left <= a.right + && a.top <= b.bottom && b.top <= a.bottom; } @Override |