Merge "[Safety Labels] Filter out auto, wear and tv" into udc-dev am: 4d5ac5a89f
am: d8ca8de897
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22562077 Change-Id: I85b75d9707a673c56add33f61c8533e85d9a312a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.settings.privacy;
|
||||
import static android.safetylabel.SafetyLabelConstants.SAFETY_LABEL_CHANGE_NOTIFICATIONS_ENABLED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.provider.DeviceConfig;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
@@ -28,7 +29,6 @@ import com.android.settings.core.BasePreferenceController;
|
||||
* TODO b/264939792: Add tests
|
||||
*/
|
||||
public class AppDataSharingUpdatesPreferenceController extends BasePreferenceController {
|
||||
|
||||
public AppDataSharingUpdatesPreferenceController(Context context,
|
||||
String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
@@ -36,8 +36,16 @@ public class AppDataSharingUpdatesPreferenceController extends BasePreferenceCon
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY,
|
||||
SAFETY_LABEL_CHANGE_NOTIFICATIONS_ENABLED, false)
|
||||
return isPrivacySafetyLabelChangeNotificationsEnabled(mContext)
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
private boolean isPrivacySafetyLabelChangeNotificationsEnabled(Context context) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY,
|
||||
SAFETY_LABEL_CHANGE_NOTIFICATIONS_ENABLED, false)
|
||||
&& !packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
|
||||
&& !packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
|
||||
&& !packageManager.hasSystemFeature(PackageManager.FEATURE_WATCH);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user