Schematize Display system properties

Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Test: m -j
Change-Id: I83b40ddfcde32d8d03fae73f5c252013933c466c
This commit is contained in:
Kiyoung Kim
2018-12-20 18:36:27 +09:00
parent 95ca4bf581
commit 1a3425ed2a
6 changed files with 25 additions and 37 deletions

View File

@@ -27,6 +27,7 @@ import android.os.SystemProperties;
import android.provider.Settings;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import android.sysprop.DisplayProperties;
import android.util.Log;
import android.view.IWindowManager;
import android.view.ThreadedRenderer;
@@ -98,12 +99,12 @@ public abstract class DevelopmentTiles extends TileService {
@Override
protected boolean isEnabled() {
return SystemProperties.getBoolean(View.DEBUG_LAYOUT_PROPERTY, false);
return DisplayProperties.debug_layout().orElse(false);
}
@Override
protected void setIsEnabled(boolean isEnabled) {
SystemProperties.set(View.DEBUG_LAYOUT_PROPERTY, isEnabled ? "true" : "false");
DisplayProperties.debug_layout(isEnabled);
}
}
@@ -139,7 +140,7 @@ public abstract class DevelopmentTiles extends TileService {
protected void setIsEnabled(boolean isEnabled) {
Settings.Global.putInt(
getContentResolver(), Settings.Global.DEVELOPMENT_FORCE_RTL, isEnabled ? 1 : 0);
SystemProperties.set(Settings.Global.DEVELOPMENT_FORCE_RTL, isEnabled ? "1" : "0");
DisplayProperties.debug_force_rtl(isEnabled);
LocalePicker.updateLocales(getResources().getConfiguration().getLocales());
}
}