Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57b2b936 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7761456 from 6e60223a to sc-qpr1-release

Change-Id: Id0efe1d94af074da448186876438b8081e6d0910
parents e9201876 6e60223a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class CameraExtensionJpegProcessor implements ICaptureProcessorImpl {

    private static final class JpegParameters {
        public HashSet<Long> mTimeStamps = new HashSet<>();
        public int mRotation = JPEG_DEFAULT_ROTATION; // CCW multiple of 90 degrees
        public int mRotation = JPEG_DEFAULT_ROTATION; // CW multiple of 90 degrees
        public int mQuality = JPEG_DEFAULT_QUALITY; // [0..100]
    }

@@ -100,7 +100,8 @@ public class CameraExtensionJpegProcessor implements ICaptureProcessorImpl {
            Integer orientation = captureBundles.get(0).captureResult.get(
                    CaptureResult.JPEG_ORIENTATION);
            if (orientation != null) {
                ret.mRotation = orientation / 90;
                // The jpeg encoder expects CCW rotation, convert from CW
                ret.mRotation = (360 - (orientation % 360)) / 90;
            } else {
                Log.w(TAG, "No jpeg rotation set, using default: " + JPEG_DEFAULT_ROTATION);
            }
+7 −0
Original line number Diff line number Diff line
@@ -62,6 +62,13 @@ public class TranslationTransformationMethod implements TransformationMethod2 {
        return mOriginalTranslationMethod;
    }

    /**
     * Returns the {@link TextView}'s {@link ViewTranslationResponse}.
     */
    public ViewTranslationResponse getViewTranslationResponse() {
        return mTranslationResponse;
    }

    @Override
    public CharSequence getTransformation(CharSequence source, View view) {
        if (!mAllowLengthChanges) {
+2 −4
Original line number Diff line number Diff line
@@ -598,9 +598,8 @@ public class UiTranslationController {
            final View rootView = roots.get(rootNum).getView();
            if (rootView instanceof ViewGroup) {
                findViewsTraversalByAutofillIds((ViewGroup) rootView, sourceViewIds);
            } else {
                addViewIfNeeded(sourceViewIds, rootView);
            }
            addViewIfNeeded(sourceViewIds, rootView);
        }
    }

@@ -611,9 +610,8 @@ public class UiTranslationController {
            final View child = viewGroup.getChildAt(i);
            if (child instanceof ViewGroup) {
                findViewsTraversalByAutofillIds((ViewGroup) child, sourceViewIds);
            } else {
                addViewIfNeeded(sourceViewIds, child);
            }
            addViewIfNeeded(sourceViewIds, child);
        }
    }

+5 −0
Original line number Diff line number Diff line
@@ -41,6 +41,11 @@ public interface ViewTranslationCallback {
     * method will not be called before {@link View#onViewTranslationResponse} or
     * {@link View#onVirtualViewTranslationResponses}.
     *
     * <p> NOTE: It is possible the user changes text that causes a new
     * {@link ViewTranslationResponse} returns to show the new translation. If you cache the
     * {@link ViewTranslationResponse} here, you should remember to keep the cached value up
     * to date.
     *
     * <p> NOTE: For TextView implementation, {@link ContentCaptureSession#notifyViewTextChanged}
     * shouldn't be called with the translated text, simply calling setText() here will trigger the
     * method. You should either override {@code View#onProvideContentCaptureStructure()} to report
+6 −1
Original line number Diff line number Diff line
@@ -70,7 +70,12 @@ public class TextViewTranslationCallback implements ViewTranslationCallback {
                    + "onViewTranslationResponse().");
            return false;
        }
        if (mTranslationTransformation == null) {
        // It is possible user changes text and new translation response returns, system should
        // update the translation response to keep the result up to date.
        // Because TextView.setTransformationMethod() will skip the same TransformationMethod
        // instance, we should create a new one to let new translation can work.
        if (mTranslationTransformation == null
                || !response.equals(mTranslationTransformation.getViewTranslationResponse())) {
            TransformationMethod originalTranslationMethod =
                    ((TextView) view).getTransformationMethod();
            mTranslationTransformation = new TranslationTransformationMethod(response,
Loading