Add spa flag for Picture-in-picture App List

Bug: 235727273
Test: Manually with Settings for both flag on and off
Change-Id: I8d907a658406684998bc8b84c214462cb86fed88
This commit is contained in:
Chaohui Wang
2022-12-13 16:29:53 +08:00
parent ff861d54d4
commit 9f735ab6ed

View File

@@ -28,6 +28,7 @@ import android.content.pm.UserInfo;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.FeatureFlagUtils;
import android.util.IconDrawableFactory;
import android.util.Pair;
import android.view.View;
@@ -40,6 +41,8 @@ import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.applications.AppInfoBase;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.spa.SpaActivity;
import com.android.settings.spa.app.specialaccess.PictureInPictureListProvider;
import com.android.settings.widget.EmptyTextSettings;
import com.android.settingslib.search.SearchIndexable;
import com.android.settingslib.widget.AppPreference;
@@ -126,6 +129,16 @@ public class PictureInPictureSettings extends EmptyTextSettings {
mUserManager = um;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_ENABLE_SPA)) {
SpaActivity.startSpaActivity(
context, PictureInPictureListProvider.INSTANCE.getAppListRoute());
finish();
}
}
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);