diff options
| author | Adithya R <gh0strider.2k18.reborn@gmail.com> | 2021-08-15 21:56:27 +0530 |
|---|---|---|
| committer | nebrassy <nebras30@gmail.com> | 2022-06-12 16:30:57 +0200 |
| commit | 682d139a761fd621af0a027d29b4db7f011bebe8 (patch) | |
| tree | 627aa5f73b1cacf38cec6819e662ed9753a7ec80 | |
| parent | 2e5ff318b43a6786222169088d7db79929b61e74 (diff) | |
vayu: parts: Add support for LCD HBM and CABC
* write preferences and qs tiles
* kang icons from realmeparts
* enable cabc by default
* address sepolicy denials
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
Signed-off-by: David Setiawan <fryevia@foxmail.com>
Change-Id: I5447beec4ee778442f2d999ddcc2c998b91b7b04
| -rw-r--r-- | parts/AndroidManifest.xml | 38 | ||||
| -rw-r--r-- | parts/deviceparts.rc | 20 | ||||
| -rw-r--r-- | parts/res/drawable/ic_cabc.xml | 19 | ||||
| -rw-r--r-- | parts/res/drawable/ic_hbm.xml | 8 | ||||
| -rw-r--r-- | parts/res/values/arrays.xml | 27 | ||||
| -rw-r--r-- | parts/res/values/strings.xml | 8 | ||||
| -rw-r--r-- | parts/res/xml/lcd_features_settings.xml | 40 | ||||
| -rw-r--r-- | parts/src/org/lineageos/settings/display/CabcTileService.java | 76 | ||||
| -rw-r--r-- | parts/src/org/lineageos/settings/display/HbmTileService.java | 74 | ||||
| -rw-r--r-- | parts/src/org/lineageos/settings/display/LcdFeaturesPreferenceActivity.java | 30 | ||||
| -rw-r--r-- | parts/src/org/lineageos/settings/display/LcdFeaturesPreferenceFragment.java | 81 | ||||
| -rw-r--r-- | properties/system_ext.prop | 3 | ||||
| -rw-r--r-- | sepolicy/private/devicesettings_app.te | 3 | ||||
| -rw-r--r-- | sepolicy/private/property.te | 2 | ||||
| -rw-r--r-- | sepolicy/private/property_contexts | 3 |
15 files changed, 432 insertions, 0 deletions
diff --git a/parts/AndroidManifest.xml b/parts/AndroidManifest.xml index a393141..131f332 100644 --- a/parts/AndroidManifest.xml +++ b/parts/AndroidManifest.xml @@ -59,6 +59,24 @@ android:resource="@string/dirac_summary" /> </activity> + <activity + android:name=".display.LcdFeaturesPreferenceActivity" + android:label="@string/lcd_features_title" + android:theme="@style/Theme.Main"> + <intent-filter> + <action android:name="com.android.settings.action.IA_SETTINGS" /> + </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/lcd_features_summary" /> + <meta-data + android:name="com.android.settings.order" + android:value="5" /> + </activity> + <service android:name=".doze.DozeService" android:permission="XiaomiDozeService"> </service> @@ -119,6 +137,26 @@ </activity> <service + android:name=".display.HbmTileService" + android:icon="@drawable/ic_hbm" + android:label="@string/lcd_hbm_tile_title" + android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> + <intent-filter> + <action android:name="android.service.quicksettings.action.QS_TILE"/> + </intent-filter> + </service> + + <service + android:name=".display.CabcTileService" + android:icon="@drawable/ic_cabc" + android:label="@string/lcd_cabc_title" + android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> + <intent-filter> + <action android:name="android.service.quicksettings.action.QS_TILE"/> + </intent-filter> + </service> + + <service android:name=".RefreshRateTileService" android:icon="@drawable/ic_qs_refresh_rate" android:label="@string/refresh_rate_tile_title" diff --git a/parts/deviceparts.rc b/parts/deviceparts.rc new file mode 100644 index 0000000..ff171cc --- /dev/null +++ b/parts/deviceparts.rc @@ -0,0 +1,20 @@ +# Copyright (C) 2021 chaldeaprjkt +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +on property:persist.deviceparts.lcd.hbm=* + write /sys/devices/platform/soc/soc:qcom,dsi-display-primary/hbm ${persist.deviceparts.lcd.hbm} + +on property:persist.deviceparts.lcd.cabc=* + write /sys/devices/platform/soc/soc:qcom,dsi-display-primary/cabc ${persist.deviceparts.lcd.cabc} diff --git a/parts/res/drawable/ic_cabc.xml b/parts/res/drawable/ic_cabc.xml new file mode 100644 index 0000000..ee0ae73 --- /dev/null +++ b/parts/res/drawable/ic_cabc.xml @@ -0,0 +1,19 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?android:attr/textColorSecondary">
+ <path
+ android:fillColor="#000000"
+ android:pathData="M19.5 19h-4c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5 -0.5h4c0.827 0 1.5-0.673 1.5-1.5v-1c0-0.276 0.224 -0.5 0.5 -0.5h0.991c0.276 0 0.5-0.224 0.5 -0.5v-6c0-0.276-0.224-0.5-0.5-0.5h-0.991c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.827-0.673-1.5-1.5-1.5h-4c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5 -0.5h4c1.378 0 2.5 1.122 2.5 2.5v0.5h0.491c0.827 0 1.5 0.673 1.5 1.5v6c0 0.827-0.673 1.5-1.5 1.5h-0.491v0.5c0 1.378-1.122 2.5-2.5 2.5z" />
+ <path
+ android:fillColor="#000000"
+ android:pathData="M6.75 19h-4.25c-1.378 0-2.5-1.122-2.5-2.5v-10c0-1.378 1.122-2.5 2.5-2.5h6c0.276 0 0.5 0.224 0.5 0.5 s-0.224 0.5 -0.5 0.5 h-6c-0.827 0-1.5 0.673 -1.5 1.5v10c0 0.827 0.673 1.5 1.5 1.5h4.25c0.276 0 0.5 0.224 0.5 0.5 s-0.224 0.5 -0.5 0.5 z" />
+ <path
+ android:fillColor="#000000"
+ android:pathData="M11.804 18c-3.053 0-4.804-2.032-4.804-5.574 0-1.637 0.769 -2.897 1.583-4.23 0.954 -1.563 1.939-3.178 1.939-5.696 0-0.198 0.116 -0.376 0.297 -0.457 0.181 -0.079 0.391 -0.046 0.538 0.086l0.136 0.122 c2.453 2.212 5.507 4.965 5.507 9.734 0 2.897-1.626 6.015-5.196 6.015zm-0.339-14.424c-0.238 2.207-1.183 3.754-2.029 5.141-0.77 1.262-1.436 2.353-1.436 3.709 0 2.087 0.66 4.574 3.804 4.574 2.883 0 4.196-2.6 4.196-5.015 0-3.946-2.291-6.356-4.535-8.409z" />
+ <path
+ android:fillColor="#000000"
+ android:pathData="M6.555 23c-0.226 0-0.43-0.153-0.485-0.382-0.065-0.269 0.1 -0.539 0.368 -0.604 5.912-1.432 5.309-9.891 5.302-9.976-0.022-0.275 0.184 -0.516 0.458 -0.538 0.278 -0.03 0.516 0.183 0.539 0.458 0.007 0.094 0.679 9.395-6.063 11.028-0.041 0.01 -0.08 0.014 -0.119 0.014 z" />
+</vector>
diff --git a/parts/res/drawable/ic_hbm.xml b/parts/res/drawable/ic_hbm.xml new file mode 100644 index 0000000..a280bdf --- /dev/null +++ b/parts/res/drawable/ic_hbm.xml @@ -0,0 +1,8 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="24dp" + android:width="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="?android:attr/colorControlNormal" > + <path android:fillColor="#000" android:pathData="M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z" /> +</vector> diff --git a/parts/res/values/arrays.xml b/parts/res/values/arrays.xml index 3fdddd9..5509d1c 100644 --- a/parts/res/values/arrays.xml +++ b/parts/res/values/arrays.xml @@ -95,4 +95,31 @@ <item>"0,4,2,0,-2,-2,4"</item> <item>"2,0,0,-2,-4,0,0"</item> </string-array> + + <string-array name="lcd_hbm_modes" translatable="false"> + <item>"Off"</item> + <item>"Medium"</item> + <item>"High"</item> + </string-array> + + <string-array name="lcd_hbm_values" translatable="false"> + <item>"0"</item> + <item>"1"</item> + <item>"2"</item> + </string-array> + + <string-array name="lcd_cabc_modes" translatable="false"> + <item>"Off"</item> + <item>"Low (UI)"</item> + <item>"Medium (Videos)"</item> + <item>"High (Images)"</item> + </string-array> + + <string-array name="lcd_cabc_values" translatable="false"> + <item>"0"</item> + <item>"1"</item> + <item>"3"</item> + <item>"2"</item> + </string-array> + </resources> diff --git a/parts/res/values/strings.xml b/parts/res/values/strings.xml index bd05060..ef1cb2b 100644 --- a/parts/res/values/strings.xml +++ b/parts/res/values/strings.xml @@ -94,4 +94,12 @@ <!-- Refresh Rate tile --> <string name="refresh_rate_tile_title">Refresh Rate</string> + <!-- LCD Features --> + <string name="lcd_features_title">Additional Display Features</string> + <string name="lcd_features_summary">High Brightness Mode, CABC</string> + <string name="lcd_hbm_title">High Brightness Mode (HBM)</string> + <string name="lcd_hbm_tile_title">HBM</string> + <string name="lcd_cabc_title">CABC Mode</string> + <string name="lcd_features_info">High Brightness Mode (HBM) increases the maximum brightness of the display to improve visibility under sunlight. Increases power consumption.\n\nCABC (Content Adaptive Backlight Control) adjusts display and backlight brightness based on currently shown content, to reduce power consumption without degradation.</string> + </resources> diff --git a/parts/res/xml/lcd_features_settings.xml b/parts/res/xml/lcd_features_settings.xml new file mode 100644 index 0000000..473c4aa --- /dev/null +++ b/parts/res/xml/lcd_features_settings.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2021 Paranoid Android + + Licensed under the Apache License, Version 2.0 (the "License" + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<PreferenceScreen + xmlns:android="http://schemas.android.com/apk/res/android" + android:title="@string/lcd_features_title" > + + <ListPreference + android:key="lcd_hbm_pref" + android:title="@string/lcd_hbm_title" + android:entries="@array/lcd_hbm_modes" + android:entryValues="@array/lcd_hbm_values" + android:defaultValue="0" /> + + <ListPreference + android:key="lcd_cabc_pref" + android:title="@string/lcd_cabc_title" + android:entries="@array/lcd_cabc_modes" + android:entryValues="@array/lcd_cabc_values" + android:defaultValue="0" /> + + <com.android.settingslib.widget.FooterPreference + android:key="lcd_features_footer" + android:title="@string/lcd_features_info" + android:selectable="false" /> + +</PreferenceScreen> diff --git a/parts/src/org/lineageos/settings/display/CabcTileService.java b/parts/src/org/lineageos/settings/display/CabcTileService.java new file mode 100644 index 0000000..383e337 --- /dev/null +++ b/parts/src/org/lineageos/settings/display/CabcTileService.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2021 Paranoid Android + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.lineageos.settings.display; + +import android.content.Context; +import android.os.SystemProperties; +import android.service.quicksettings.Tile; +import android.service.quicksettings.TileService; + +import java.util.Arrays; + +import org.lineageos.settings.R; + +public class CabcTileService extends TileService { + + private Context context; + private Tile tile; + + private String[] CabcModes; + private String[] CabcValues; + private int currentCabcMode; + + @Override + public void onCreate() { + super.onCreate(); + context = getApplicationContext(); + CabcModes = context.getResources().getStringArray(R.array.lcd_cabc_modes); + CabcValues = context.getResources().getStringArray(R.array.lcd_cabc_values); + } + + private void updateCurrentCabcMode() { + currentCabcMode = Arrays.asList(CabcValues).indexOf(SystemProperties.get(LcdFeaturesPreferenceFragment.CABC_PROP, "0")); + } + + private void updateCabcTile() { + tile.setState(currentCabcMode > 0 ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE); + tile.setContentDescription(CabcModes[currentCabcMode]); + tile.setSubtitle(CabcModes[currentCabcMode]); + tile.updateTile(); + } + + @Override + public void onStartListening() { + super.onStartListening(); + tile = getQsTile(); + updateCurrentCabcMode(); + updateCabcTile(); + } + + @Override + public void onClick() { + super.onClick(); + updateCurrentCabcMode(); + if (currentCabcMode == CabcModes.length - 1) { + currentCabcMode = 0; + } else { + currentCabcMode++; + } + SystemProperties.set(LcdFeaturesPreferenceFragment.CABC_PROP, CabcValues[currentCabcMode]); + updateCabcTile(); + } +} diff --git a/parts/src/org/lineageos/settings/display/HbmTileService.java b/parts/src/org/lineageos/settings/display/HbmTileService.java new file mode 100644 index 0000000..25dd25d --- /dev/null +++ b/parts/src/org/lineageos/settings/display/HbmTileService.java @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2021 Paranoid Android + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.lineageos.settings.display; + +import android.content.Context; +import android.os.SystemProperties; +import android.service.quicksettings.Tile; +import android.service.quicksettings.TileService; + +import org.lineageos.settings.R; + +public class HbmTileService extends TileService { + + private Context context; + private Tile tile; + + private String[] HbmModes; + private String[] HbmValues; + private int currentHbmMode; + + @Override + public void onCreate() { + super.onCreate(); + context = getApplicationContext(); + HbmModes = context.getResources().getStringArray(R.array.lcd_hbm_modes); + HbmValues = context.getResources().getStringArray(R.array.lcd_hbm_values); + } + + private void updateCurrentHbmMode() { + currentHbmMode = SystemProperties.getInt(LcdFeaturesPreferenceFragment.HBM_PROP, 0); + } + + private void updateHbmTile() { + tile.setState(currentHbmMode > 0 ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE); + tile.setContentDescription(HbmModes[currentHbmMode]); + tile.setSubtitle(HbmModes[currentHbmMode]); + tile.updateTile(); + } + + @Override + public void onStartListening() { + super.onStartListening(); + tile = getQsTile(); + updateCurrentHbmMode(); + updateHbmTile(); + } + + @Override + public void onClick() { + super.onClick(); + updateCurrentHbmMode(); + if (currentHbmMode == HbmModes.length - 1) { + currentHbmMode = 0; + } else { + currentHbmMode++; + } + SystemProperties.set(LcdFeaturesPreferenceFragment.HBM_PROP, Integer.toString(currentHbmMode)); + updateHbmTile(); + } +} diff --git a/parts/src/org/lineageos/settings/display/LcdFeaturesPreferenceActivity.java b/parts/src/org/lineageos/settings/display/LcdFeaturesPreferenceActivity.java new file mode 100644 index 0000000..2e01cdf --- /dev/null +++ b/parts/src/org/lineageos/settings/display/LcdFeaturesPreferenceActivity.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2021 Paranoid Android + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.lineageos.settings.display; + +import android.os.Bundle; +import android.preference.PreferenceActivity; + +public class LcdFeaturesPreferenceActivity extends PreferenceActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + getFragmentManager().beginTransaction() + .replace(android.R.id.content, new LcdFeaturesPreferenceFragment()) + .commit(); + } +} diff --git a/parts/src/org/lineageos/settings/display/LcdFeaturesPreferenceFragment.java b/parts/src/org/lineageos/settings/display/LcdFeaturesPreferenceFragment.java new file mode 100644 index 0000000..d95faf1 --- /dev/null +++ b/parts/src/org/lineageos/settings/display/LcdFeaturesPreferenceFragment.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2021 Paranoid Android + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.lineageos.settings.display; + +import android.content.Context; +import android.os.Bundle; +import android.os.SystemProperties; + +import androidx.preference.ListPreference; +import androidx.preference.Preference; +import androidx.preference.PreferenceFragment; + +import org.lineageos.settings.R; + +public class LcdFeaturesPreferenceFragment extends PreferenceFragment + implements Preference.OnPreferenceChangeListener { + + public static final String HBM_PROP = "persist.deviceparts.lcd.hbm"; + public static final String CABC_PROP = "persist.deviceparts.lcd.cabc"; + + private static final String KEY_HBM = "lcd_hbm_pref"; + private static final String KEY_CABC = "lcd_cabc_pref"; + + private ListPreference mHbmPref; + private ListPreference mCabcPref; + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + getActivity().getActionBar().setDisplayHomeAsUpEnabled(true); + } + + @Override + public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { + addPreferencesFromResource(R.xml.lcd_features_settings); + mHbmPref = (ListPreference) findPreference(KEY_HBM); + mHbmPref.setOnPreferenceChangeListener(this); + mCabcPref = (ListPreference) findPreference(KEY_CABC); + mCabcPref.setOnPreferenceChangeListener(this); + } + + @Override + public void onResume() { + super.onResume(); + mHbmPref.setValue(SystemProperties.get(HBM_PROP, "0")); + mHbmPref.setSummary(mHbmPref.getEntry()); + mCabcPref.setValue(SystemProperties.get(CABC_PROP, "0")); + mCabcPref.setSummary(mCabcPref.getEntry()); + } + + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + final String key = preference.getKey(); + + if (key.equals(KEY_HBM)) { + mHbmPref.setValue((String) newValue); + mHbmPref.setSummary(mHbmPref.getEntry()); + SystemProperties.set(HBM_PROP, (String) newValue); + } else if (key.equals(KEY_CABC)) { + mCabcPref.setValue((String) newValue); + mCabcPref.setSummary(mCabcPref.getEntry()); + SystemProperties.set(CABC_PROP, (String) newValue); + } + + return true; + } +} diff --git a/properties/system_ext.prop b/properties/system_ext.prop index 586da65..ff43a89 100644 --- a/properties/system_ext.prop +++ b/properties/system_ext.prop @@ -1,2 +1,5 @@ # DPM persist.vendor.dpm.feature=11 + +# DeviceParts +persist.deviceparts.lcd.cabc=1 diff --git a/sepolicy/private/devicesettings_app.te b/sepolicy/private/devicesettings_app.te index 615020a..04902e3 100644 --- a/sepolicy/private/devicesettings_app.te +++ b/sepolicy/private/devicesettings_app.te @@ -38,3 +38,6 @@ allow devicesettings_app { # Allow xiaomi_settings to read and write to sysfs_vibrator allow devicesettings_app sysfs_vibrator:dir search; allow devicesettings_app sysfs_vibrator:file rw_file_perms; + +get_prop(devicesettings_app, deviceparts_prop) +set_prop(devicesettings_app, deviceparts_prop) diff --git a/sepolicy/private/property.te b/sepolicy/private/property.te new file mode 100644 index 0000000..f494515 --- /dev/null +++ b/sepolicy/private/property.te @@ -0,0 +1,2 @@ +# Device Parts +type deviceparts_prop, property_type; diff --git a/sepolicy/private/property_contexts b/sepolicy/private/property_contexts index c9cba76..b1c6812 100644 --- a/sepolicy/private/property_contexts +++ b/sepolicy/private/property_contexts @@ -20,3 +20,6 @@ ro.miui. u:object_r:exported_system_prop:s0 # Recovery ro.build.expect. u:object_r:exported_default_prop:s0 + +# Device Parts +persist.deviceparts. u:object_r:deviceparts_prop:s0 |
