Small changes

- 16.0: drop wallpaper optimization patch, questionable source
- deblobber: don't remove libmmparser_lite.so, potentially used by camera
- 17.1: pick Q_asb_2021-12, excluding a broken patch
- clark 17.1: some camera denial fixes
- alioth: unmark broken
- 17.1: switch to upstream glibc fix
- 17.1/18.1: disable per app sensors permission patchset, potential camera issues

Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
Tad 2021-12-13 00:10:50 -05:00
parent 8b85bf9719
commit 20e1023627
10 changed files with 18 additions and 122 deletions

View File

@ -1,101 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DJAB HipHop <mweb71@yahoo.com>
Date: Wed, 26 May 2021 20:19:17 +0200
Subject: [PATCH] Backgrounds: Optimize builtin wallpaper loading code
Test in 16.0 by adding extra 4k paper wallpaper I took with my iPhone 11 pro max & opening the app
Change-Id: Ic3901bda473aaa9872baeb8a89958eb1339113fa
Signed-off-by: DJAB HipHop <mweb71@yahoo.com>
---
.../factory/BuiltInWallpaperFactory.java | 7 +++-
.../lineageos/backgrounds/util/UiUtils.java | 40 +++++++++++++++++++
2 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/org/lineageos/backgrounds/factory/BuiltInWallpaperFactory.java b/app/src/main/java/org/lineageos/backgrounds/factory/BuiltInWallpaperFactory.java
index 7508d3c..264fa6b 100644
--- a/app/src/main/java/org/lineageos/backgrounds/factory/BuiltInWallpaperFactory.java
+++ b/app/src/main/java/org/lineageos/backgrounds/factory/BuiltInWallpaperFactory.java
@@ -18,6 +18,7 @@ package org.lineageos.backgrounds.factory;
import android.app.WallpaperManager;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.BitmapDrawable;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
@@ -25,6 +26,7 @@ import androidx.annotation.NonNull;
import org.lineageos.backgrounds.R;
import org.lineageos.backgrounds.bundle.WallpaperBundle;
import org.lineageos.backgrounds.bundle.WallpaperType;
+import org.lineageos.backgrounds.util.UiUtils;
public final class BuiltInWallpaperFactory {
@@ -33,8 +35,9 @@ public final class BuiltInWallpaperFactory {
public static WallpaperBundle build(@NonNull final String name,
@NonNull final Resources res,
- @DrawableRes final int drawableRes) {
- Drawable drawable = res.getDrawable(drawableRes, res.newTheme());
+ @DrawableRes final int drawableRes) {
+ Drawable drawable = new BitmapDrawable(res, UiUtils.decodeSampledBitmapFromResource(res, drawableRes, 250, 500));
+
return new WallpaperBundle(name, drawable, drawableRes, WallpaperType.BUILT_IN);
}
diff --git a/app/src/main/java/org/lineageos/backgrounds/util/UiUtils.java b/app/src/main/java/org/lineageos/backgrounds/util/UiUtils.java
index 2d5b798..b0de83b 100644
--- a/app/src/main/java/org/lineageos/backgrounds/util/UiUtils.java
+++ b/app/src/main/java/org/lineageos/backgrounds/util/UiUtils.java
@@ -17,6 +17,9 @@ package org.lineageos.backgrounds.util;
import android.view.View;
import android.view.Window;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
@@ -38,4 +41,41 @@ public final class UiUtils {
window.getDecorView().setSystemUiVisibility(flags);
}
+
+ public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
+ // Raw height and width of image
+ final int height = options.outHeight;
+ final int width = options.outWidth;
+ int inSampleSize = 1;
+
+ if (height > reqHeight || width > reqWidth) {
+
+ final int halfHeight = height / 2;
+ final int halfWidth = width / 2;
+
+ // Calculate the largest inSampleSize value that is a power of 2 and keeps both
+ // height and width larger than the requested height and width.
+ while ((halfHeight / inSampleSize) >= reqHeight
+ && (halfWidth / inSampleSize) >= reqWidth) {
+ inSampleSize *= 2;
+ }
+ }
+
+ return inSampleSize;
+ }
+
+ public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, int reqWidth, int reqHeight) {
+
+ // First decode with inJustDecodeBounds=true to check dimensions
+ final BitmapFactory.Options options = new BitmapFactory.Options();
+ options.inJustDecodeBounds = true;
+ BitmapFactory.decodeResource(res, resId, options);
+
+ // Calculate inSampleSize
+ options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);
+
+ // Decode bitmap with inSampleSize set
+ options.inJustDecodeBounds = false;
+ return BitmapFactory.decodeResource(res, resId, options);
+ }
}

View File

@ -11,10 +11,10 @@ Change-Id: Ic1dce1c0fffc3c3f6459c4c85e0a64d480d3315a
2 files changed, 53 deletions(-)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e4378d6b93..89fc7973a7 100644
index c7c55d381e..fd6f4178bd 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3079,17 +3079,6 @@
@@ -3080,17 +3080,6 @@
</intent-filter>
</service>

View File

@ -56,10 +56,10 @@ index 34f2fd3..e2a3e09 100644
<string name="snack_update_not_installable">This update can\'t be installed on top of the current build.</string>
diff --git a/src/org/lineageos/updater/UpdatesActivity.java b/src/org/lineageos/updater/UpdatesActivity.java
index ad001c8..4bebc17 100644
index fec31ee..494c245 100644
--- a/src/org/lineageos/updater/UpdatesActivity.java
+++ b/src/org/lineageos/updater/UpdatesActivity.java
@@ -343,10 +343,14 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -369,10 +369,14 @@ public class UpdatesActivity extends UpdatesListActivity {
final DownloadClient downloadClient;
try {
@ -74,7 +74,7 @@ index ad001c8..4bebc17 100644
.build();
} catch (IOException exception) {
Log.e(TAG, "Could not build download client");
@@ -411,6 +415,7 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -452,6 +456,7 @@ public class UpdatesActivity extends UpdatesListActivity {
View view = LayoutInflater.from(this).inflate(R.layout.preferences_dialog, null);
Spinner autoCheckInterval =
view.findViewById(R.id.preferences_auto_updates_check_interval);
@ -82,7 +82,7 @@ index ad001c8..4bebc17 100644
Switch autoDelete = view.findViewById(R.id.preferences_auto_delete_updates);
Switch dataWarning = view.findViewById(R.id.preferences_mobile_data_warning);
Switch abPerfMode = view.findViewById(R.id.preferences_ab_perf_mode);
@@ -421,6 +426,7 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -462,6 +467,7 @@ public class UpdatesActivity extends UpdatesListActivity {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
autoCheckInterval.setSelection(Utils.getUpdateCheckSetting(this));
@ -90,7 +90,7 @@ index ad001c8..4bebc17 100644
autoDelete.setChecked(prefs.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, false));
dataWarning.setChecked(prefs.getBoolean(Constants.PREF_MOBILE_DATA_WARNING, true));
abPerfMode.setChecked(prefs.getBoolean(Constants.PREF_AB_PERF_MODE, false));
@@ -432,6 +438,8 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -473,6 +479,8 @@ public class UpdatesActivity extends UpdatesListActivity {
prefs.edit()
.putInt(Constants.PREF_AUTO_UPDATES_CHECK_INTERVAL,
autoCheckInterval.getSelectedItemPosition())
@ -99,7 +99,7 @@ index ad001c8..4bebc17 100644
.putBoolean(Constants.PREF_AUTO_DELETE_UPDATES,
autoDelete.isChecked())
.putBoolean(Constants.PREF_MOBILE_DATA_WARNING,
@@ -447,6 +455,10 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -488,6 +496,10 @@ public class UpdatesActivity extends UpdatesListActivity {
UpdatesCheckReceiver.cancelUpdatesCheck(this);
}

@ -1 +1 @@
Subproject commit 3abddc8ba932d3a438155fdb6242cf7952b69924
Subproject commit 073130ec254154e2f5d983ce582c257a0ac1c70d

View File

@ -534,7 +534,7 @@ echo "Deblobbing...";
#Wfd (Wireless Display) [Qualcomm]
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wfd-commonsys/ [useless]
blobs=$blobs"|libmmparser_lite.so|libmmrtpdecoder.so|libmmrtpencoder.so|libmmwfdinterface.so|libmmwfdsinkinterface.so|libmmwfdsrcinterface.so|libwfdavenhancements.so|libwfdclient.so|libwfdcodecv4l2_proprietary.so|libwfdcodecv4l2.so|libwfdcommonutils_proprietary.so|libwfdcommonutils.so|libwfdconfigutils_proprietary.so|libwfdconfigutils.so|libwfddisplayconfig_proprietary.so|libwfddisplayconfig.so|libwfdhaldsmanager.so|libwfdhdcpcp.so|libwfdhdcpservice_proprietary.so|libwfdmminterface_proprietary.so|libwfdmminterface.so|libwfdmmservice_proprietary.so|libwfdmmservice.so|libwfdmmsink.so|libwfdmmsrc_proprietary.so|libwfdmmsrc.so|libwfdmmsrc_system.so|libwfdmmutils.so|libwfdmodulehdcpsession.so|libwfdnative.so|libwfdrtsp_proprietary.so|libwfdrtsp.so|libwfdservice.so|libwfdsessionmodule.so|libwfdsinksm.so|libwfdsm.so|libwfdsourcesession_proprietary.so|libwfdsourcesm_proprietary.so|libwfduibcinterface_proprietary.so|libwfduibcinterface.so|libwfduibcsinkinterface_proprietary.so|libwfduibcsinkinterface.so|libwfduibcsink_proprietary.so|libwfduibcsink.so|libwfduibcsrcinterface_proprietary.so|libwfduibcsrcinterface.so|libwfduibcsrc_proprietary.so|libwfduibcsrc.so|libwfdutils_proprietary.so|libwfdaac.so";
blobs=$blobs"|libmmrtpdecoder.so|libmmrtpencoder.so|libmmwfdinterface.so|libmmwfdsinkinterface.so|libmmwfdsrcinterface.so|libwfdavenhancements.so|libwfdclient.so|libwfdcodecv4l2_proprietary.so|libwfdcodecv4l2.so|libwfdcommonutils_proprietary.so|libwfdcommonutils.so|libwfdconfigutils_proprietary.so|libwfdconfigutils.so|libwfddisplayconfig_proprietary.so|libwfddisplayconfig.so|libwfdhaldsmanager.so|libwfdhdcpcp.so|libwfdhdcpservice_proprietary.so|libwfdmminterface_proprietary.so|libwfdmminterface.so|libwfdmmservice_proprietary.so|libwfdmmservice.so|libwfdmmsink.so|libwfdmmsrc_proprietary.so|libwfdmmsrc.so|libwfdmmsrc_system.so|libwfdmmutils.so|libwfdmodulehdcpsession.so|libwfdnative.so|libwfdrtsp_proprietary.so|libwfdrtsp.so|libwfdservice.so|libwfdsessionmodule.so|libwfdsinksm.so|libwfdsm.so|libwfdsourcesession_proprietary.so|libwfdsourcesm_proprietary.so|libwfduibcinterface_proprietary.so|libwfduibcinterface.so|libwfduibcsinkinterface_proprietary.so|libwfduibcsinkinterface.so|libwfduibcsink_proprietary.so|libwfduibcsink.so|libwfduibcsrcinterface_proprietary.so|libwfduibcsrcinterface.so|libwfduibcsrc_proprietary.so|libwfduibcsrc.so|libwfdutils_proprietary.so|libwfdaac.so";
blobs=$blobs"|wfdservice|wifidisplayhalservice|wfdhdcphalservice|wfdvndservice";
blobs=$blobs"|WfdService.apk";
blobs=$blobs"|WfdCommon.jar";

View File

@ -185,10 +185,6 @@ awk -i inplace '!/LineageWeatherManagerService/' lineage/res/res/values/config.x
if [ "$DOS_DEBLOBBER_REMOVE_AUDIOFX" = true ]; then awk -i inplace '!/LineageAudioService/' lineage/res/res/values/config.xml; fi; #Remove AudioFX
fi;
if enterAndClear "packages/apps/Backgrounds"; then
applyPatch "$DOS_PATCHES/android_packages_apps_Backgrounds/308977.patch"; #Optimize builtin wallpaper loading code
fi;
if enterAndClear "packages/apps/Contacts"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Links.patch"; #Remove Privacy Policy and Terms of Service links (GrapheneOS)
fi;

View File

@ -99,7 +99,8 @@ patchWorkspace() {
source build/envsetup.sh;
#repopick -it ten-firewall;
repopick -it Q_asb_2021-12;
#repopick -i 318916; #Fix kernel build with glibc 2.34
repopick -it Q_asb_2021-12 -e 320289;
sh "$DOS_SCRIPTS/Patch.sh";
sh "$DOS_SCRIPTS_COMMON/Enable_Verity.sh";

View File

@ -283,9 +283,6 @@ if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/LINEAGE_BUILDTYP
echo 'include vendor/divested/divestos.mk' >> config/common.mk; #Include our customizations
cp -f "$DOS_PATCHES_COMMON/apns-conf.xml" prebuilt/common/etc/apns-conf.xml; #Update APN list
sed -i 's/messaging/Silence/' config/telephony.mk; #Replace the Messaging app with Silence
if [ "$DOS_HOST_GLIBC2_34" = true ]; then
awk -i inplace '!/x86_64-linux-gnu/' config/BoardConfigKernel.mk; #fix compile with glibc 2.34, 318916
fi;
fi;
if enter "vendor/divested"; then
@ -319,6 +316,10 @@ awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfigCommon.mk; #broken
fi;
if enterAndClear "device/motorola/clark"; then
echo "allow mm-qcamerad camera_prop:property_service set;" >> sepolicy/mm-qcamerad.te;
echo "allow mm-qcamerad property_socket:sock_file write;" >> sepolicy/mm-qcamerad.te;
echo "allow mm-qcamerad camera_prop:file read;" >> sepolicy/mm-qcamerad.te;
echo "set_prop(mm-qcamerad, camera_prop)" >> sepolicy/mm-qcamerad.te;
echo "recovery_only(\`" >> sepolicy/recovery.te; #304224: Allow recovery to unzip and chmod modem firmware
echo " allow firmware_file labeledfs:filesystem associate;" >> sepolicy/recovery.te;
echo " allow recovery firmware_file:dir rw_dir_perms;" >> sepolicy/recovery.te;

View File

@ -117,7 +117,7 @@ buildAll() {
#SD865
buildDevice lmi avb;
#SD870
buildDevice alioth avb; #error: Sum of sizes in qti_dynamic_partitions_partition_list is 4561391616, which is greater than qti_dynamic_partitions_size (4559208448)
buildDevice alioth avb;
#SD670
buildDevice bonito avb; #error: ln: cannot create symbolic link from '/data/vendor/rfs/mpss' to 'out/target/product/bonito/vendor/rfs/msm/mpss//readwrite':
buildDevice sargo avb;

View File

@ -37,7 +37,6 @@ export DOS_TOR_WRAPPER="";
export DOS_MALWARE_SCAN_ENABLED=true; #Set true to perform a fast scan on patchWorkspace() and a through scan on buildAll()
export DOS_MALWARE_SCAN_SETTING="quick"; #buildAll() scan speed. Options: quick, extra, slow, full
export DOS_REFRESH_PATCHES=true; #Set true to refresh branch-specific patches on apply
export DOS_HOST_GLIBC2_34=true; #Set true to enable a glibc 2.34+ workaround XXX: hard-coded to Fedora 35 paths
#Deblobber
export DOS_DEBLOBBER_REMOVE_ACCESSORIES=true; #Set false to allow use of external accessories that depend on blobs
@ -67,7 +66,7 @@ export DOS_MICROG_INCLUDED="NLP"; #Determines inclusion of microG. Options: NLP,
export DOS_NON_COMMERCIAL_USE_PATCHES=false; #Set true to allow inclusion of non-commercial use patches XXX: Unused, see 1dc9247
export DOS_OPTIMIZE_IMAGES=false; #Set true to apply lossless optimizations to image resources
export DOS_SENSORS_PERM=false; #Set true to provide a per-app sensors permission #XXX: can break things like camera
export DOS_SENSORS_PERM_NEW=true;
export DOS_SENSORS_PERM_NEW=false;
export DOS_STRONG_ENCRYPTION_ENABLED=false; #Set true to enable AES 256-bit FDE encryption on 14.1+15.1 XXX: THIS WILL **DESTROY** EXISTING INSTALLS!
export DOS_WEBVIEW_LFS=true; #Whether to `git lfs pull` in the WebView repository
#alias DOS_WEBVIEW_CHERRYPICK='git pull "https://github.com/LineageOS/android_external_chromium-webview" refs/changes/00/316600/2';