Merge "Fix Maps PIP issue: DeviceConfig permission denial" into tm-qpr-dev am: 9d63dc8b6e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20806122 Change-Id: Ib2c89b96573a37e3856da1d8db240ec151eeb422 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
811fb9fa8d
@@ -23,6 +23,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
|
import android.os.Binder;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@@ -109,9 +110,9 @@ public class NotificationVolumePreferenceController extends
|
|||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
mReceiver.register(true);
|
mReceiver.register(true);
|
||||||
DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SYSTEMUI,
|
Binder.withCleanCallingIdentity(()
|
||||||
ActivityThread.currentApplication().getMainExecutor(),
|
-> DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SYSTEMUI,
|
||||||
this::onDeviceConfigChange);
|
ActivityThread.currentApplication().getMainExecutor(), this::onDeviceConfigChange));
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
|
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
|
||||||
@@ -119,7 +120,8 @@ public class NotificationVolumePreferenceController extends
|
|||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
mReceiver.register(false);
|
mReceiver.register(false);
|
||||||
DeviceConfig.removeOnPropertiesChangedListener(this::onDeviceConfigChange);
|
Binder.withCleanCallingIdentity(() ->
|
||||||
|
DeviceConfig.removeOnPropertiesChangedListener(this::onDeviceConfigChange));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -23,6 +23,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
|
import android.os.Binder;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@@ -85,8 +86,9 @@ public class RingVolumePreferenceController extends
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
mReceiver.register(true);
|
mReceiver.register(true);
|
||||||
readSeparateNotificationVolumeConfig();
|
readSeparateNotificationVolumeConfig();
|
||||||
DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SYSTEMUI,
|
Binder.withCleanCallingIdentity(()
|
||||||
ActivityThread.currentApplication().getMainExecutor(), this::onDeviceConfigChange);
|
-> DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SYSTEMUI,
|
||||||
|
ActivityThread.currentApplication().getMainExecutor(), this::onDeviceConfigChange));
|
||||||
updateEffectsSuppressor();
|
updateEffectsSuppressor();
|
||||||
selectPreferenceIconState();
|
selectPreferenceIconState();
|
||||||
|
|
||||||
@@ -100,7 +102,8 @@ public class RingVolumePreferenceController extends
|
|||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
mReceiver.register(false);
|
mReceiver.register(false);
|
||||||
DeviceConfig.removeOnPropertiesChangedListener(this::onDeviceConfigChange);
|
Binder.withCleanCallingIdentity(() ->
|
||||||
|
DeviceConfig.removeOnPropertiesChangedListener(this::onDeviceConfigChange));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -124,7 +127,6 @@ public class RingVolumePreferenceController extends
|
|||||||
@Override
|
@Override
|
||||||
protected boolean hintsMatch(int hints) {
|
protected boolean hintsMatch(int hints) {
|
||||||
boolean notificationSeparated = isSeparateNotificationConfigEnabled();
|
boolean notificationSeparated = isSeparateNotificationConfigEnabled();
|
||||||
|
|
||||||
return (hints & NotificationListenerService.HINT_HOST_DISABLE_CALL_EFFECTS) != 0
|
return (hints & NotificationListenerService.HINT_HOST_DISABLE_CALL_EFFECTS) != 0
|
||||||
|| (hints & NotificationListenerService.HINT_HOST_DISABLE_EFFECTS) != 0
|
|| (hints & NotificationListenerService.HINT_HOST_DISABLE_EFFECTS) != 0
|
||||||
|| ((hints & NotificationListenerService.HINT_HOST_DISABLE_NOTIFICATION_EFFECTS)
|
|| ((hints & NotificationListenerService.HINT_HOST_DISABLE_NOTIFICATION_EFFECTS)
|
||||||
|
@@ -21,6 +21,7 @@ import android.app.NotificationManager;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
|
import android.os.Binder;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.provider.DeviceConfig;
|
import android.provider.DeviceConfig;
|
||||||
@@ -118,9 +119,10 @@ public abstract class RingerModeAffectedVolumePreferenceController extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isSeparateNotificationConfigEnabled() {
|
protected boolean isSeparateNotificationConfigEnabled() {
|
||||||
return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
|
return Binder.withCleanCallingIdentity(()
|
||||||
|
-> DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
|
||||||
SystemUiDeviceConfigFlags.VOLUME_SEPARATE_NOTIFICATION,
|
SystemUiDeviceConfigFlags.VOLUME_SEPARATE_NOTIFICATION,
|
||||||
CONFIG_SEPARATE_NOTIFICATION_DEFAULT_VAL);
|
CONFIG_SEPARATE_NOTIFICATION_DEFAULT_VAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user