open TV’s expanded PiP in android 13 mobile or tablet
android 13 for TV推出了expanded PiP功能,但是只在android 13的电视上作用,在手机或者平板上,即使开了android.software.expanded_picture_in_picture feature也无法使用expanded pip。 经研究可通过修改framwork代码,将TV的expanded pip feature移植到手机或平板,在手机和平板上开启expanded pip功能,以下以手机为例。 开启android.software.expanded_picture_in_picture feature 修改frameworks/native/data/etc/handheld_core_hardware.xml文件,追加以下配置: <feature name="android.software.expanded_picture_in_picture" notLowRam="true" /> 2. 移植TV 代码 修改 framework/base/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java /* * Copyright (C) 2021 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. */ package com.android.wm.shell.dagger; import android.content.Context; import android.content.pm.LauncherApps; import android.os.Handler; import android.os.SystemClock; import android.os.UserManager; import android.view.Choreographer; import android.view.WindowManager; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.UiEventLogger; import com.android.internal.statusbar.IStatusBarService; import com.android.launcher3.icons.IconProvider; import com.android.wm.shell.RootTaskDisplayAreaOrganizer; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.TaskViewTransitions; import com.android.wm.shell.WindowManagerShellWrapper; import com.android.wm.shell.bubbles.BubbleController; import com.android.wm.shell.bubbles.BubbleData; import com.android.wm.shell.bubbles.BubbleDataRepository; … Read more