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

Commit 3f5dc534 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5785232 from f7ad427d to qt-c2f2-release

Change-Id: I88f937d814a83405d96340bb1e41d666ac655048
parents 94f8e738 f7ad427d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1547,7 +1547,9 @@ public class Activity extends ContextThemeWrapper
     * had previously been frozen by {@link #onSaveInstanceState}.
     *
     * <p>This method is called between {@link #onStart} and
     * {@link #onPostCreate}.
     * {@link #onPostCreate}. This method is called only when recreating
     * an activity; the method isn't invoked if {@link #onStart} is called for
     * any other reason.</p>
     *
     * @param savedInstanceState the data most recently supplied in {@link #onSaveInstanceState}.
     *
+49 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RemoteViews;

import java.util.ArrayList;

/**
 * A TextView that can float around an image on the end.
 *
@@ -42,6 +44,7 @@ public class MediaNotificationView extends FrameLayout {
    private View mMainColumn;
    private View mMediaContent;
    private int mImagePushIn;
    private ArrayList<VisibilityChangeListener> mListeners;

    public MediaNotificationView(Context context) {
        this(context, null);
@@ -168,4 +171,50 @@ public class MediaNotificationView extends FrameLayout {
        mMainColumn = findViewById(com.android.internal.R.id.notification_main_column);
        mMediaContent = findViewById(com.android.internal.R.id.notification_media_content);
    }

    @Override
    public void onVisibilityAggregated(boolean isVisible) {
        super.onVisibilityAggregated(isVisible);
        if (mListeners != null) {
            for (int i = 0; i < mListeners.size(); i++) {
                mListeners.get(i).onAggregatedVisibilityChanged(isVisible);
            }
        }
    }

    /**
     * Add a listener to receive updates on the visibility of this view
     *
     * @param listener The listener to add.
     */
    public void addVisibilityListener(VisibilityChangeListener listener) {
        if (mListeners == null) {
            mListeners = new ArrayList<>();
        }
        if (!mListeners.contains(listener)) {
            mListeners.add(listener);
        }
    }

    /**
     * Remove the specified listener
     *
     * @param listener The listener to remove.
     */
    public void removeVisibilityListener(VisibilityChangeListener listener) {
        if (mListeners != null) {
            mListeners.remove(listener);
        }
    }

    /**
     * Interface for receiving updates when the view's visibility changes
     */
    public interface VisibilityChangeListener {
        /**
         * Method called when the visibility of this view has changed
         * @param isVisible true if the view is now visible
         */
        void onAggregatedVisibilityChanged(boolean isVisible);
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -299,8 +299,8 @@
    <string name="permgroupdesc_microphone" msgid="4988812113943554584">"音声の録音"</string>
    <string name="permgrouprequest_microphone" msgid="9167492350681916038">"音声の録音を「&lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;」に許可しますか?"</string>
    <string name="permgrouplab_activityRecognition" msgid="1565108047054378642">"身体活動"</string>
    <string name="permgroupdesc_activityRecognition" msgid="6949472038320473478">"運動データにアクセス"</string>
    <string name="permgrouprequest_activityRecognition" msgid="7626438016904799383">"運動データへのアクセスを「&lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;」に許可しますか?"</string>
    <string name="permgroupdesc_activityRecognition" msgid="6949472038320473478">"身体活動にアクセス"</string>
    <string name="permgrouprequest_activityRecognition" msgid="7626438016904799383">"身体活動へのアクセスを「&lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;」に許可しますか?"</string>
    <string name="permgrouplab_camera" msgid="4820372495894586615">"カメラ"</string>
    <string name="permgroupdesc_camera" msgid="3250611594678347720">"写真と動画の撮影"</string>
    <string name="permgrouprequest_camera" msgid="1299833592069671756">"写真と動画の撮影を「&lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;」に許可しますか?"</string>
@@ -429,8 +429,8 @@
    <string name="permdesc_recordAudio" msgid="4245930455135321433">"このアプリは、いつでもマイクを使用して録音できます。"</string>
    <string name="permlab_sim_communication" msgid="2935852302216852065">"SIMへのコマンド送信"</string>
    <string name="permdesc_sim_communication" msgid="5725159654279639498">"SIMにコマンドを送信することをアプリに許可します。この許可は非常に危険です。"</string>
    <string name="permlab_activityRecognition" msgid="3634590230567608356">"動の認識"</string>
    <string name="permdesc_activityRecognition" msgid="3143453925156552894">"このアプリで動が認識されるようにします。"</string>
    <string name="permlab_activityRecognition" msgid="3634590230567608356">"身体活動の認識"</string>
    <string name="permdesc_activityRecognition" msgid="3143453925156552894">"このアプリで身体活動が認識されるようにします。"</string>
    <string name="permlab_camera" msgid="3616391919559751192">"写真と動画の撮影"</string>
    <string name="permdesc_camera" msgid="5392231870049240670">"このアプリは、いつでもカメラを使用して写真や動画を撮影できます。"</string>
    <string name="permlab_vibrate" msgid="7696427026057705834">"バイブレーションの制御"</string>
+20 −5
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ public class PowerUI extends SystemUI {
    private static final int CHARGE_CYCLE_PERCENT_RESET = 45;
    private static final long SIX_HOURS_MILLIS = Duration.ofHours(6).toMillis();
    public static final int NO_ESTIMATE_AVAILABLE = -1;
    private static final String BOOT_COUNT_KEY = "boot_count";
    private static final String PREFS = "powerui_prefs";

    private final Handler mHandler = new Handler();
    @VisibleForTesting
@@ -118,7 +120,7 @@ public class PowerUI extends SystemUI {

        // Check to see if we need to let the user know that the phone previously shut down due
        // to the temperature being too high.
        showThermalShutdownDialog();
        showWarnOnThermalShutdown();

        // Register an observer to configure mEnableSkinTemperatureWarning and perform the
        // registration of skin thermal event listener upon Settings change.
@@ -542,12 +544,25 @@ public class PowerUI extends SystemUI {
        }
    }

    private void showThermalShutdownDialog() {
    private void showWarnOnThermalShutdown() {
        int bootCount = -1;
        int lastReboot = mContext.getSharedPreferences(PREFS, 0).getInt(BOOT_COUNT_KEY, -1);
        try {
            bootCount = Settings.Global.getInt(mContext.getContentResolver(),
                    Settings.Global.BOOT_COUNT);
        } catch (Settings.SettingNotFoundException e) {
            Slog.e(TAG, "Failed to read system boot count from Settings.Global.BOOT_COUNT");
        }
        // Only show the thermal shutdown warning when there is a thermal reboot.
        if (bootCount > lastReboot) {
            mContext.getSharedPreferences(PREFS, 0).edit().putInt(BOOT_COUNT_KEY,
                    bootCount).apply();
            if (mPowerManager.getLastShutdownReason()
                    == PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN) {
                mWarnings.showThermalShutdownWarning();
            }
        }
    }

    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.print("mLowBatteryAlertCloseLevel=");
+3 −1
Original line number Diff line number Diff line
@@ -1367,7 +1367,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        if (isChildInGroup()) {
            mTranslationWhenRemoved += getNotificationParent().getTranslationY();
        }
        mPrivateLayout.setRemoved();
        for (NotificationContentView l : mLayouts) {
            l.setRemoved();
        }
    }

    public boolean wasChildInGroupWhenRemoved() {
Loading