Hide PIP related preference when device didn't support this feature
Fixes: 79945310 Test: atest & manual Change-Id: I24b9de06ec94a008656cbbc016a50a4e217fece1
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.applications.specialaccess.pictureinpicture;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
@@ -30,7 +31,8 @@ public class PictureInPictureController extends BasePreferenceController {
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return !ActivityManager.isLowRamDeviceStatic()
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
&& mContext.getPackageManager().hasSystemFeature(
|
||||
PackageManager.FEATURE_PICTURE_IN_PICTURE) ? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
}
|
||||
|
@@ -43,6 +43,10 @@ public class PictureInPictureDetailPreferenceController extends AppInfoPreferenc
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (!mContext.getPackageManager().hasSystemFeature(
|
||||
PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
return hasPictureInPictureActivites() ? AVAILABLE : DISABLED_FOR_USER;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user