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

Commit 056d2201 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Showing notification when activity is in PiP."

parents 3b1ed1cb c81c0ce2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -25,7 +25,10 @@ oneway interface ITaskStackListener {
    void onTaskStackChanged();

    /** Called whenever an Activity is moved to the pinned stack from another stack. */
    void onActivityPinned();
    void onActivityPinned(String packageName);

    /** Called whenever an Activity is moved from the pinned stack to another stack. */
    void onActivityUnpinned();

    /**
     * Called whenever IActivityManager.startActivity is called on an activity that is already
+5 −1
Original line number Diff line number Diff line
@@ -31,7 +31,11 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub {
    }

    @Override
    public void onActivityPinned() throws RemoteException {
    public void onActivityPinned(String packageName) throws RemoteException {
    }

    @Override
    public void onActivityUnpinned() throws RemoteException {
    }

    @Override
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
    <path
        android:fillColor="#FF000000"
        android:pathData="M11.99,18.54l-7.37,-5.73L3,14.07l9,7 9,-7 -1.63,-1.27 -7.38,5.74zM12,16l7.36,-5.73L21,9l-9,-7 -9,7 1.63,1.27L12,16z"/>
</vector>
 No newline at end of file
+12 −3
Original line number Diff line number Diff line
@@ -1765,6 +1765,18 @@
    <!-- Label for PIP the drag to close zone [CHAR LIMIT=NONE]-->
    <string name="pip_phone_close">Close</string>

    <!-- Title of menu shown over picture-in-picture. Used for accessibility. -->
    <string name="pip_menu_title">Picture in picture menu</string>

    <!-- User visible notification channel name for the PiP BTW notification. [CHAR LIMIT=NONE] -->
    <string name="pip_notification_channel_name">Picture-in-picture</string>

    <!-- PiP BTW notification title. [CHAR LIMIT=50] -->
    <string name="pip_notification_title"><xliff:g id="name" example="Google Maps">%s</xliff:g> is in picture-in-picture</string>

    <!-- PiP BTW notification description. [CHAR LIMIT=NONE] -->
    <string name="pip_notification_message">If you don’t want <xliff:g id="name" example="Google Maps">%s</xliff:g> to use this feature, tap to open settings and turn it off.</string>

    <!-- Tuner string -->
    <string name="change_theme_reboot" translatable="false">Changing the theme requires a restart.</string>
    <!-- Tuner string -->
@@ -1833,9 +1845,6 @@
    <!-- App label of the instant apps notification [CHAR LIMIT=60] -->
    <string name="instant_apps">Instant Apps</string>

    <!-- Title of menu shown over picture-in-picture. Used for accessibility. -->
    <string name="pip_menu_title">Picture in picture menu</string>

    <!-- Message of the instant apps notification indicating they don't need install [CHAR LIMIT=NONE] -->
    <string name="instant_apps_message">Instant apps don\'t require installation.</string>

+14 −1
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ public class PipManager implements BasePipManager {
    private InputConsumerController mInputConsumerController;
    private PipMenuActivityController mMenuController;
    private PipMediaController mMediaController;
    private PipNotificationController mNotificationController;
    private PipTouchHandler mTouchHandler;

    /**
@@ -63,13 +64,24 @@ public class PipManager implements BasePipManager {
     */
    TaskStackListener mTaskStackListener = new TaskStackListener() {
        @Override
        public void onActivityPinned() {
        public void onActivityPinned(String packageName) {
            if (!checkCurrentUserId(false /* debug */)) {
                return;
            }

            mTouchHandler.onActivityPinned();
            mMediaController.onActivityPinned();
            mMenuController.onActivityPinned();
            mNotificationController.onActivityPinned(packageName);
        }

        @Override
        public void onActivityUnpinned() {
            if (!checkCurrentUserId(false /* debug */)) {
                return;
            }

            mNotificationController.onActivityUnpinned();
        }

        @Override
@@ -160,6 +172,7 @@ public class PipManager implements BasePipManager {
                mInputConsumerController);
        mTouchHandler = new PipTouchHandler(context, mActivityManager, mMenuController,
                mInputConsumerController);
        mNotificationController = new PipNotificationController(context, mActivityManager);
    }

    /**
Loading