Turn NightMode into a RRO controlled by prop

This commit is contained in:
Pierre-Hugues Husson 2018-05-01 23:26:12 +02:00
parent eb8f42d4e1
commit c279146155
3 changed files with 6 additions and 9 deletions

View file

@ -2,4 +2,6 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := treble-overlay-NightMode
LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
include $(BUILD_PACKAGE)

View file

@ -3,5 +3,8 @@
android:versionCode="1"
android:versionName="1.0">
<overlay android:targetPackage="android"
android:priority="3"/>
android:requiredSystemPropertyName="persist.sys.overlay.nightmode"
android:requiredSystemPropertyValue="true"
android:priority="3"
android:isStatic="true" />
</manifest>

View file

@ -32,13 +32,6 @@ public class Starter extends BroadcastReceiver {
setOverlayEnabled("me.phh.treble.overlay.navbar", true);
}
private void handleNightmode(Context ctxt) {
if("msm8998".equals(platform)) {
Log.d("OverlayPicker", "Enabling nightmode");
setOverlayEnabled("me.phh.treble.overlay.nightmode", true);
}
}
private void enableLte(Context ctxt) {
//TODO: List here all non-LTE platforms
if(!"mt6580".equals(platform))
@ -51,7 +44,6 @@ public class Starter extends BroadcastReceiver {
ServiceManager.getService(Context.OVERLAY_SERVICE));
handleHtc(ctxt);
handleNightmode(ctxt);
enableLte(ctxt);
setOverlayEnabled("me.phh.treble.overlay.systemui.falselocks", true);