Change to using sysprop for services.core.unboosted

The configstore service was deprecated. So change to use sysprop
instead of configstore

Bug: 124531214
Test: 1. check reading property values
      2. uninstall configstore && check reading property values
      3. uninstall configstore && check reading default values
Change-Id: Ia4471a58fdc042d3a011d965582c2ec02f338f3c
This commit is contained in:
Sundong Ahn
2020-04-23 20:08:55 +09:00
parent c65d2c3e06
commit dc217b9d20
2 changed files with 18 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ java_library_static {
"dnsresolver_aidl_interface-V4-java",
"netd_event_listener_interface-java",
"overlayable_policy_aidl-java",
"SurfaceFlingerProperties",
],
}

View File

@@ -195,6 +195,7 @@ import android.provider.DeviceConfig;
import android.provider.Settings;
import android.service.vr.IVrManager;
import android.service.vr.IVrStateCallbacks;
import android.sysprop.SurfaceFlingerProperties;
import android.text.format.DateUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -304,7 +305,9 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
@@ -4648,6 +4651,11 @@ public class WindowManagerService extends IWindowManager.Stub
}
private static boolean queryWideColorGamutSupport() {
boolean defaultValue = false;
Optional<Boolean> hasWideColorProp = SurfaceFlingerProperties.has_wide_color_display();
if (hasWideColorProp.isPresent()) {
return hasWideColorProp.get();
}
try {
ISurfaceFlingerConfigs surfaceFlinger = ISurfaceFlingerConfigs.getService();
OptionalBool hasWideColor = surfaceFlinger.hasWideColorDisplay();
@@ -4656,11 +4664,18 @@ public class WindowManagerService extends IWindowManager.Stub
}
} catch (RemoteException e) {
// Ignore, we're in big trouble if we can't talk to SurfaceFlinger's config store
} catch (NoSuchElementException e) {
return defaultValue;
}
return false;
}
private static boolean queryHdrSupport() {
boolean defaultValue = false;
Optional<Boolean> hasHdrProp = SurfaceFlingerProperties.has_HDR_display();
if (hasHdrProp.isPresent()) {
return hasHdrProp.get();
}
try {
ISurfaceFlingerConfigs surfaceFlinger = ISurfaceFlingerConfigs.getService();
OptionalBool hasHdr = surfaceFlinger.hasHDRDisplay();
@@ -4669,6 +4684,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
} catch (RemoteException e) {
// Ignore, we're in big trouble if we can't talk to SurfaceFlinger's config store
} catch (NoSuchElementException e) {
return defaultValue;
}
return false;
}