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

Commit 6f2f02e4 authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge commit '93c1d3aa'

* commit '93c1d3aa':
  docs: Refinements for testing
  Fix toast with accessibility and app pinning
  Updated link to material design page.
  Change overdraw test to use windowbackground
  Prevent callbacks during DrawableContainer child initialization
  Fixing crash in SysUI due to invalid group.
  Cherry pick: docs: Edited "Features Reference" section in "<uses-feature>" page.
  Fix Activity Transition mess-up.
  Time to #NameAndroidN!
  Prevent use of a null sCallbackObj by Hardware FLP
  Fixed the relative time spoken with accessibility
  Use backstop timeouts on asynchronous countdown during preflight
parents c22f3e88 93c1d3aa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5952,7 +5952,7 @@ public class Activity extends ContextThemeWrapper
     * @return true if this is the topmost, non-finishing activity in its task.
     */
    private boolean isTopOfTask() {
        if (mToken == null || mWindow == null || !mWindowAdded) {
        if (mToken == null || mWindow == null) {
            return false;
        }
        try {
+58 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.icu.util.Calendar;
import android.os.Handler;
import android.text.format.Time;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.RemoteViews.RemoteView;

import com.android.internal.R;
@@ -118,7 +119,6 @@ public class DateTimeView extends TextView {
    public void setTime(long time) {
        Time t = new Time();
        t.set(time);
        t.second = 0;
        mTimeMillis = t.toMillis(false);
        mTime = new Date(t.year-1900, t.month, t.monthDay, t.hour, t.minute, 0);
        update();
@@ -333,6 +333,63 @@ public class DateTimeView extends TextView {
        update();
    }

    @Override
    public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
        super.onInitializeAccessibilityNodeInfoInternal(info);
        if (mShowRelativeTime) {
            // The short version of the time might not be completely understandable and for
            // accessibility we rather have a longer version.
            long now = System.currentTimeMillis();
            long duration = Math.abs(now - mTimeMillis);
            int count;
            boolean past = (now >= mTimeMillis);
            String result;
            if (duration < MINUTE_IN_MILLIS) {
                result = mNowText;
            } else if (duration < HOUR_IN_MILLIS) {
                count = (int)(duration / MINUTE_IN_MILLIS);
                result = String.format(getContext().getResources().getQuantityString(past
                                ? com.android.internal.
                                        R.plurals.duration_minutes_relative
                                : com.android.internal.
                                        R.plurals.duration_minutes_relative_future,
                        count),
                        count);
            } else if (duration < DAY_IN_MILLIS) {
                count = (int)(duration / HOUR_IN_MILLIS);
                result = String.format(getContext().getResources().getQuantityString(past
                                ? com.android.internal.
                                        R.plurals.duration_hours_relative
                                : com.android.internal.
                                        R.plurals.duration_hours_relative_future,
                        count),
                        count);
            } else if (duration < YEAR_IN_MILLIS) {
                // In weird cases it can become 0 because of daylight savings
                TimeZone timeZone = TimeZone.getDefault();
                count = Math.max(Math.abs(dayDistance(timeZone, mTimeMillis, now)), 1);
                result = String.format(getContext().getResources().getQuantityString(past
                                ? com.android.internal.
                                        R.plurals.duration_days_relative
                                : com.android.internal.
                                        R.plurals.duration_days_relative_future,
                        count),
                        count);

            } else {
                count = (int)(duration / YEAR_IN_MILLIS);
                result = String.format(getContext().getResources().getQuantityString(past
                                ? com.android.internal.
                                        R.plurals.duration_years_relative
                                : com.android.internal.
                                        R.plurals.duration_years_relative_future,
                        count),
                        count);
            }
            info.setText(result);
        }
    }

    private static class ReceiverInfo {
        private final ArrayList<DateTimeView> mAttachedViews = new ArrayList<DateTimeView>();
        private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
+15 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ import android.widget.FrameLayout;
import android.widget.ImageView;

public class PlatLogoActivity extends Activity {
    public static final boolean REVEAL_THE_NAME = true;

    FrameLayout mLayout;
    int mTapCount;
    int mKeyCount;
@@ -100,6 +102,19 @@ public class PlatLogoActivity extends Activity {
                    public boolean onLongClick(View v) {
                        if (mTapCount < 5) return false;

                        if (REVEAL_THE_NAME) {
                            final Drawable overlay = getDrawable(
                                com.android.internal.R.drawable.platlogo_m);
                            overlay.setBounds(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
                            im.getOverlay().clear();
                            im.getOverlay().add(overlay);
                            overlay.setAlpha(0);
                            ObjectAnimator.ofInt(overlay, "alpha", 0, 255)
                                .setDuration(500)
                                .start();
                            return true;
                        }

                        final ContentResolver cr = getContentResolver();
                        if (Settings.System.getLong(cr, Settings.System.EGG_MODE, 0)
                                == 0) {
+47 −12
Original line number Diff line number Diff line
<!--
Copyright (C) 2015 The Android Open Source Project
Copyright (C) 2016 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.
@@ -19,19 +19,54 @@ Copyright (C) 2015 The Android Open Source Project
        android:viewportWidth="48.0"
        android:viewportHeight="48.0">
    <path
        android:fillColor="#08000000"
        android:pathData="M13.5,34.5l13.3,13.3c11,-1.3,19.7,-10,21,-21L34.5,13.5L13.5,34.5z"
        />
        android:fillColor="#FFFFFFFF"
        android:pathData="M33.8,38l-25.5,-25.5l-1.7000003,0.6999998l25.499998,25.5z"/>
    <path
        android:pathData="M24,24c0,0,0,2.4,0,5.2s0,5.2,0,5.2L34.5,24V13.5L24,24z"
        android:fillColor="#FFFFFF"/>
        android:fillColor="#FFFFFFFF"
        android:pathData="M40.8,34.8l-25.4,-25.5l-1.6999998,0.6999998l25.5,25.5z"/>
    <path
        android:pathData="M24,24L13.5,13.5V24L24,34.5c0,0,0,-2.4,0,-5.2S24,24,24,24z"
        android:fillColor="#EEEEEE"/>
        android:fillColor="#FFFFFFFF"
        android:pathData="M11.1,13.1l-0.3,-0.4l1.1,-1.3l0,0l-1.6,0.8l-0.4,-0.4l2.6,-1.2l0.4,0.4l-1.1,1.3l0,0l1.6,-0.8l0.3,0.4L11.1,13.1z"/>
    <path
        android:pathData="M13.5,34.5l10.5,0.0l-10.5,-10.5z"
        android:fillColor="#DDDDDD"/>
        android:fillColor="#FFFFFFFF"
        android:pathData="M13,14.2l-0.5,-0.5l-0.6,0.2l-0.4,-0.4l3.1,-0.7l0.4,0.4l-2.1,1.7l-0.4,-0.4L13,14.2z M13,13.6l0.3,0.3l0.8,-0.6   l0,0L13,13.6z"/>
    <path
        android:pathData="M34.5,34.5l0.0,-10.5l-10.5,10.5z"
        android:fillColor="#DDDDDD"/>
        android:fillColor="#FFFFFFFF"
        android:pathData="M16.3,14.6l-1.6,1.2l0,0l2.2,-0.6l0.5,0.5l-2.6,1.2l-0.3,-0.4l0.7,-0.3l1,-0.4l0,0l-2.1,0.5L13.9,16l1.4,-1.1l0,0   l-0.9,0.5l-0.7,0.3l-0.3,-0.4l2.6,-1.2L16.3,14.6z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M17.4,17.8l-0.6,-0.6l-0.7,0.3l0.7,0.7l-0.4,0.2l-1,-1l2.6,-1.2l1,1l-0.4,0.2l-0.7,-0.7L17.2,17l0.6,0.6L17.4,17.8   z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M18.8,18.7L18.8,18.7l1.3,-0.2l0.4,0.4l-2.1,0.3l-0.9,0.4l-0.3,-0.4l1,-0.4l1.2,-1.2l0.4,0.4L18.8,18.7z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M22.2,20.5l-1.6,1.2l0,0l2.2,-0.6l0.5,0.5l-2.6,1.2l-0.3,-0.4l0.7,-0.3l1,-0.4l0,0L20,22.1l-0.2,-0.2l1.4,-1.1l0,0   l-0.9,0.5l-0.7,0.3l-0.3,-0.4l2.6,-1.2L22.2,20.5z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M22,23.6c0,0,0.1,0.1,0.2,0.1c0.1,0,0.2,0,0.3,-0.1l0.3,0.3c-0.2,0.1,-0.4,0.1,-0.6,0.1c-0.2,0,-0.4,-0.1,-0.5,-0.2   c-0.2,-0.2,-0.2,-0.3,-0.1,-0.5c0.1,-0.2,0.2,-0.3,0.5,-0.4l0.2,-0.1c0.3,-0.1,0.5,-0.2,0.8,-0.2c0.2,0,0.5,0.1,0.6,0.3   c0.1,0.1,0.2,0.3,0.1,0.4c0,0.1,-0.2,0.3,-0.4,0.4L23,23.4c0.1,0,0.2,-0.1,0.2,-0.2c0,-0.1,0,-0.1,0,-0.2C23.1,23,23,22.9,22.9,23   c-0.1,0,-0.2,0.1,-0.4,0.1l-0.2,0.1c-0.2,0.1,-0.3,0.1,-0.3,0.2C21.9,23.5,21.9,23.5,22,23.6z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M23.8,25.9l-0.3,-0.4l1.1,-1.3l0,0L22.9,25l-0.4,-0.4l2.6,-1.2l0.4,0.4l-1.1,1.3l0,0l1.6,-0.8l0.3,0.4L23.8,25.9z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M25.7,27l-0.5,-0.5l-0.6,0.2l-0.4,-0.4l3.1,-0.7l0.4,0.4l-2.1,1.7l-0.4,-0.4L25.7,27z M25.7,26.4l0.3,0.3l0.8,-0.6   l0,0L25.7,26.4z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M29,27.4l-1.6,1.2l0,0l2.2,-0.6l0.5,0.5l-2.6,1.2l-0.3,-0.4l0.8,-0.3l1,-0.4l0,0L26.8,29l-0.2,-0.2l1.4,-1.1l0,0   L27,28.1l-0.8,0.3l-0.3,-0.4l2.6,-1.2L29,27.4z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M30,30.6L29.5,30l-0.7,0.3l0.7,0.7L29,31.2l-1,-1l2.6,-1.2l1,1l-0.4,0.2l-0.7,-0.7l-0.6,0.3l0.6,0.6L30,30.6z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M31.5,32.1l-0.6,-0.6L29.8,32l-0.4,-0.4l2.6,-1.2l1,1l-0.4,0.2L32,31l-0.7,0.3l0.6,0.6L31.5,32.1z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M32,33.5L31.6,33L31,33.2l-0.4,-0.4l3.1,-0.7l0.4,0.4l-2.1,1.7l-0.4,-0.4L32,33.5z M32.1,32.9l0.3,0.3l0.8,-0.6   l0,0L32.1,32.9z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M34.3,35.3c-0.3,0.1,-0.5,0.2,-0.8,0.1c-0.2,0,-0.5,-0.1,-0.6,-0.3c-0.2,-0.2,-0.2,-0.4,-0.2,-0.5   c0.1,-0.2,0.2,-0.3,0.6,-0.5l0.8,-0.4c0.3,-0.1,0.6,-0.2,0.9,-0.2c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.2,0.5c0,0.2,-0.2,0.3,-0.5,0.5   l-0.3,-0.4c0.2,-0.1,0.3,-0.1,0.3,-0.2c0,-0.1,0,-0.1,-0.1,-0.2C35,34,34.9,34,34.8,34c-0.1,0,-0.3,0,-0.5,0.1l-0.8,0.4   c-0.2,0.1,-0.3,0.2,-0.4,0.2c0,0.1,0,0.1,0,0.2c0.1,0.1,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.4,-0.1L34.3,35.3z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M36,36.6L35.4,36l-0.7,0.3l0.7,0.7l-0.4,0.2l-1,-1l2.6,-1.2l1,1l-0.4,0.2l-0.7,-0.7l-0.6,0.3l0.6,0.6L36,36.6z"/>
</vector>
+48 −2
Original line number Diff line number Diff line
@@ -2474,6 +2474,54 @@
        <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g>y</item>
    </plurals>

    <!-- Phrase describing a relative time using minutes in the past that is not shown on the screen but used for accessibility. [CHAR LIMIT=NONE] -->
    <plurals name="duration_minutes_relative">
        <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g> minute ago</item>
        <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g> minutes ago</item>
    </plurals>

    <!-- Phrase describing a relative time using hours in the past that is not shown on the screen but used for accessibility. [CHAR LIMIT=NONE] -->
    <plurals name="duration_hours_relative">
        <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g> hour ago</item>
        <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g> hours ago</item>
    </plurals>

    <!-- Phrase describing a relative time using days in the past that is not shown on the screen but used for accessibility. [CHAR LIMIT=NONE] -->
    <plurals name="duration_days_relative">
        <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g> day ago</item>
        <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g> days ago</item>
    </plurals>

    <!-- Phrase describing a relative time using years in the past that is not shown on the screen but used for accessibility. [CHAR LIMIT=NONE] -->
    <plurals name="duration_years_relative">
        <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g> year ago</item>
        <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g> years ago</item>
    </plurals>

    <!-- Phrase describing a relative time using minutes that is not shown on the screen but used for accessibility. This version should be a future point in time. [CHAR LIMIT=NONE] -->
    <plurals name="duration_minutes_relative_future">
        <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g> minute</item>
        <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g> minutes</item>
    </plurals>

    <!-- Phrase describing a relative time using hours that is not shown on the screen but used for accessibility. This version should be a future point in time. [CHAR LIMIT=NONE] -->
    <plurals name="duration_hours_relative_future">
        <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g> hour</item>
        <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g> hours</item>
    </plurals>

    <!-- Phrase describing a relative time using days that is not shown on the screen but used for accessibility. This version should be a future point in time. [CHAR LIMIT=NONE] -->
    <plurals name="duration_days_relative_future">
        <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g> day</item>
        <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g> days</item>
    </plurals>

    <!-- Phrase describing a relative time using years that is not shown on the screen but used for accessibility. This version should be a future point in time. [CHAR LIMIT=NONE] -->
    <plurals name="duration_years_relative_future">
        <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g> year</item>
        <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g> years</item>
    </plurals>

    <!-- Title for error alert when a video cannot be played.  it can be used by any app. -->
    <string name="VideoView_error_title">Video problem</string>
    <!-- Text for error alert when a video container is not valid for progressive download/playback. -->
@@ -4081,8 +4129,6 @@

    <!-- Notify use that they are in Lock-to-app -->
    <string name="lock_to_app_toast">To unpin this screen, touch &amp; hold Back.</string>
    <!-- Notify use that they are in Lock-to-app in accessibility mode -->
    <string name="lock_to_app_toast_accessible">To unpin this screen, touch &amp; hold Overview.</string>
    <!-- Notify user that they are locked in lock-to-app mode -->
    <string name="lock_to_app_toast_locked">App is pinned: Unpinning isn\'t allowed on this device.</string>
    <!-- Starting lock-to-app indication. -->
Loading