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: If0b7658e4f04848a6a068c18e93026591b7b5518
Merged-In: I83b40ddfcde32d8d03fae73f5c252013933c466c
This commit is contained in:
Kiyoung Kim
2018-12-20 18:36:27 +09:00
parent 15bf05f6fd
commit 59e3152a0e
7 changed files with 27 additions and 39 deletions

View File

@@ -25,6 +25,7 @@ import android.os.SystemProperties;
import android.provider.Settings;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import android.sysprop.DisplayProperties;
import androidx.annotation.VisibleForTesting;
import android.util.Log;
import android.view.IWindowManager;
@@ -68,12 +69,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);
}
}
@@ -109,7 +110,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());
}
}