From e533bc7607b8983179e4dcad5f57b3297617e324 Mon Sep 17 00:00:00 2001 From: Tad Date: Thu, 22 Mar 2018 08:32:01 -0400 Subject: [PATCH] Cleanup --- Changelogs/Changes-LAOS_14.1.txt | 45 ---- .../0001-Tri_State_Torch.patch | 83 ------- .../android_frameworks_base/0002-Radio.patch | 231 ------------------ .../cm_platform_sdk/0001-Radio.patch | 33 --- Scripts/LineageOS-14.1/Patch.sh | 2 - 5 files changed, 394 deletions(-) delete mode 100644 Changelogs/Changes-LAOS_14.1.txt delete mode 100644 Patches/LineageOS-14.1/android_device_motorola_clark/0001-Tri_State_Torch.patch delete mode 100644 Patches/LineageOS-14.1/android_frameworks_base/0002-Radio.patch delete mode 100644 Patches/LineageOS-14.1/cm_platform_sdk/0001-Radio.patch diff --git a/Changelogs/Changes-LAOS_14.1.txt b/Changelogs/Changes-LAOS_14.1.txt deleted file mode 100644 index 1cfe7bc9..00000000 --- a/Changelogs/Changes-LAOS_14.1.txt +++ /dev/null @@ -1,45 +0,0 @@ -Last Updated: 10/21/2017 -Credits: https://divestos.xyz/pages/about.html -Recommended Apps: https://divestos.xyz/pages/apps.php - -General Changes - - Builds are dex-preopted on select devices - - Builds are signed with private release-keys - - Bundled in our custom DNS blocklist - - Doze is re-enabled on devices without real Google Play Services - - Enabled GLONASS and improved security of A-GPS downloads on all devices - - Nuked a *ton* of proprietary blobs from orbit - - Rebranded select strings - - Removed boot animation - - Removed CMStats - - Removed unnecessary/outdated/insecure packages. - - Replaced default SMS app with Silence - - Replaced teal accents with orange/yellow ones - - Dialer - - Disabled FLP, PLP, and RLP by default - - F-Droid - - F-Droid and FDroidPrivilegedExtension are included by default - - MicroG - - GmsCore, GsfProxy, and FakeStore are included by default - - Settings - - Added an option to lower screen resolution to (marginally) increase battery life - - Changed default quick tiles - - Disabled "Instant Apps" - - Increased animation speed - - Increased max password length - - Per app performance profiles for 170 apps - - Replaced default profiles with better ones - - Trebuchet - - Changed default settings - -Device Changes - - bacon - - Overclocked from 2.45Ghz to 2.95Ghz (=+2.02Ghz) - - Underclocked from 300Mhz to 268Mhz - - clark - - Changed flashlight gesture to a tri-state one: back, front, off - - osprey - - Overclocked from 1.36Ghz to 1.88Ghz (=+2.07Ghz) - - Overclocked GPU by 255Mhz - - hammerhead - - Overclocked from 2.26Ghz to 2.95Ghz (=+2.75Ghz) diff --git a/Patches/LineageOS-14.1/android_device_motorola_clark/0001-Tri_State_Torch.patch b/Patches/LineageOS-14.1/android_device_motorola_clark/0001-Tri_State_Torch.patch deleted file mode 100644 index ba89b670..00000000 --- a/Patches/LineageOS-14.1/android_device_motorola_clark/0001-Tri_State_Torch.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 1802dfd756eb6d68560c8e2d4659c690e3110e04 Mon Sep 17 00:00:00 2001 -From: Tad -Date: Wed, 4 Oct 2017 20:31:17 -0400 -Subject: [PATCH] Tri-state torch - -Change-Id: Ica35b7e9132de188694cd0f2d22e7bc62aa0415b ---- - .../cyanogenmod/settings/device/TorchAction.java | 33 ++++++++++++++-------- - 1 file changed, 22 insertions(+), 11 deletions(-) - -diff --git a/cmactions/src/com/cyanogenmod/settings/device/TorchAction.java b/cmactions/src/com/cyanogenmod/settings/device/TorchAction.java -index a3bcdce..7a2e107 100755 ---- a/cmactions/src/com/cyanogenmod/settings/device/TorchAction.java -+++ b/cmactions/src/com/cyanogenmod/settings/device/TorchAction.java -@@ -32,7 +32,8 @@ public class TorchAction implements SensorAction { - private final int mVibratorPeriod; - private final Vibrator mVibrator; - private String mRearCameraId; -- private static boolean mTorchEnabled;; -+ private String mFrontCameraId; -+ private static int mTorchState = 0; - - public TorchAction(Context mContext, int vibratorPeriod) { - mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE); -@@ -45,7 +46,8 @@ public class TorchAction implements SensorAction { - int cOrientation = characteristics.get(CameraCharacteristics.LENS_FACING); - if (cOrientation == CameraCharacteristics.LENS_FACING_BACK) { - mRearCameraId = cameraId; -- break; -+ } else if (cOrientation == CameraCharacteristics.LENS_FACING_FRONT){ -+ mFrontCameraId = cameraId; - } - } - } catch (CameraAccessException e) { -@@ -55,10 +57,23 @@ public class TorchAction implements SensorAction { - @Override - public void action() { - mVibrator.vibrate(mVibratorPeriod); -- if (mRearCameraId != null) { -+ if (mRearCameraId != null && mFrontCameraId != null) { - try { -- mCameraManager.setTorchMode(mRearCameraId, !mTorchEnabled); -- mTorchEnabled = !mTorchEnabled; -+ switch(mTorchState) { -+ case 0: -+ mCameraManager.setTorchMode(mRearCameraId, true); -+ mTorchState = 1; -+ break; -+ case 1: -+ mCameraManager.setTorchMode(mRearCameraId, false); -+ mCameraManager.setTorchMode(mFrontCameraId, true); -+ mTorchState = 2; -+ break; -+ case 2: -+ mCameraManager.setTorchMode(mFrontCameraId, false); -+ mTorchState = 0; -+ break; -+ } - } catch (CameraAccessException e) { - } - } -@@ -67,16 +82,12 @@ public class TorchAction implements SensorAction { - private class MyTorchCallback extends CameraManager.TorchCallback { - @Override - public void onTorchModeChanged(String cameraId, boolean enabled) { -- if (!cameraId.equals(mRearCameraId)) -- return; -- mTorchEnabled = enabled; -+ - } - - @Override - public void onTorchModeUnavailable(String cameraId) { -- if (!cameraId.equals(mRearCameraId)) -- return; -- mTorchEnabled = false; -+ mTorchState = 0; - } - } - } --- -2.14.2 - diff --git a/Patches/LineageOS-14.1/android_frameworks_base/0002-Radio.patch b/Patches/LineageOS-14.1/android_frameworks_base/0002-Radio.patch deleted file mode 100644 index f6685cb1..00000000 --- a/Patches/LineageOS-14.1/android_frameworks_base/0002-Radio.patch +++ /dev/null @@ -1,231 +0,0 @@ -From 0eb8f3eb492844954cdbfa44b660cc5a278ebcd5 Mon Sep 17 00:00:00 2001 -From: Tad -Date: Fri, 10 Nov 2017 17:28:06 -0500 -Subject: [PATCH] Add radio power tile (1/2) - -Change-Id: Icec0f52b43d6bf319befa855a2dd753e9c99b98d ---- - packages/SystemUI/res/drawable/ic_qs_radio_off.xml | 10 ++ - packages/SystemUI/res/drawable/ic_qs_radio_on.xml | 10 ++ - packages/SystemUI/res/values/cm_strings.xml | 3 + - packages/SystemUI/res/values/config.xml | 2 +- - .../android/systemui/qs/tiles/RadioPowerTile.java | 127 +++++++++++++++++++++ - .../systemui/statusbar/phone/QSTileHost.java | 2 + - 6 files changed, 153 insertions(+), 1 deletion(-) - create mode 100644 packages/SystemUI/res/drawable/ic_qs_radio_off.xml - create mode 100644 packages/SystemUI/res/drawable/ic_qs_radio_on.xml - create mode 100644 packages/SystemUI/src/com/android/systemui/qs/tiles/RadioPowerTile.java - -diff --git a/packages/SystemUI/res/drawable/ic_qs_radio_off.xml b/packages/SystemUI/res/drawable/ic_qs_radio_off.xml -new file mode 100644 -index 00000000000..1cb49181faa ---- /dev/null -+++ b/packages/SystemUI/res/drawable/ic_qs_radio_off.xml -@@ -0,0 +1,10 @@ -+ -+ -+ -+ -diff --git a/packages/SystemUI/res/drawable/ic_qs_radio_on.xml b/packages/SystemUI/res/drawable/ic_qs_radio_on.xml -new file mode 100644 -index 00000000000..d446debdfc6 ---- /dev/null -+++ b/packages/SystemUI/res/drawable/ic_qs_radio_on.xml -@@ -0,0 +1,10 @@ -+ -+ -+ -+ -diff --git a/packages/SystemUI/res/values/cm_strings.xml b/packages/SystemUI/res/values/cm_strings.xml -index b429946bd93..89e3210a21f 100644 ---- a/packages/SystemUI/res/values/cm_strings.xml -+++ b/packages/SystemUI/res/values/cm_strings.xml -@@ -230,4 +230,7 @@ - Prevent %1$s from being dismissed - - Allow %1$s to be dismissed -+ -+ -+ Radio power - -diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml -index 47aacddfbd3..fe98a33d00c 100644 ---- a/packages/SystemUI/res/values/config.xml -+++ b/packages/SystemUI/res/values/config.xml -@@ -105,7 +105,7 @@ - - - -- wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,work,cast,night,adb_network,ambient_display,caffeine,heads_up,sync,usb_tether,volume_panel,profiles -+ wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,work,cast,night,adb_network,ambient_display,caffeine,heads_up,sync,usb_tether,volume_panel,profiles,radio_power - - - -diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RadioPowerTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RadioPowerTile.java -new file mode 100644 -index 00000000000..b907205025c ---- /dev/null -+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RadioPowerTile.java -@@ -0,0 +1,127 @@ -+/* -+ * Copyright (C) 2015 The CyanogenMod Project -+ * Copyright (C) 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. -+ * 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.BroadcastReceiver; -+import android.content.Context; -+import android.content.Intent; -+import android.content.IntentFilter; -+import android.database.ContentObserver; -+import android.os.UserHandle; -+import android.provider.Settings; -+ -+import com.android.internal.logging.MetricsLogger; -+import com.android.internal.logging.MetricsProto.MetricsEvent; -+import com.android.internal.telephony.Phone; -+import com.android.internal.telephony.PhoneFactory; -+ -+import com.android.systemui.R; -+import com.android.systemui.qs.QSTile; -+ -+import android.telephony.ServiceState; -+ -+ -+/** Quick settings tile: RadioPower **/ -+public class RadioPowerTile extends QSTile { -+ -+ private boolean mListening; -+ -+ public RadioPowerTile(Host host) { -+ super(host); -+ } -+ -+ @Override -+ public boolean isAvailable() { -+ return PhoneFactory.getDefaultPhone() != null; -+ } -+ -+ @Override -+ public BooleanState newTileState() { -+ return new BooleanState(); -+ } -+ -+ @Override -+ protected void handleClick() { -+ refreshState(!getRadioState()); -+ } -+ -+ @Override -+ public Intent getLongClickIntent() { -+ return new Intent().setClassName("com.android.settings", "com.android.settings.RadioInfo"); -+ } -+ -+ @Override -+ protected void handleLongClick() { -+ mHost.startActivityDismissingKeyguard(getLongClickIntent()); -+ } -+ -+ @Override -+ protected void handleUpdateState(BooleanState state, Object arg) { -+ state.visible = true; -+ final boolean radioPower = arg instanceof Boolean ? (boolean) arg : getRadioState(); -+ state.value = radioPower; -+ state.label = mContext.getString(R.string.quick_settings_radio_power_label); -+ if(state.value) { -+ state.icon = ResourceIcon.get(R.drawable.ic_qs_radio_on); -+ } else { -+ state.icon = ResourceIcon.get(R.drawable.ic_qs_radio_off); -+ } -+ } -+ -+ @Override -+ public CharSequence getTileLabel() { -+ return mContext.getString(R.string.quick_settings_radio_power_label); -+ } -+ -+ @Override -+ public int getMetricsCategory() { -+ return MetricsEvent.QS_AIRPLANEMODE; -+ } -+ -+ private boolean getRadioState() { -+ final Phone phone = PhoneFactory.getDefaultPhone(); -+ return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF; -+ } -+ -+ private void setRadioState(boolean enabled) { -+ final Phone phone = PhoneFactory.getDefaultPhone(); -+ phone.setRadioPower(enabled); -+ } -+ -+ public void setListening(boolean listening) { -+ if (mListening == listening) return; -+ mListening = listening; -+ if (listening) { -+ final IntentFilter filter = new IntentFilter(); -+ filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); -+ mContext.registerReceiver(mReceiver, filter); -+ } else { -+ mContext.unregisterReceiver(mReceiver); -+ } -+ } -+ -+ private final BroadcastReceiver mReceiver = new BroadcastReceiver() { -+ @Override -+ public void onReceive(Context context, Intent intent) { -+ if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(intent.getAction())) { -+ refreshState(); -+ } -+ } -+ }; -+ -+} -diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java -index 7f8ef210b52..ac7fa6ab96c 100755 ---- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java -+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java -@@ -59,6 +59,7 @@ import com.android.systemui.qs.tiles.IntentTile; - import com.android.systemui.qs.tiles.LocationTile; - import com.android.systemui.qs.tiles.NfcTile; - import com.android.systemui.qs.tiles.NightDisplayTile; -+import com.android.systemui.qs.tiles.RadioPowerTile; - import com.android.systemui.qs.tiles.RotationLockTile; - import com.android.systemui.qs.tiles.SyncTile; - import com.android.systemui.qs.tiles.UsbTetherTile; -@@ -441,6 +442,7 @@ public class QSTileHost implements QSTile.Host, Tunable { - else if (tileSpec.equals("dnd")) return new DndTile(this); - else if (tileSpec.equals("inversion")) return new ColorInversionTile(this); - else if (tileSpec.equals("airplane")) return new AirplaneModeTile(this); -+ else if (tileSpec.equals("radio_power")) return new RadioPowerTile(this); - else if (tileSpec.equals("work")) return new WorkModeTile(this); - else if (tileSpec.equals("rotation")) return new RotationLockTile(this); - else if (tileSpec.equals("flashlight")) return new FlashlightTile(this); --- -2.15.0 - diff --git a/Patches/LineageOS-14.1/cm_platform_sdk/0001-Radio.patch b/Patches/LineageOS-14.1/cm_platform_sdk/0001-Radio.patch deleted file mode 100644 index 181e1413..00000000 --- a/Patches/LineageOS-14.1/cm_platform_sdk/0001-Radio.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d69062c3f395613090ae902e43622af312036515 Mon Sep 17 00:00:00 2001 -From: Tad -Date: Fri, 10 Nov 2017 12:50:12 -0500 -Subject: [PATCH] Add radio power tile (2/2) - -Change-Id: I97745fc43ff6af599d7d30a6fd7db9b2942b3247 ---- - sdk/src/java/org/cyanogenmod/internal/util/QSConstants.java | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/sdk/src/java/org/cyanogenmod/internal/util/QSConstants.java b/sdk/src/java/org/cyanogenmod/internal/util/QSConstants.java -index c5e62eb..8782128 100644 ---- a/sdk/src/java/org/cyanogenmod/internal/util/QSConstants.java -+++ b/sdk/src/java/org/cyanogenmod/internal/util/QSConstants.java -@@ -26,6 +26,7 @@ public class QSConstants { - public static final String TILE_INVERSION = "inversion"; - public static final String TILE_CELLULAR = "cell"; - public static final String TILE_AIRPLANE = "airplane"; -+ public static final String TILE_RADIO_POWER = "radio_power"; - public static final String TILE_ROTATION = "rotation"; - public static final String TILE_FLASHLIGHT = "flashlight"; - public static final String TILE_LOCATION = "location"; -@@ -71,6 +72,7 @@ public class QSConstants { - STATIC_TILES_AVAILABLE.add(TILE_BLUETOOTH); - STATIC_TILES_AVAILABLE.add(TILE_CELLULAR); - STATIC_TILES_AVAILABLE.add(TILE_AIRPLANE); -+ STATIC_TILES_AVAILABLE.add(TILE_RADIO_POWER); - STATIC_TILES_AVAILABLE.add(TILE_ROTATION); - STATIC_TILES_AVAILABLE.add(TILE_FLASHLIGHT); - STATIC_TILES_AVAILABLE.add(TILE_LOCATION); --- -2.15.0 - diff --git a/Scripts/LineageOS-14.1/Patch.sh b/Scripts/LineageOS-14.1/Patch.sh index 760d3013..21b228cf 100755 --- a/Scripts/LineageOS-14.1/Patch.sh +++ b/Scripts/LineageOS-14.1/Patch.sh @@ -80,7 +80,6 @@ sed -i 's/com.android.messaging/org.smssecure.smssecure/' core/res/res/values/co sed -i 's|db_default_journal_mode" translateble="false">PERSIST|db_default_journal_mode" translateble="false">TRUNCATE|' core/res/res/values/config.xml; #Mirror SQLite secure_delete sed -i 's|config_permissionReviewRequired">false|config_permissionReviewRequired">true|' core/res/res/values/config.xml; patch -p1 < $patches"android_frameworks_base/0001-Reduced_Resolution.patch" #Allow reducing resolution to save power TODO: Add 800x480 -#patch -p1 < $patches"android_frameworks_base/0002-Radio.patch" #Add a QS tile to control radio power #TODO: Breaks cell and SystemUI patch -p1 < $patches"android_frameworks_base/0003-Signature_Spoofing.patch" #Allow packages to spoof their signature (MicroG) patch -p1 < $patches"android_frameworks_base/0005-Harden_Sig_Spoofing.patch" #Restrict signature spoofing to system apps signed with the platform key patch -p1 < $patches"android_frameworks_base/0006-OpenNIC.patch" #Change fallback and tethering DNS servers to OpenNIC AnyCast @@ -184,7 +183,6 @@ sed -i 's/messaging/Silence/' config/telephony.mk; #Replace AOSP Messaging app w enterAndClear "vendor/cmsdk" awk -i inplace '!/WeatherManagerServiceBroker/' cm/res/res/values/config.xml; #Disable Weather cp $patches"cm_platform_sdk/profile_default.xml" cm/res/res/xml/profile_default.xml; #Replace default profiles with *way* better ones -#patch -p1 < $patches"cm_platform_sdk/0001-Radio.patch" #Add a QS tile to control radio power sed -i 's/shouldUseOptimizations(weight)/true/' cm/lib/main/java/org/cyanogenmod/platform/internal/PerformanceManagerService.java; #Per app performance profiles fix # #END OF ROM CHANGES