Fix Maps PIP issue: DeviceConfig permission denial
Problem: Exception thrown when maps was in PIP mode. Solution: Use Binder to give permission to Settings reading device config SEPARATE_VOLUME_NOTIFICATION. Bug: 261809910 Test: Manual. (from bug report) Launch Maps and navigate to a place. Minimize maps app. Open Settings. Should open normally and not crash. Change-Id: I38735ebc7d555ead54e3aa77b50e4a7077fe452b
This commit is contained in:
@@ -21,6 +21,7 @@ import android.app.NotificationManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Binder;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.Vibrator;
|
||||
import android.provider.DeviceConfig;
|
||||
@@ -118,9 +119,10 @@ public abstract class RingerModeAffectedVolumePreferenceController extends
|
||||
}
|
||||
|
||||
protected boolean isSeparateNotificationConfigEnabled() {
|
||||
return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
|
||||
return Binder.withCleanCallingIdentity(()
|
||||
-> DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
|
||||
SystemUiDeviceConfigFlags.VOLUME_SEPARATE_NOTIFICATION,
|
||||
CONFIG_SEPARATE_NOTIFICATION_DEFAULT_VAL);
|
||||
CONFIG_SEPARATE_NOTIFICATION_DEFAULT_VAL));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user