Disable managed services special access screens...
... on low ram devices. - Remove them from the 'Special app access' screen - Display an error message if an app intents directly to them Bug: 35219985 Test: visual, and runtest --path ManagedAccessSettingsLowRamTest.java, when the device is in low ram mode and when it's not. Change-Id: Ied919cb248ae56683a00e3492c4737dfd00449ac
This commit is contained in:
@@ -16,21 +16,18 @@
|
||||
|
||||
package com.android.settings.notification;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
|
@@ -92,19 +92,25 @@ public class ZenAccessSettings extends EmptyTextSettings {
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
reloadList();
|
||||
getContentResolver().registerContentObserver(
|
||||
Secure.getUriFor(Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES), false,
|
||||
mObserver);
|
||||
getContentResolver().registerContentObserver(
|
||||
Secure.getUriFor(Secure.ENABLED_NOTIFICATION_LISTENERS), false,
|
||||
mObserver);
|
||||
if (!ActivityManager.isLowRamDeviceStatic()) {
|
||||
reloadList();
|
||||
getContentResolver().registerContentObserver(
|
||||
Secure.getUriFor(Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES), false,
|
||||
mObserver);
|
||||
getContentResolver().registerContentObserver(
|
||||
Secure.getUriFor(Secure.ENABLED_NOTIFICATION_LISTENERS), false,
|
||||
mObserver);
|
||||
} else {
|
||||
setEmptyText(R.string.disabled_low_ram_device);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
getContentResolver().unregisterContentObserver(mObserver);
|
||||
if (!ActivityManager.isLowRamDeviceStatic()) {
|
||||
getContentResolver().unregisterContentObserver(mObserver);
|
||||
}
|
||||
}
|
||||
|
||||
private void reloadList() {
|
||||
|
Reference in New Issue
Block a user