From c6df37ca23910a7b6cd8084152fa6f6a1d4cec5f Mon Sep 17 00:00:00 2001 From: Tad Date: Sun, 26 Sep 2021 13:28:19 -0400 Subject: [PATCH] Expose the Sensors Off tile This removes the hidden development 'Sensors off' tile from Settings app, adds it back to SystemUI, and enables it by default. Tested working on 18.1 Signed-off-by: Tad --- .../packages/SystemUI/res/values/config.xml | 2 +- .../0012-Restore_SensorsOff.patch | 264 ++++++++++++++++++ .../0003-Remove_SensorsOff_Tile.patch | 95 +++++++ .../0011-Restore_SensorsOff.patch | 264 ++++++++++++++++++ .../0003-Remove_SensorsOff_Tile.patch | 99 +++++++ Scripts/LineageOS-17.1/Patch.sh | 2 + Scripts/LineageOS-18.1/Patch.sh | 2 + 7 files changed, 727 insertions(+), 1 deletion(-) create mode 100644 Patches/LineageOS-17.1/android_frameworks_base/0012-Restore_SensorsOff.patch create mode 100644 Patches/LineageOS-17.1/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch create mode 100644 Patches/LineageOS-18.1/android_frameworks_base/0011-Restore_SensorsOff.patch create mode 100644 Patches/LineageOS-18.1/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch diff --git a/Patches/Common/android_vendor_divested/overlay/common/frameworks/base/packages/SystemUI/res/values/config.xml b/Patches/Common/android_vendor_divested/overlay/common/frameworks/base/packages/SystemUI/res/values/config.xml index f87fa698..f674d619 100644 --- a/Patches/Common/android_vendor_divested/overlay/common/frameworks/base/packages/SystemUI/res/values/config.xml +++ b/Patches/Common/android_vendor_divested/overlay/common/frameworks/base/packages/SystemUI/res/values/config.xml @@ -3,7 +3,7 @@ - wifi,cell,bt,dnd,flashlight,rotation,battery,location,airplane,caffeine,saver,hotspot,nfc,sync + wifi,cell,bt,sensorprivacy,flashlight,location,rotation,battery,airplane,dnd,caffeine,dark,saver,hotspot,nfc,sync diff --git a/Patches/LineageOS-17.1/android_frameworks_base/0012-Restore_SensorsOff.patch b/Patches/LineageOS-17.1/android_frameworks_base/0012-Restore_SensorsOff.patch new file mode 100644 index 00000000..4d00822a --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_base/0012-Restore_SensorsOff.patch @@ -0,0 +1,264 @@ +From 57106526e814f24b8eb7dd33f62f53ff50864d73 Mon Sep 17 00:00:00 2001 +From: Tad +Date: Sun, 26 Sep 2021 14:15:01 -0400 +Subject: [PATCH] Restore Sensors Off tile + +Was moved to Settings under Developer options in a51ea81f4445 + +Signed-off-by: Tad +Change-Id: I043d1c6992595f5f074baea15b47cc5d1f2fac3b +--- + .../res/drawable/ic_signal_sensors.xml | 40 ++++++ + packages/SystemUI/res/values/config.xml | 2 +- + .../systemui/qs/tileimpl/QSFactoryImpl.java | 6 + + .../systemui/qs/tiles/SensorPrivacyTile.java | 133 ++++++++++++++++++ + 4 files changed, 180 insertions(+), 1 deletion(-) + create mode 100644 packages/SystemUI/res/drawable/ic_signal_sensors.xml + create mode 100644 packages/SystemUI/src/com/android/systemui/qs/tiles/SensorPrivacyTile.java + +diff --git a/packages/SystemUI/res/drawable/ic_signal_sensors.xml b/packages/SystemUI/res/drawable/ic_signal_sensors.xml +new file mode 100644 +index 000000000000..b9b3500593a5 +--- /dev/null ++++ b/packages/SystemUI/res/drawable/ic_signal_sensors.xml +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ +diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml +index f99dc023a9f8..0102013c3f87 100644 +--- a/packages/SystemUI/res/values/config.xml ++++ b/packages/SystemUI/res/values/config.xml +@@ -117,7 +117,7 @@ + + + +- wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,dark,work,cast,night,adb_network,ambient_display,caffeine,heads_up,livedisplay,aod,reading_mode,sync,usb_tether,volume_panel,vpn,profiles,powershare ++ wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,dark,work,cast,night,adb_network,ambient_display,caffeine,heads_up,livedisplay,aod,reading_mode,sync,usb_tether,volume_panel,vpn,profiles,powershare,sensorprivacy + + + +diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java +index 756d1fd53ac3..9b3653a01449 100644 +--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java ++++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java +@@ -51,6 +51,7 @@ import com.android.systemui.qs.tiles.PowerShareTile; + import com.android.systemui.qs.tiles.ProfilesTile; + import com.android.systemui.qs.tiles.ReadingModeTile; + import com.android.systemui.qs.tiles.RotationLockTile; ++import com.android.systemui.qs.tiles.SensorPrivacyTile; + import com.android.systemui.qs.tiles.SyncTile; + import com.android.systemui.qs.tiles.UiModeNightTile; + import com.android.systemui.qs.tiles.UsbTetherTile; +@@ -87,6 +88,7 @@ public class QSFactoryImpl implements QSFactory { + private final Provider mDataSaverTileProvider; + private final Provider mNightDisplayTileProvider; + private final Provider mNfcTileProvider; ++ private final Provider mSensorPrivacyTileProvider; + private final Provider mMemoryTileProvider; + private final Provider mUiModeNightTileProvider; + private final Provider mAdbOverNetworkTileProvider; +@@ -123,6 +125,7 @@ public class QSFactoryImpl implements QSFactory { + Provider dataSaverTileProvider, + Provider nightDisplayTileProvider, + Provider nfcTileProvider, ++ Provider sensorPrivacyTileProvider, + Provider memoryTileProvider, + Provider uiModeNightTileProvider, + Provider adbOverNetworkTileProvider, +@@ -155,6 +158,7 @@ public class QSFactoryImpl implements QSFactory { + mDataSaverTileProvider = dataSaverTileProvider; + mNightDisplayTileProvider = nightDisplayTileProvider; + mNfcTileProvider = nfcTileProvider; ++ mSensorPrivacyTileProvider = sensorPrivacyTileProvider; + mMemoryTileProvider = memoryTileProvider; + mUiModeNightTileProvider = uiModeNightTileProvider; + mAdbOverNetworkTileProvider = adbOverNetworkTileProvider; +@@ -221,6 +225,8 @@ public class QSFactoryImpl implements QSFactory { + return mNightDisplayTileProvider.get(); + case "nfc": + return mNfcTileProvider.get(); ++ case "sensorprivacy": ++ return mSensorPrivacyTileProvider.get(); + case "dark": + return mUiModeNightTileProvider.get(); + // Custom tiles. +diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/SensorPrivacyTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/SensorPrivacyTile.java +new file mode 100644 +index 000000000000..941e1d44e145 +--- /dev/null ++++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/SensorPrivacyTile.java +@@ -0,0 +1,133 @@ ++/* ++ * Copyright (C) 2018 The Android Open Source Project ++ * ++ * 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 com.android.systemui.qs.tiles; ++ ++import android.content.Context; ++import android.content.Intent; ++import android.hardware.SensorPrivacyManager; ++import android.service.quicksettings.Tile; ++import android.widget.Switch; ++ ++import com.android.internal.logging.MetricsLogger; ++import com.android.internal.logging.nano.MetricsProto.MetricsEvent; ++import com.android.systemui.R; ++import com.android.systemui.plugins.ActivityStarter; ++import com.android.systemui.plugins.qs.QSTile.BooleanState; ++import com.android.systemui.qs.QSHost; ++import com.android.systemui.qs.tileimpl.QSTileImpl; ++import android.app.KeyguardManager; ++ ++import javax.inject.Inject; ++ ++/** Quick settings tile: SensorPrivacy mode **/ ++public class SensorPrivacyTile extends QSTileImpl implements ++ SensorPrivacyManager.OnSensorPrivacyChangedListener { ++ private static final String TAG = "SensorPrivacy"; ++ private final Icon mIcon = ++ ResourceIcon.get(R.drawable.ic_signal_sensors); ++ private KeyguardManager mKeyguardManager; ++ private final SensorPrivacyManager mSensorPrivacyManager; ++ private final ActivityStarter mActivityStarter; ++ ++ @Inject ++ public SensorPrivacyTile(QSHost host, SensorPrivacyManager sensorPrivacyManager, ++ ActivityStarter activityStarter) { ++ super(host); ++ ++ mSensorPrivacyManager = sensorPrivacyManager; ++ mKeyguardManager = (KeyguardManager) mContext.getSystemService( ++ Context.KEYGUARD_SERVICE); ++ mActivityStarter = activityStarter; ++ } ++ ++ @Override ++ public BooleanState newTileState() { ++ return new BooleanState(); ++ } ++ ++ @Override ++ public void handleClick() { ++ final boolean wasEnabled = mState.value; ++ // Don't allow disabling from the lockscreen. ++ if (wasEnabled && mKeyguardManager.isKeyguardLocked()) { ++ mActivityStarter.postQSRunnableDismissingKeyguard(() -> { ++ MetricsLogger.action(mContext, getMetricsCategory(), !wasEnabled); ++ setEnabled(!wasEnabled); ++ }); ++ return; ++ } ++ ++ MetricsLogger.action(mContext, getMetricsCategory(), !wasEnabled); ++ setEnabled(!wasEnabled); ++ } ++ ++ private void setEnabled(boolean enabled) { ++ mSensorPrivacyManager.setSensorPrivacy(enabled); ++ } ++ ++ @Override ++ public CharSequence getTileLabel() { ++ return mContext.getString(R.string.sensor_privacy_mode); ++ } ++ ++ @Override ++ public Intent getLongClickIntent() { ++ return new Intent(); ++ } ++ ++ @Override ++ protected void handleUpdateState(BooleanState state, Object arg) { ++ final boolean enabled = arg instanceof Boolean ? (Boolean) arg ++ : mSensorPrivacyManager.isSensorPrivacyEnabled(); ++ state.value = enabled; ++ state.label = mContext.getString(R.string.sensor_privacy_mode); ++ state.icon = mIcon; ++ state.state = enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE; ++ state.contentDescription = state.label; ++ state.expandedAccessibilityClassName = Switch.class.getName(); ++ } ++ ++ @Override ++ public int getMetricsCategory() { ++ return MetricsEvent.QS_SENSOR_PRIVACY; ++ } ++ ++ @Override ++ protected String composeChangeAnnouncement() { ++ if (mState.value) { ++ return mContext ++ .getString(R.string.accessibility_quick_settings_sensor_privacy_changed_on); ++ } else { ++ return mContext ++ .getString(R.string.accessibility_quick_settings_sensor_privacy_changed_off); ++ } ++ } ++ ++ @Override ++ protected void handleSetListening(boolean listening) { ++ if (listening) { ++ mSensorPrivacyManager.addSensorPrivacyListener(this); ++ } else { ++ mSensorPrivacyManager.removeSensorPrivacyListener(this); ++ } ++ } ++ ++ @Override ++ public void onSensorPrivacyChanged(boolean enabled) { ++ refreshState(enabled); ++ } ++} +-- +2.31.1 + diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch new file mode 100644 index 00000000..cf88bf5f --- /dev/null +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch @@ -0,0 +1,95 @@ +From 051e9e895fe14095e3161cb81cd68fe590858750 Mon Sep 17 00:00:00 2001 +From: Tad +Date: Sun, 26 Sep 2021 14:10:53 -0400 +Subject: [PATCH] Remove the Sensors Off tile + +Signed-off-by: Tad +Change-Id: Ic1dce1c0fffc3c3f6459c4c85e0a64d480d3315a +--- + AndroidManifest.xml | 11 ----- + .../development/qstile/DevelopmentTiles.java | 42 ------------------- + 2 files changed, 53 deletions(-) + +diff --git a/AndroidManifest.xml b/AndroidManifest.xml +index e4378d6b93..89fc7973a7 100644 +--- a/AndroidManifest.xml ++++ b/AndroidManifest.xml +@@ -3079,17 +3079,6 @@ + + + +- +- +- +- +- +- + +Date: Sun, 26 Sep 2021 14:15:01 -0400 +Subject: [PATCH] Restore Sensors Off tile + +Was moved to Settings under Developer options in a51ea81f4445 + +Signed-off-by: Tad +Change-Id: I043d1c6992595f5f074baea15b47cc5d1f2fac3b +--- + .../res/drawable/ic_signal_sensors.xml | 40 ++++++ + packages/SystemUI/res/values/config.xml | 2 +- + .../systemui/qs/tileimpl/QSFactoryImpl.java | 6 + + .../systemui/qs/tiles/SensorPrivacyTile.java | 133 ++++++++++++++++++ + 4 files changed, 180 insertions(+), 1 deletion(-) + create mode 100644 packages/SystemUI/res/drawable/ic_signal_sensors.xml + create mode 100644 packages/SystemUI/src/com/android/systemui/qs/tiles/SensorPrivacyTile.java + +diff --git a/packages/SystemUI/res/drawable/ic_signal_sensors.xml b/packages/SystemUI/res/drawable/ic_signal_sensors.xml +new file mode 100644 +index 000000000000..b9b3500593a5 +--- /dev/null ++++ b/packages/SystemUI/res/drawable/ic_signal_sensors.xml +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ +diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml +index 367fe72d4da7..f10d021e5c50 100644 +--- a/packages/SystemUI/res/values/config.xml ++++ b/packages/SystemUI/res/values/config.xml +@@ -114,7 +114,7 @@ + + + +- wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,dark,work,cast,night,screenrecord,reverse,ambient_display,aod,caffeine,heads_up,livedisplay,powershare,profiles,reading_mode,sync,usb_tether,volume_panel,vpn,anti_flicker ++ wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,dark,work,cast,night,screenrecord,reverse,ambient_display,aod,caffeine,heads_up,livedisplay,powershare,profiles,reading_mode,sync,usb_tether,volume_panel,vpn,anti_flicker,sensorprivacy + + + +diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java +index 47b9c7bec0d7..66d7b8803570 100644 +--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java ++++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java +@@ -51,6 +51,7 @@ import com.android.systemui.qs.tiles.ProfilesTile; + import com.android.systemui.qs.tiles.ReadingModeTile; + import com.android.systemui.qs.tiles.RotationLockTile; + import com.android.systemui.qs.tiles.ScreenRecordTile; ++import com.android.systemui.qs.tiles.SensorPrivacyTile; + import com.android.systemui.qs.tiles.SyncTile; + import com.android.systemui.qs.tiles.UiModeNightTile; + import com.android.systemui.qs.tiles.UsbTetherTile; +@@ -89,6 +90,7 @@ public class QSFactoryImpl implements QSFactory { + private final Provider mDataSaverTileProvider; + private final Provider mNightDisplayTileProvider; + private final Provider mNfcTileProvider; ++ private final Provider mSensorPrivacyTileProvider; + private final Provider mMemoryTileProvider; + private final Provider mUiModeNightTileProvider; + private final Provider mScreenRecordTileProvider; +@@ -127,6 +129,7 @@ public class QSFactoryImpl implements QSFactory { + Provider dataSaverTileProvider, + Provider nightDisplayTileProvider, + Provider nfcTileProvider, ++ Provider sensorPrivacyTileProvider, + Provider memoryTileProvider, + Provider uiModeNightTileProvider, + Provider screenRecordTileProvider, +@@ -161,6 +164,7 @@ public class QSFactoryImpl implements QSFactory { + mDataSaverTileProvider = dataSaverTileProvider; + mNightDisplayTileProvider = nightDisplayTileProvider; + mNfcTileProvider = nfcTileProvider; ++ mSensorPrivacyTileProvider = sensorPrivacyTileProvider; + mMemoryTileProvider = memoryTileProvider; + mUiModeNightTileProvider = uiModeNightTileProvider; + mScreenRecordTileProvider = screenRecordTileProvider; +@@ -224,6 +228,8 @@ public class QSFactoryImpl implements QSFactory { + return mNightDisplayTileProvider.get(); + case "nfc": + return mNfcTileProvider.get(); ++ case "sensorprivacy": ++ return mSensorPrivacyTileProvider.get(); + case "dark": + return mUiModeNightTileProvider.get(); + case "screenrecord": +diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/SensorPrivacyTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/SensorPrivacyTile.java +new file mode 100644 +index 000000000000..941e1d44e145 +--- /dev/null ++++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/SensorPrivacyTile.java +@@ -0,0 +1,133 @@ ++/* ++ * Copyright (C) 2018 The Android Open Source Project ++ * ++ * 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 com.android.systemui.qs.tiles; ++ ++import android.content.Context; ++import android.content.Intent; ++import android.hardware.SensorPrivacyManager; ++import android.service.quicksettings.Tile; ++import android.widget.Switch; ++ ++import com.android.internal.logging.MetricsLogger; ++import com.android.internal.logging.nano.MetricsProto.MetricsEvent; ++import com.android.systemui.R; ++import com.android.systemui.plugins.ActivityStarter; ++import com.android.systemui.plugins.qs.QSTile.BooleanState; ++import com.android.systemui.qs.QSHost; ++import com.android.systemui.qs.tileimpl.QSTileImpl; ++import android.app.KeyguardManager; ++ ++import javax.inject.Inject; ++ ++/** Quick settings tile: SensorPrivacy mode **/ ++public class SensorPrivacyTile extends QSTileImpl implements ++ SensorPrivacyManager.OnSensorPrivacyChangedListener { ++ private static final String TAG = "SensorPrivacy"; ++ private final Icon mIcon = ++ ResourceIcon.get(R.drawable.ic_signal_sensors); ++ private KeyguardManager mKeyguardManager; ++ private final SensorPrivacyManager mSensorPrivacyManager; ++ private final ActivityStarter mActivityStarter; ++ ++ @Inject ++ public SensorPrivacyTile(QSHost host, SensorPrivacyManager sensorPrivacyManager, ++ ActivityStarter activityStarter) { ++ super(host); ++ ++ mSensorPrivacyManager = sensorPrivacyManager; ++ mKeyguardManager = (KeyguardManager) mContext.getSystemService( ++ Context.KEYGUARD_SERVICE); ++ mActivityStarter = activityStarter; ++ } ++ ++ @Override ++ public BooleanState newTileState() { ++ return new BooleanState(); ++ } ++ ++ @Override ++ public void handleClick() { ++ final boolean wasEnabled = mState.value; ++ // Don't allow disabling from the lockscreen. ++ if (wasEnabled && mKeyguardManager.isKeyguardLocked()) { ++ mActivityStarter.postQSRunnableDismissingKeyguard(() -> { ++ MetricsLogger.action(mContext, getMetricsCategory(), !wasEnabled); ++ setEnabled(!wasEnabled); ++ }); ++ return; ++ } ++ ++ MetricsLogger.action(mContext, getMetricsCategory(), !wasEnabled); ++ setEnabled(!wasEnabled); ++ } ++ ++ private void setEnabled(boolean enabled) { ++ mSensorPrivacyManager.setSensorPrivacy(enabled); ++ } ++ ++ @Override ++ public CharSequence getTileLabel() { ++ return mContext.getString(R.string.sensor_privacy_mode); ++ } ++ ++ @Override ++ public Intent getLongClickIntent() { ++ return new Intent(); ++ } ++ ++ @Override ++ protected void handleUpdateState(BooleanState state, Object arg) { ++ final boolean enabled = arg instanceof Boolean ? (Boolean) arg ++ : mSensorPrivacyManager.isSensorPrivacyEnabled(); ++ state.value = enabled; ++ state.label = mContext.getString(R.string.sensor_privacy_mode); ++ state.icon = mIcon; ++ state.state = enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE; ++ state.contentDescription = state.label; ++ state.expandedAccessibilityClassName = Switch.class.getName(); ++ } ++ ++ @Override ++ public int getMetricsCategory() { ++ return MetricsEvent.QS_SENSOR_PRIVACY; ++ } ++ ++ @Override ++ protected String composeChangeAnnouncement() { ++ if (mState.value) { ++ return mContext ++ .getString(R.string.accessibility_quick_settings_sensor_privacy_changed_on); ++ } else { ++ return mContext ++ .getString(R.string.accessibility_quick_settings_sensor_privacy_changed_off); ++ } ++ } ++ ++ @Override ++ protected void handleSetListening(boolean listening) { ++ if (listening) { ++ mSensorPrivacyManager.addSensorPrivacyListener(this); ++ } else { ++ mSensorPrivacyManager.removeSensorPrivacyListener(this); ++ } ++ } ++ ++ @Override ++ public void onSensorPrivacyChanged(boolean enabled) { ++ refreshState(enabled); ++ } ++} +-- +2.31.1 + diff --git a/Patches/LineageOS-18.1/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch b/Patches/LineageOS-18.1/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch new file mode 100644 index 00000000..ff709446 --- /dev/null +++ b/Patches/LineageOS-18.1/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch @@ -0,0 +1,99 @@ +From e0e9afa0b76af1692cfcb1f24e3ca4f4faccf321 Mon Sep 17 00:00:00 2001 +From: Tad +Date: Sun, 26 Sep 2021 14:10:53 -0400 +Subject: [PATCH] Remove the Sensors Off tile + +Signed-off-by: Tad +Change-Id: Ic1dce1c0fffc3c3f6459c4c85e0a64d480d3315a +--- + AndroidManifest.xml | 13 ------ + .../development/qstile/DevelopmentTiles.java | 42 ------------------- + 2 files changed, 55 deletions(-) + +diff --git a/AndroidManifest.xml b/AndroidManifest.xml +index c17807bd13..09d4c3b0ab 100644 +--- a/AndroidManifest.xml ++++ b/AndroidManifest.xml +@@ -3130,19 +3130,6 @@ + android:value="true"/> + + +- +- +- +- +- +- +- + 0) { packageList.add("net.sourceforge.opencamera"); }' core/java/android/hardware/Camera.java; #Add Open Camera to aux camera allowlist XXX: needs testing, broke boot last time rm -rf packages/OsuLogin; #Automatic Wi-Fi connection non-sense @@ -200,6 +201,7 @@ if enterAndClear "packages/apps/Settings"; then git revert --no-edit 486980cfecce2ca64267f41462f9371486308e9d; #Don't hide OEM unlock patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0001-Captive_Portal_Toggle.patch"; #Add option to disable captive portal checks (MSe1969) patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0002-Sensors.patch"; #Permission for sensors access (MSe1969) +patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch"; #Remove the Sensors Off development tile sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/password/ChooseLockPassword.java; #Increase max password length (GrapheneOS) sed -i 's/if (isFullDiskEncrypted()) {/if (false) {/' src/com/android/settings/accessibility/*AccessibilityService*.java; #Never disable secure start-up when enabling an accessibility service if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/backup/PrivacySettingsUtils.java; fi; #microG doesn't support Backup, hide the options diff --git a/Scripts/LineageOS-18.1/Patch.sh b/Scripts/LineageOS-18.1/Patch.sh index 4da768df..ba1c8f14 100644 --- a/Scripts/LineageOS-18.1/Patch.sh +++ b/Scripts/LineageOS-18.1/Patch.sh @@ -97,6 +97,7 @@ patch -p1 < "$DOS_PATCHES/android_frameworks_base/0009-SystemUI_No_Permission_Re patch -p1 < "$DOS_PATCHES/android_frameworks_base/0003-SUPL_No_IMSI.patch"; #Don't send IMSI to SUPL (MSe1969) patch -p1 < "$DOS_PATCHES/android_frameworks_base/0004-Fingerprint_Lockout.patch"; #Enable fingerprint lockout after three failed attempts (GrapheneOS) patch -p1 < "$DOS_PATCHES/android_frameworks_base/0010-Sensors.patch"; #Permission for sensors access (MSe1969) +patch -p1 < "$DOS_PATCHES/android_frameworks_base/0011-Restore_SensorsOff.patch"; #Restore the Sensors Off tile #sed -i '301i\ if(packageList != null && packageList.size() > 0) { packageList.add("net.sourceforge.opencamera"); }' core/java/android/hardware/Camera.java; #Add Open Camera to aux camera allowlist XXX: needs testing, broke boot last time if [ "$DOS_MICROG_INCLUDED" != "FULL" ]; then rm -rf packages/CompanionDeviceManager; fi; #Used to support Android Wear (which hard depends on GMS) rm -rf packages/PrintRecommendationService; #Creates popups to install proprietary print apps @@ -187,6 +188,7 @@ fi; if enterAndClear "packages/apps/Settings"; then patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0001-Captive_Portal_Toggle.patch"; #Add option to disable captive portal checks (MSe1969) patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0002-Sensors.patch"; #Permission for sensors access (MSe1969) +patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0003-Remove_SensorsOff_Tile.patch"; #Remove the Sensors Off development tile sed -i 's/if (isFullDiskEncrypted()) {/if (false) {/' src/com/android/settings/accessibility/*AccessibilityService*.java; #Never disable secure start-up when enabling an accessibility service if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/backup/PrivacySettingsUtils.java; fi; #microG doesn't support Backup, hide the options fi;