Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0a02f4b authored by Bruno Martins's avatar Bruno Martins
Browse files

LiveDisplaySettings: Inject into Settings via IA

 * Simply declare the activity-alias in the manifest and make use
   of the new information architecture for the Setting app to inject
   LiveDisplay settings into Display category.

 * Set intent priority to -2, so that the preference is placed
   two positions bellow top one (right bellow Adaptive Brightness).

Change-Id: Ia743eb198343f69b22771c78f24b4f32929c9143
parent 4069ed4d
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -88,6 +88,23 @@
            </intent-filter>
        </provider>

        <!-- LiveDisplay settings (Display category) -->
        <activity-alias
            android:name=".livedisplay.LiveDisplaySettings"
            android:label="@*lineageos.platform:string/live_display_title"
            android:targetActivity="PartsActivity">
            <intent-filter android:priority="-2">
                <action android:name="org.lineageos.lineageparts.action.SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data
                android:name="com.android.settings.category"
                android:value="com.android.settings.category.ia.display" />
            <meta-data
                android:name="com.android.settings.summary"
                android:resource="@string/live_display_summary" />
        </activity-alias>

        <!-- Privacy settings (dashboard) -->
        <!--
        <activity-alias
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
    <part android:key="livedisplay"
          android:title="@*lineageos.platform:string/live_display_title"
          android:summary="@string/live_display_summary"
          android:fragment="org.lineageos.lineageparts.livedisplay.LiveDisplay"
          android:fragment="org.lineageos.lineageparts.livedisplay.LiveDisplaySettings"
          lineage:xmlRes="@xml/livedisplay" />

    <part android:key="notification_lights"
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The CyanogenMod Project
 *               2017 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -55,7 +56,7 @@ import static lineageos.hardware.LiveDisplayManager.FEATURE_PICTURE_ADJUSTMENT;
import static lineageos.hardware.LiveDisplayManager.MODE_OFF;
import static lineageos.hardware.LiveDisplayManager.MODE_OUTDOOR;

public class LiveDisplay extends SettingsPreferenceFragment implements Searchable,
public class LiveDisplaySettings extends SettingsPreferenceFragment implements Searchable,
        Preference.OnPreferenceChangeListener, SettingsHelper.OnSettingsChangeListener {

    private static final String TAG = "LiveDisplay";