Initial unified commit for Android 11, syncing up to v311

This commit is contained in:
Andy CrossGate Yan 2021-08-08 02:20:00 +00:00
commit 01693449b8
191 changed files with 23879 additions and 0 deletions

View File

@ -0,0 +1,133 @@
From f63609cfc0fcc6a488ba7d024a1b1e3853637b09 Mon Sep 17 00:00:00 2001
From: jhenrique09 <jhenrique09.mcz@hotmail.com>
Date: Sun, 29 Mar 2020 17:38:39 -0300
Subject: [PATCH] fwb: Start device specific popup camera service conditionally
Change-Id: I07f97fe58495ef666fa317d14fa1334389015e11
---
.../custom/popupcamera/PopUpCameraUtils.java | 20 +++++++++++++++++++
core/res/res/values/lineage_config.xml | 3 +++
core/res/res/values/lineage_symbols.xml | 3 +++
.../server/camera/CameraServiceProxy.java | 20 +++++++++++++++++++
4 files changed, 46 insertions(+)
create mode 100644 core/java/com/android/internal/util/custom/popupcamera/PopUpCameraUtils.java
diff --git a/core/java/com/android/internal/util/custom/popupcamera/PopUpCameraUtils.java b/core/java/com/android/internal/util/custom/popupcamera/PopUpCameraUtils.java
new file mode 100644
index 00000000000..f7988608141
--- /dev/null
+++ b/core/java/com/android/internal/util/custom/popupcamera/PopUpCameraUtils.java
@@ -0,0 +1,20 @@
+/*
+* Copyright (C) 2019 The Pixel Experience 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.internal.util.custom.popupcamera;
+
+public class PopUpCameraUtils {
+ public static String MANAGE_POPUP_CAMERA_SERVICE_PERMISSION = "org.pixelexperience.device.MANAGE_POPUP_CAMERA_SERVICE";
+}
diff --git a/core/res/res/values/lineage_config.xml b/core/res/res/values/lineage_config.xml
index 4b090379f5a..3315de74147 100644
--- a/core/res/res/values/lineage_config.xml
+++ b/core/res/res/values/lineage_config.xml
@@ -34,4 +34,7 @@
<!-- The list of components which should be forced to be enabled. -->
<string-array name="config_forceEnabledComponents" translatable="false">
</string-array>
+
+ <!-- Component name of popup camera service -->
+ <string name="config_popUpCameraServiceComponentName" translatable="false"></string>
</resources>
diff --git a/core/res/res/values/lineage_symbols.xml b/core/res/res/values/lineage_symbols.xml
index 155da4479fb..c7e58b3943f 100644
--- a/core/res/res/values/lineage_symbols.xml
+++ b/core/res/res/values/lineage_symbols.xml
@@ -25,4 +25,7 @@
<java-symbol type="array" name="config_deviceDisabledComponents" />
<java-symbol type="array" name="config_globallyDisabledComponents" />
<java-symbol type="array" name="config_forceEnabledComponents" />
+
+ <!-- Component name of popup camera service -->
+ <java-symbol type="string" name="config_popUpCameraServiceComponentName" />
</resources>
diff --git a/services/core/java/com/android/server/camera/CameraServiceProxy.java b/services/core/java/com/android/server/camera/CameraServiceProxy.java
index 5f7a72c8512..9e72fa09993 100644
--- a/services/core/java/com/android/server/camera/CameraServiceProxy.java
+++ b/services/core/java/com/android/server/camera/CameraServiceProxy.java
@@ -16,6 +16,7 @@
package com.android.server.camera;
import android.content.BroadcastReceiver;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -32,6 +33,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
+import android.os.UserHandle;
import android.os.UserManager;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -53,6 +55,8 @@ import java.util.Set;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import com.android.internal.util.custom.popupcamera.PopUpCameraUtils;
+
/**
* CameraServiceProxy is the system_server analog to the camera service running in cameraserver.
*
@@ -106,6 +110,8 @@ public class CameraServiceProxy extends SystemService
private final boolean mNotifyNfc;
private final boolean mAllowMediaUid;
+ private final String mPopUpCameraServiceComponentName;
+
private ScheduledThreadPoolExecutor mLogWriterService = new ScheduledThreadPoolExecutor(
/*corePoolSize*/ 1);
@@ -218,6 +224,8 @@ public class CameraServiceProxy extends SystemService
// Don't keep any extra logging threads if not needed
mLogWriterService.setKeepAliveTime(1, TimeUnit.SECONDS);
mLogWriterService.allowCoreThreadTimeOut(true);
+ mPopUpCameraServiceComponentName = mContext.getResources().getString(
+ com.android.internal.R.string.config_popUpCameraServiceComponentName);
}
@Override
@@ -338,6 +346,18 @@ public class CameraServiceProxy extends SystemService
}
}
+ @Override
+ public void onBootPhase(int phase) {
+ if (phase == PHASE_BOOT_COMPLETED &&
+ !mPopUpCameraServiceComponentName.equals("")) {
+ String perm = PopUpCameraUtils.MANAGE_POPUP_CAMERA_SERVICE_PERMISSION;
+ mContext.enforceCallingOrSelfPermission(perm, "Missing or invalid popup camera service permission: " + perm);
+ Intent i = new Intent();
+ i.setComponent(ComponentName.unflattenFromString(mPopUpCameraServiceComponentName));
+ mContext.startServiceAsUser(i, UserHandle.SYSTEM);
+ }
+ }
+
/**
* Dump camera usage events to log.
* Package-private
--
2.25.1

View File

@ -0,0 +1,69 @@
From 9b7fb863d5b8ed266574f5bbd73dd896f8534f89 Mon Sep 17 00:00:00 2001
From: XiNGRZ <chenxingyu92@gmail.com>
Date: Thu, 13 Feb 2020 20:19:22 +0800
Subject: [PATCH] build: Add support of generating kernel includes for prebuilt
kernels
For prebuilt kernels, point TARGET_KERNEL_HEADER_SOURCE to the dummy
kernel source used to generate headers for HALs.
Change-Id: I8dbbe3760230ae32f4252e99d1c777a029046d39
---
build/soong/Android.bp | 4 ++--
config/BoardConfigKernel.mk | 4 ++++
config/BoardConfigSoong.mk | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/build/soong/Android.bp b/build/soong/Android.bp
index ee68c11e..03006e44 100644
--- a/build/soong/Android.bp
+++ b/build/soong/Android.bp
@@ -21,7 +21,7 @@ lineage_generator {
name: "generated_kernel_includes",
// The headers make command
- cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_SOURCE) O=$(KERNEL_BUILD_OUT_PREFIX)$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install",
+ cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_HEADER_SOURCE) O=$(KERNEL_BUILD_OUT_PREFIX)$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install",
// Directories that can be imported by a cc_* module generated_headers property
export_include_dirs: [
@@ -32,7 +32,7 @@ lineage_generator {
],
// Sources for dependency tracking
- dep_root: "$(TARGET_KERNEL_SOURCE)",
+ dep_root: "$(TARGET_KERNEL_HEADER_SOURCE)",
dep_files: [
"Makefile",
"include/**/*",
diff --git a/config/BoardConfigKernel.mk b/config/BoardConfigKernel.mk
index 8479369a..508927fd 100644
--- a/config/BoardConfigKernel.mk
+++ b/config/BoardConfigKernel.mk
@@ -52,6 +52,10 @@ else
KERNEL_ARCH := $(TARGET_KERNEL_ARCH)
endif
+ifneq ($(TARGET_KERNEL_SOURCE),)
+TARGET_KERNEL_HEADER_SOURCE := $(TARGET_KERNEL_SOURCE)
+endif
+
CLANG_PREBUILTS := $(BUILD_TOP)/prebuilts/clang/host/$(HOST_PREBUILT_TAG)/clang-r383902b
GCC_PREBUILTS := $(BUILD_TOP)/prebuilts/gcc/$(HOST_PREBUILT_TAG)
# arm64 toolchain
diff --git a/config/BoardConfigSoong.mk b/config/BoardConfigSoong.mk
index c0b01674..aacc8c56 100644
--- a/config/BoardConfigSoong.mk
+++ b/config/BoardConfigSoong.mk
@@ -9,7 +9,7 @@ EXPORT_TO_SOONG := \
KERNEL_MAKE_FLAGS \
PATH_OVERRIDE_SOONG \
TARGET_KERNEL_CONFIG \
- TARGET_KERNEL_SOURCE
+ TARGET_KERNEL_HEADER_SOURCE
# Setup SOONG_CONFIG_* vars to export the vars listed above.
# Documentation here:
--
2.25.1

View File

@ -0,0 +1,28 @@
From 381142e1299600d7b16c77c57207732dd06536fc Mon Sep 17 00:00:00 2001
From: Alexander Koskovich <zvnexus@outlook.com>
Date: Sat, 3 Oct 2020 14:28:35 -0700
Subject: [PATCH] Make broken copy headers the default.
* Do not take this for S unless needed, this is a hack
for this cycle.
Change-Id: I55c8897d7d4d5c2a9e62b1a931b3856b2e38956e
---
core/board_config.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/core/board_config.mk b/core/board_config.mk
index 86162b6f3..d152bdff6 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -113,6 +113,7 @@ endif
# ###############################################################
$(foreach v,$(_build_broken_var_list),$(eval $(v) :=))
BUILD_BROKEN_NINJA_USES_ENV_VARS :=
+BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true
# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
# or under vendor/*/$(TARGET_DEVICE). Search in both places, but
--
2.25.1

View File

@ -0,0 +1,63 @@
From 0353d82691df67c3497cc0df021d8a0850b6cfec Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 6 Oct 2020 01:41:16 +0000
Subject: [PATCH 1/3] UI: Revive navbar layout tuning via sysui_nav_bar tunable
Google keeps fixing what ain't broken.
This partially undoes https://github.com/LineageOS/android_frameworks_base/commit/e0d5ccd331e694afdc3c8462a1b845df329de2b8 and https://github.com/LineageOS/android_frameworks_base/commit/d34b4e8d278386b85a00018c502bd21d00f8813b
Change-Id: Ied7d7859e50fd0fcc346219964e747c5d5f4c352
---
.../statusbar/phone/NavigationBarInflaterView.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
index 047cb702c55..e4b3395f57a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
@@ -108,6 +108,7 @@ public class NavigationBarInflaterView extends FrameLayout
private boolean mIsVertical;
private boolean mAlternativeOrder;
+ private boolean mUsingCustomLayout;
private OverviewProxyService mOverviewProxyService;
private int mNavBarMode = NAV_BAR_MODE_3BUTTON;
@@ -173,6 +174,7 @@ public class NavigationBarInflaterView extends FrameLayout
super.onAttachedToWindow();
Dependency.get(TunerService.class).addTunable(this, NAV_BAR_INVERSE);
Dependency.get(TunerService.class).addTunable(this, KEY_NAVIGATION_HINT);
+ Dependency.get(TunerService.class).addTunable(this, NAV_BAR_VIEWS);
}
@Override
@@ -191,6 +193,8 @@ public class NavigationBarInflaterView extends FrameLayout
mIsHintEnabled = TunerService.parseIntegerSwitch(newValue, true);
updateHint();
onLikelyDefaultLayoutChange();
+ } else if (NAV_BAR_VIEWS.equals(key)) {
+ setNavigationBarLayout(newValue);
}
}
@@ -200,7 +204,17 @@ public class NavigationBarInflaterView extends FrameLayout
updateLayoutInversion();
}
+ public void setNavigationBarLayout(String layoutValue) {
+ if (!Objects.equals(mCurrentLayout, layoutValue)) {
+ mUsingCustomLayout = layoutValue != null;
+ clearViews();
+ inflateLayout(layoutValue);
+ }
+ }
+
public void onLikelyDefaultLayoutChange() {
+ // Don't override custom layouts
+ if (mUsingCustomLayout) return;
// Reevaluate new layout
final String newValue = getDefaultLayout();
--
2.25.1

View File

@ -0,0 +1,28 @@
From 6fdadb36add6aa2f8c6c3d25c4ff8135278a9919 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 10 Jan 2021 11:44:29 +0000
Subject: [PATCH 2/3] UI: Disable wallpaper zoom
It does little more than inducing motion sickness
Change-Id: I78cc5484930b27f172cd8d8a5bd9042dce3478d0
---
core/res/res/values/config.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 51b461e7949..f761d28e68d 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4384,7 +4384,7 @@
<string name="config_customSessionPolicyProvider"></string>
<!-- The max scale for the wallpaper when it's zoomed in -->
- <item name="config_wallpaperMaxScale" format="float" type="dimen">1.10</item>
+ <item name="config_wallpaperMaxScale" format="float" type="dimen">1</item>
<!-- Package name that will receive an explicit manifest broadcast for
android.os.action.POWER_SAVE_MODE_CHANGED. -->
--
2.25.1

View File

@ -0,0 +1,40 @@
From 2fba4148047720a307d88013f20dbb87e389a751 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 5 Apr 2018 10:01:19 +0800
Subject: [PATCH 3/3] Disable vendor mismatch warning
Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
---
.../server/wm/ActivityTaskManagerService.java | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index ec178a4b543..f1d9cd968bc 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -6494,20 +6494,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
}
if (!Build.isBuildConsistent()) {
- Slog.e(TAG, "Build fingerprint is not consistent, warning user");
- mUiHandler.post(() -> {
- if (mShowDialogs) {
- AlertDialog d = new BaseErrorDialog(mUiContext);
- d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
- d.setCancelable(false);
- d.setTitle(mUiContext.getText(R.string.android_system_label));
- d.setMessage(mUiContext.getText(R.string.system_error_manufacturer));
- d.setButton(DialogInterface.BUTTON_POSITIVE,
- mUiContext.getText(R.string.ok),
- mUiHandler.obtainMessage(DISMISS_DIALOG_UI_MSG, d));
- d.show();
- }
- });
+ Slog.e(TAG, "Build fingerprint is not consistent");
+ // Do not emit warning about vendor mismatch
}
}
}
--
2.25.1

View File

@ -0,0 +1,26 @@
From 95ef97f5aa82c15e47f9313eca4899d89dba5dd0 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 4 Jul 2018 17:59:14 +0800
Subject: [PATCH] sdk: Invert per-app stretch-to-fullscreen implementation
Change-Id: Idf7dab4e1e0c79953fa672f33ec65fecffb37c83
---
sdk/src/java/org/lineageos/internal/applications/LongScreen.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdk/src/java/org/lineageos/internal/applications/LongScreen.java b/sdk/src/java/org/lineageos/internal/applications/LongScreen.java
index 7fe0d68..26ea349 100644
--- a/sdk/src/java/org/lineageos/internal/applications/LongScreen.java
+++ b/sdk/src/java/org/lineageos/internal/applications/LongScreen.java
@@ -57,7 +57,7 @@ public class LongScreen {
}
public boolean shouldForceLongScreen(String packageName) {
- return isSupported() && mApps.contains(packageName);
+ return isSupported() && !(mApps.contains(packageName));
}
public Set<String> getApps() {
--
2.7.4

View File

@ -0,0 +1,34 @@
From 6f9026e0548bd82e7b728ef29dd7d14db93b2105 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 26 Jun 2021 14:23:09 +0000
Subject: [PATCH] Jelly: MainActivity: Restore applyThemeColor
Fixes black statusbar on start
Change-Id: I6816f5b1dcb3c7bcaee2736a9e2a3ecd63217bc6
---
app/src/main/java/org/lineageos/jelly/MainActivity.kt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/src/main/java/org/lineageos/jelly/MainActivity.kt b/app/src/main/java/org/lineageos/jelly/MainActivity.kt
index 2902b0a..9ff74ed 100644
--- a/app/src/main/java/org/lineageos/jelly/MainActivity.kt
+++ b/app/src/main/java/org/lineageos/jelly/MainActivity.kt
@@ -193,6 +193,7 @@ class MainActivity : WebViewExtActivity(), SearchBarController.OnCancelListener,
findViewById(R.id.search_menu_cancel),
this)
setUiMode()
+ applyThemeColor(mThemeColor)
try {
val httpCacheDir = File(cacheDir, "suggestion_responses")
val httpCacheSize = 1024 * 1024.toLong() // 1 MiB
@@ -763,4 +764,4 @@ class MainActivity : WebViewExtActivity(), SearchBarController.OnCancelListener,
private const val STORAGE_PERM_REQ = 423
private const val LOCATION_PERM_REQ = 424
}
-}
\ No newline at end of file
+}
--
2.25.1

View File

@ -0,0 +1,105 @@
From 47bf5612cec98931ee3076c307247ac58d07ccff Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Sun, 13 Jan 2019 21:44:48 +0800
Subject: [PATCH] LineageParts: Invert per-app stretch-to-fullscreen
Change-Id: Icb02c8dfd84882f736e37d6cd92c35e5eb288faa
---
res/layout/long_screen_layout.xml | 2 +-
res/values-zh-rCN/strings.xml | 6 +++---
res/values/strings.xml | 6 +++---
res/xml/long_screen_prefs.xml | 2 +-
res/xml/parts_catalog.xml | 4 ++--
.../lineageparts/applications/LongScreenSettings.java | 2 +-
6 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/res/layout/long_screen_layout.xml b/res/layout/long_screen_layout.xml
index 40d0938..1119cef 100644
--- a/res/layout/long_screen_layout.xml
+++ b/res/layout/long_screen_layout.xml
@@ -36,7 +36,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
- android:text="@string/long_screen_settings_no_apps"
+ android:text="@string/inverse_long_screen_settings_no_apps"
android:textSize="18dp"
android:visibility="gone" />
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index ee5f7f9..eeed571 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -448,9 +448,9 @@
<string name="auto_power_save_summary_on">电量 %s 时自动启用省电</string>
<string name="auto_power_save_summary_off">不要自动启用省电</string>
<string name="auto_power_save_never">永不</string>
- <string name="long_screen_settings_title">全屏应用</string>
- <string name="long_screen_settings_summary">强制旧式应用程序使用全屏长宽比</string>
- <string name="long_screen_settings_no_apps">无应用</string>
+ <string name="inverse_long_screen_settings_title">禁用拉伸全屏</string>
+ <string name="inverse_long_screen_settings_summary">对选定的应用禁用拉伸全屏</string>
+ <string name="inverse_long_screen_settings_no_apps">无应用</string>
<string name="charging_sounds_settings_title">充电提示音</string>
<string name="charging_sounds_enabled_title">启用</string>
<string name="charging_sounds_enabled_summary">连接或断开电源时发出声音</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 65d799a..ff23ae9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -579,9 +579,9 @@
<string name="auto_power_save_never">Never</string>
<!-- Applications: Long screen -->
- <string name="long_screen_settings_title">Full screen apps</string>
- <string name="long_screen_settings_summary">Force legacy apps to use full screen aspect ratio</string>
- <string name="long_screen_settings_no_apps">No apps</string>
+ <string name="inverse_long_screen_settings_title">Disable stretch-to-fullscreen</string>
+ <string name="inverse_long_screen_settings_summary">Prevent selected apps from utilizing stretch-to-fullscreen</string>
+ <string name="inverse_long_screen_settings_no_apps">No apps</string>
<!-- Sounds: Charging sounds -->
<string name="charging_sounds_settings_title">Charging sounds</string>
diff --git a/res/xml/long_screen_prefs.xml b/res/xml/long_screen_prefs.xml
index ec947fa..20da90a 100644
--- a/res/xml/long_screen_prefs.xml
+++ b/res/xml/long_screen_prefs.xml
@@ -18,6 +18,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:lineage="http://schemas.android.com/apk/res/org.lineageos.lineageparts"
android:key="long_screen_settings"
- android:title="@string/long_screen_settings_title">
+ android:title="@string/inverse_long_screen_settings_title">
</PreferenceScreen>
diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml
index a4346c7..e21d7d5 100644
--- a/res/xml/parts_catalog.xml
+++ b/res/xml/parts_catalog.xml
@@ -92,8 +92,8 @@
lineage:xmlRes="@xml/perf_profile_settings" />
<part android:key="long_screen_settings"
- android:title="@string/long_screen_settings_title"
- android:summary="@string/long_screen_settings_summary"
+ android:title="@string/inverse_long_screen_settings_title"
+ android:summary="@string/inverse_long_screen_settings_summary"
android:fragment="org.lineageos.lineageparts.applications.LongScreenSettings"
lineage:xmlRes="@xml/long_screen_prefs" />
diff --git a/src/org/lineageos/lineageparts/applications/LongScreenSettings.java b/src/org/lineageos/lineageparts/applications/LongScreenSettings.java
index ac04058..50ff8f6 100644
--- a/src/org/lineageos/lineageparts/applications/LongScreenSettings.java
+++ b/src/org/lineageos/lineageparts/applications/LongScreenSettings.java
@@ -246,7 +246,7 @@ public class LongScreenSettings extends SettingsPreferenceFragment
mApplicationsState.ensureIcon(entry);
holder.icon.setImageDrawable(entry.icon);
holder.state.setTag(entry);
- holder.state.setChecked(mLongScreen.shouldForceLongScreen(entry.info.packageName));
+ holder.state.setChecked(!(mLongScreen.shouldForceLongScreen(entry.info.packageName)));
return holder.rootView;
}
--
2.17.1

View File

@ -0,0 +1,448 @@
From 69e5c49e18b9f33cebde3d54c69477ef2c18a756 Mon Sep 17 00:00:00 2001
From: Vachounet <vachounet@live.fr>
Date: Tue, 24 Nov 2020 05:49:46 +0000
Subject: [PATCH] Trebuchet: Move clear all button to actions view
Change-Id: I9d13247501ca8e1610c17adc204ad64dd4a04cec
---
.../RecentsViewStateController.java | 3 -
.../FallbackRecentsStateController.java | 3 -
.../quickstep/views/ClearAllButton.java | 112 ------------------
.../android/quickstep/views/RecentsView.java | 52 ++------
.../res/drawable/ic_clear_all_recents.xml | 21 ++++
.../res/layout/overview_actions_container.xml | 17 ++-
.../res/layout/overview_clear_all_button.xml | 27 -----
7 files changed, 44 insertions(+), 191 deletions(-)
delete mode 100644 quickstep/recents_ui_overrides/src/com/android/quickstep/views/ClearAllButton.java
create mode 100644 quickstep/res/drawable/ic_clear_all_recents.xml
delete mode 100644 quickstep/res/layout/overview_clear_all_button.xml
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
index 5ccc1e868..bc47c5a00 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
@@ -35,7 +35,6 @@ import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.util.MultiValueAlpha;
-import com.android.quickstep.views.ClearAllButton;
import com.android.quickstep.views.LauncherRecentsView;
import com.android.quickstep.views.RecentsView;
@@ -84,8 +83,6 @@ public final class RecentsViewStateController extends
private void setAlphas(PropertySetter propertySetter, StateAnimationConfig config,
LauncherState state) {
float buttonAlpha = (state.getVisibleElements(mLauncher) & OVERVIEW_BUTTONS) != 0 ? 1 : 0;
- propertySetter.setFloat(mRecentsView.getClearAllButton(), ClearAllButton.VISIBILITY_ALPHA,
- buttonAlpha, LINEAR);
propertySetter.setFloat(mLauncher.getActionsView().getVisibilityAlpha(),
MultiValueAlpha.VALUE, buttonAlpha, config.getInterpolator(
ANIM_OVERVIEW_ACTIONS_FADE, LINEAR));
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
index 24a761066..7af77ef60 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsStateController.java
@@ -35,7 +35,6 @@ import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.RecentsActivity;
-import com.android.quickstep.views.ClearAllButton;
/**
* State controller for fallback recents activity
@@ -78,8 +77,6 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
private void setProperties(RecentsState state, StateAnimationConfig config,
PropertySetter setter) {
float buttonAlpha = state.hasButtons() ? 1 : 0;
- setter.setFloat(mRecentsView.getClearAllButton(), ClearAllButton.VISIBILITY_ALPHA,
- buttonAlpha, LINEAR);
setter.setFloat(mActivity.getActionsView().getVisibilityAlpha(),
MultiValueAlpha.VALUE, buttonAlpha, LINEAR);
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/ClearAllButton.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/ClearAllButton.java
deleted file mode 100644
index fd74357f3..000000000
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/ClearAllButton.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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.quickstep.views;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.util.FloatProperty;
-import android.widget.Button;
-
-import com.android.launcher3.touch.PagedOrientationHandler;
-import com.android.quickstep.views.RecentsView.PageCallbacks;
-import com.android.quickstep.views.RecentsView.ScrollState;
-
-public class ClearAllButton extends Button implements PageCallbacks {
-
- public static final FloatProperty<ClearAllButton> VISIBILITY_ALPHA =
- new FloatProperty<ClearAllButton>("visibilityAlpha") {
- @Override
- public Float get(ClearAllButton view) {
- return view.mVisibilityAlpha;
- }
-
- @Override
- public void setValue(ClearAllButton view, float v) {
- view.setVisibilityAlpha(v);
- }
- };
-
- private float mScrollAlpha = 1;
- private float mContentAlpha = 1;
- private float mVisibilityAlpha = 1;
-
- private boolean mIsRtl;
-
- private int mScrollOffset;
-
- public ClearAllButton(Context context, AttributeSet attrs) {
- super(context, attrs);
- mIsRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
- }
-
- @Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- super.onLayout(changed, left, top, right, bottom);
- PagedOrientationHandler orientationHandler = getRecentsView().getPagedOrientationHandler();
- mScrollOffset = orientationHandler.getClearAllScrollOffset(getRecentsView(), mIsRtl);
- }
-
- private RecentsView getRecentsView() {
- return (RecentsView) getParent();
- }
-
- @Override
- public void onRtlPropertiesChanged(int layoutDirection) {
- super.onRtlPropertiesChanged(layoutDirection);
- mIsRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
- }
-
- @Override
- public boolean hasOverlappingRendering() {
- return false;
- }
-
- public void setContentAlpha(float alpha) {
- if (mContentAlpha != alpha) {
- mContentAlpha = alpha;
- updateAlpha();
- }
- }
-
- public void setVisibilityAlpha(float alpha) {
- if (mVisibilityAlpha != alpha) {
- mVisibilityAlpha = alpha;
- updateAlpha();
- }
- }
-
- @Override
- public void onPageScroll(ScrollState scrollState) {
- PagedOrientationHandler orientationHandler = getRecentsView().getPagedOrientationHandler();
- float orientationSize = orientationHandler.getPrimaryValue(getWidth(), getHeight());
- if (orientationSize == 0) {
- return;
- }
-
- float shift = Math.min(scrollState.scrollFromEdge, orientationSize);
- float translation = mIsRtl ? (mScrollOffset - shift) : (mScrollOffset + shift);
- orientationHandler.setPrimaryAndResetSecondaryTranslate(this, translation);
- mScrollAlpha = 1 - shift / orientationSize;
- updateAlpha();
- }
-
- private void updateAlpha() {
- final float alpha = mScrollAlpha * mContentAlpha * mVisibilityAlpha;
- setAlpha(alpha);
- setClickable(alpha == 1);
- }
-}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
index 0130cae47..bfdd79e5f 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
@@ -85,6 +85,7 @@ import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
+import android.widget.Button;
import android.widget.ListView;
import androidx.annotation.Nullable;
@@ -268,8 +269,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
private final float mFastFlingVelocity;
private final RecentsModel mModel;
private final int mTaskTopMargin;
- private final ClearAllButton mClearAllButton;
- private final Rect mClearAllButtonDeadZoneRect = new Rect();
+ private Button mClearAllButton;
private final Rect mTaskViewDeadZoneRect = new Rect();
private final ScrollState mScrollState = new ScrollState();
@@ -442,9 +442,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
mModel = RecentsModel.INSTANCE.get(context);
mIdp = InvariantDeviceProfile.INSTANCE.get(context);
- mClearAllButton = (ClearAllButton) LayoutInflater.from(context)
- .inflate(R.layout.overview_clear_all_button, this, false);
- mClearAllButton.setOnClickListener(this::dismissAllTasks);
mTaskViewPool = new ViewPool<>(context, this, R.layout.task, 20 /* max size */,
10 /* initial size */);
@@ -550,6 +547,8 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
public void init(OverviewActionsView actionsView) {
mActionsView = actionsView;
mActionsView.updateHiddenFlags(HIDDEN_NO_TASKS, getTaskViewCount() == 0);
+ mClearAllButton = (Button) mActionsView.findViewById(R.id.clear_all);
+ mClearAllButton.setOnClickListener(this::dismissAllTasks);
}
@Override
@@ -620,7 +619,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
}
private void updateTaskStartIndex(View affectingView) {
- if (!(affectingView instanceof TaskView) && !(affectingView instanceof ClearAllButton)) {
+ if (!(affectingView instanceof TaskView)) {
int childCount = getChildCount();
mTaskViewStartIndex = 0;
@@ -674,7 +673,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
* button fully visible, center page is Clear All button.
*/
public boolean isClearAllHidden() {
- return mClearAllButton.getAlpha() != 1f;
+ return true;
}
@Override
@@ -732,11 +731,8 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
mTouchDownToStartHome = true;
} else {
updateDeadZoneRects();
- final boolean clearAllButtonDeadZoneConsumed =
- mClearAllButton.getAlpha() == 1
- && mClearAllButtonDeadZoneRect.contains(x, y);
final boolean cameFromNavBar = (ev.getEdgeFlags() & EDGE_NAV_BAR) != 0;
- if (!clearAllButtonDeadZoneConsumed && !cameFromNavBar
+ if (!cameFromNavBar
&& !mTaskViewDeadZoneRect.contains(x + getScrollX(), y)) {
mTouchDownToStartHome = true;
}
@@ -783,18 +779,12 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
final int requiredTaskCount = tasks.size();
if (getTaskViewCount() != requiredTaskCount) {
- if (indexOfChild(mClearAllButton) != -1) {
- removeView(mClearAllButton);
- }
for (int i = getTaskViewCount(); i < requiredTaskCount; i++) {
addView(mTaskViewPool.getView());
}
while (getTaskViewCount() > requiredTaskCount) {
removeView(getChildAt(getChildCount() - 1));
}
- if (requiredTaskCount > 0) {
- addView(mClearAllButton);
- }
}
// Rebind and reset all task views
@@ -834,16 +824,10 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
for (int i = getTaskViewCount() - 1; i >= 0; i--) {
removeView(getTaskViewAt(i));
}
- if (indexOfChild(mClearAllButton) != -1) {
- removeView(mClearAllButton);
- }
}
public int getTaskViewCount() {
int taskViewCount = getChildCount() - mTaskViewStartIndex;
- if (indexOfChild(mClearAllButton) != -1) {
- taskViewCount--;
- }
return taskViewCount;
}
@@ -1199,9 +1183,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
// Add an empty view for now until the task plan is loaded and applied
final TaskView taskView = mTaskViewPool.getView();
addView(taskView, mTaskViewStartIndex);
- if (wasEmpty) {
- addView(mClearAllButton);
- }
// The temporary running task is only used for the duration between the start of the
// gesture and the task list is loaded and applied
mTmpRunningTask = Task.from(new TaskKey(runningTaskInfo), runningTaskInfo, false);
@@ -1538,7 +1519,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
removeViewInLayout(taskView);
if (getTaskViewCount() == 0) {
- removeViewInLayout(mClearAllButton);
startHome();
} else {
snapToPageImmediately(pageToSnapTo);
@@ -1677,7 +1657,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
child.setStableAlpha(alpha);
}
}
- mClearAllButton.setContentAlpha(mContentAlpha);
int alphaInt = Math.round(alpha * 255);
mEmptyMessagePaint.setAlpha(alphaInt);
mEmptyIcon.setAlpha(alphaInt);
@@ -1740,10 +1719,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
setLayoutDirection(mIsRtl
? View.LAYOUT_DIRECTION_RTL
: View.LAYOUT_DIRECTION_LTR);
- mClearAllButton.setLayoutDirection(mIsRtl
- ? View.LAYOUT_DIRECTION_LTR
- : View.LAYOUT_DIRECTION_RTL);
- mClearAllButton.setRotation(mOrientationHandler.getDegreesRotated());
mActivity.getDragLayer().recreateControllers();
boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0
|| mOrientationState.getRecentsActivityRotation() != ROTATION_0;
@@ -1963,15 +1938,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
}
private void updateDeadZoneRects() {
- // Get the deadzone rect surrounding the clear all button to not dismiss overview to home
- mClearAllButtonDeadZoneRect.setEmpty();
- if (mClearAllButton.getWidth() > 0) {
- int verticalMargin = getResources()
- .getDimensionPixelSize(R.dimen.recents_clear_all_deadzone_vertical_margin);
- mClearAllButton.getHitRect(mClearAllButtonDeadZoneRect);
- mClearAllButtonDeadZoneRect.inset(-getPaddingRight() / 2, -verticalMargin);
- }
-
// Get the deadzone rect between the task views
mTaskViewDeadZoneRect.setEmpty();
int count = getTaskViewCount();
@@ -2304,10 +2270,6 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
return super.computeMaxScroll();
}
- public ClearAllButton getClearAllButton() {
- return mClearAllButton;
- }
-
@Override
protected boolean onOverscroll(int amount) {
// overscroll should only be accepted on -1 direction (for clear all button)
diff --git a/quickstep/res/drawable/ic_clear_all_recents.xml b/quickstep/res/drawable/ic_clear_all_recents.xml
new file mode 100644
index 000000000..7cba0220b
--- /dev/null
+++ b/quickstep/res/drawable/ic_clear_all_recents.xml
@@ -0,0 +1,21 @@
+<!-- Copyright (C) 2020 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path android:fillColor="#FF000000" android:pathData="M5,13H19V11H5M3,17H17V15H3M7,7V9H21V7" />
+</vector>
diff --git a/quickstep/res/layout/overview_actions_container.xml b/quickstep/res/layout/overview_actions_container.xml
index 258f24a54..302cabf8a 100644
--- a/quickstep/res/layout/overview_actions_container.xml
+++ b/quickstep/res/layout/overview_actions_container.xml
@@ -45,6 +45,21 @@
android:layout_height="1dp"
android:layout_weight="1" />
+ <Button
+ style="@style/OverviewActionButton"
+ android:id="@+id/clear_all"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/recents_clear_all"
+ android:theme="@style/ThemeControlHighlightWorkspaceColor"
+ android:drawableStart="@drawable/ic_clear_all_recents"
+ />
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1" />
+
<Button
android:id="@+id/action_share"
style="@style/OverviewActionButton"
@@ -63,4 +78,4 @@
android:visibility="gone" />
</LinearLayout>
-</com.android.quickstep.views.OverviewActionsView>
\ No newline at end of file
+</com.android.quickstep.views.OverviewActionsView>
diff --git a/quickstep/res/layout/overview_clear_all_button.xml b/quickstep/res/layout/overview_clear_all_button.xml
deleted file mode 100644
index fc06ba057..000000000
--- a/quickstep/res/layout/overview_clear_all_button.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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.
--->
-<com.android.quickstep.views.ClearAllButton
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@android:style/Widget.DeviceDefault.Button.Borderless"
- android:id="@+id/clear_all"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/recents_clear_all"
- android:textColor="?attr/workspaceTextColor"
- android:textSize="14sp"
- android:translationY="@dimen/task_thumbnail_half_top_margin"
- />
\ No newline at end of file
--
2.25.1

View File

@ -0,0 +1,30 @@
From 7a633a53d8e20e2d976597a332bf5ba855ec1f75 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 5 Sep 2019 02:08:22 +0000
Subject: [PATCH] vendor_lineage: Log privapp-permissions whitelist violations
instead
Change-Id: I49dba61f332253e291a65e79ca70d9a07d45bb07
---
config/common.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/common.mk b/config/common.mk
index 2fe9cb01..7d971bba 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -70,9 +70,9 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
vendor/lineage/config/permissions/org.lineageos.android.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/org.lineageos.android.xml
-# Enforce privapp-permissions whitelist
+# Log privapp-permissions whitelist violations
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
- ro.control_privapp_permissions=enforce
+ ro.control_privapp_permissions=log
# Include AOSP audio files
include vendor/lineage/config/aosp_audio.mk
--
2.17.1

View File

@ -0,0 +1,46 @@
From f451664bce7527eb460615dfba0a5e4ad14a1847 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 20 Jun 2021 09:08:43 +0000
Subject: [PATCH] build: Integrate prop modifications (1/2)
Change-Id: I24f54937e3e542b7c29ea86d24e3f523583a0c61
---
tools/buildinfo.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index 954a01fb2..b3705cb6b 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -4,7 +4,7 @@ echo "# begin build properties"
echo "# autogenerated by buildinfo.sh"
echo "ro.build.id=$BUILD_ID"
-echo "ro.build.display.id=$BUILD_DISPLAY_ID"
+echo "ro.build.display.id=$BUILD_ID"
echo "ro.build.version.incremental=$BUILD_NUMBER"
echo "ro.build.version.sdk=$PLATFORM_SDK_VERSION"
echo "ro.build.version.preview_sdk=$PLATFORM_PREVIEW_SDK_VERSION"
@@ -16,7 +16,7 @@ echo "ro.build.version.release_or_codename=$PLATFORM_VERSION"
echo "ro.build.version.security_patch=$PLATFORM_SECURITY_PATCH"
echo "ro.build.version.base_os=$PLATFORM_BASE_OS"
echo "ro.build.version.min_supported_target_sdk=$PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION"
-echo "ro.build.date=`$DATE`"
+echo "ro.build.date=`$DATE +\"%B %-d, %Y\"`"
echo "ro.build.date.utc=`$DATE +%s`"
echo "ro.build.type=$TARGET_BUILD_TYPE"
echo "ro.build.user=$BUILD_USERNAME"
@@ -54,5 +54,10 @@ if [ -n "$BUILD_THUMBPRINT" ] ; then
fi
echo "ro.lineage.device=$LINEAGE_DEVICE"
+echo "ro.lineage.version=LineageOS 18.1 Self-built CGMod"
+echo "ro.lineage.display.version=LineageOS 18.1 Self-built CGMod"
+echo "ro.modversion=LineageOS 18.1 Self-built CGMod"
+
+echo "lockscreen.rot_override=true"
echo "# end build properties"
--
2.25.1

View File

@ -0,0 +1,57 @@
From 2743f5130c127f18977c83c7fa2401a0776ec478 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Fri, 9 Mar 2018 15:41:26 +0800
Subject: [PATCH 01/18] UI: Disable left (seascape) navigation bar optionally
Toggle this behaviour with property "persist.ui.seascape.disable"
Change-Id: Ieb58efa4b59feeb0c4ac70e497f4c59aa04210d6
---
.../systemui/statusbar/phone/ReverseLinearLayout.java | 6 ++++++
services/core/java/com/android/server/wm/DisplayPolicy.java | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ReverseLinearLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ReverseLinearLayout.java
index d3ec187ef20..01d87cd12f7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ReverseLinearLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ReverseLinearLayout.java
@@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone;
import android.annotation.Nullable;
import android.content.Context;
+import android.os.SystemProperties;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
@@ -86,6 +87,11 @@ public class ReverseLinearLayout extends LinearLayout {
boolean isLayoutRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
boolean isLayoutReverse = isLayoutRtl ^ mIsAlternativeOrder;
+ boolean isSeascapeDisabled = SystemProperties.getBoolean("persist.ui.seascape.disable", false);
+ if (isSeascapeDisabled) {
+ isLayoutReverse = isLayoutRtl ^ true;
+ }
+
if (mIsLayoutReverse != isLayoutReverse) {
// reversity changed, swap the order of all views.
int childCount = getChildCount();
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 97e4a9595da..18119560cd1 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -3413,9 +3413,10 @@ public class DisplayPolicy {
@NavigationBarPosition
int navigationBarPosition(int displayWidth, int displayHeight, int displayRotation) {
if (navigationBarCanMove() && displayWidth > displayHeight) {
- if (displayRotation == Surface.ROTATION_270) {
+ boolean isSeascapeDisabled = SystemProperties.getBoolean("persist.ui.seascape.disable", false);
+ if (displayRotation == Surface.ROTATION_270 && !isSeascapeDisabled) {
return NAV_BAR_LEFT;
- } else if (displayRotation == Surface.ROTATION_90) {
+ } else {
return NAV_BAR_RIGHT;
}
}
--
2.25.1

View File

@ -0,0 +1,95 @@
From 46a9bb999137ed1a0722f119970524cbce496183 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 26 Apr 2020 08:56:13 +0000
Subject: [PATCH 02/18] UI: Use SNAP_FIXED_RATIO for multi-window globally
Enables multiple snap targets under landscape for phone UI
Change-Id: I36e08f1e277dca0b0f9f99418671026e61b01496
---
core/res/res/values-land/config.xml | 19 -------------------
core/res/res/values-sw600dp/config.xml | 18 ++++++++----------
core/res/res/values/config.xml | 2 +-
3 files changed, 9 insertions(+), 30 deletions(-)
delete mode 100644 core/res/res/values-land/config.xml
diff --git a/core/res/res/values-land/config.xml b/core/res/res/values-land/config.xml
deleted file mode 100644
index 7308dc5882c..00000000000
--- a/core/res/res/values-land/config.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2015 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
- -->
-<resources>
- <integer name="config_dockedStackDividerSnapMode">2</integer>
-</resources>
\ No newline at end of file
diff --git a/core/res/res/values-sw600dp/config.xml b/core/res/res/values-sw600dp/config.xml
index 34b6a54be49..3921c9edfea 100644
--- a/core/res/res/values-sw600dp/config.xml
+++ b/core/res/res/values-sw600dp/config.xml
@@ -3,16 +3,16 @@
/*
** Copyright 2009, 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
+** 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
+** 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
+** 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.
*/
-->
@@ -40,8 +40,6 @@
<!-- Use a larger scaling span for larger screen devices. -->
<dimen name="config_minScalingSpan">32mm</dimen>
- <integer name="config_dockedStackDividerSnapMode">1</integer>
-
<!-- Controls whether the nav bar can move from the bottom to the side in landscape.
Only applies if the device display is not square. -->
<bool name="config_navBarCanMove">false</bool>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index f761d28e68d..b1ee670fc6a 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3313,7 +3313,7 @@
1 - 3 snap targets: fixed ratio, 1:1, (1 - fixed ratio)
2 - 1 snap target: 1:1
-->
- <integer name="config_dockedStackDividerSnapMode">0</integer>
+ <integer name="config_dockedStackDividerSnapMode">1</integer>
<!-- The maximum aspect ratio (longerSide/shorterSide) that is treated as close-to-square. The
orientation requests from apps would be ignored if the display is close-to-square. -->
--
2.25.1

View File

@ -0,0 +1,26 @@
From dcbba0a8db63f78730b01606462a92653ef18ae3 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 3 Jun 2020 01:31:34 +0000
Subject: [PATCH 03/18] UI: Increase default status bar height
Change-Id: Ibbcf63159e19bb2bb2b1094ea07ab85917630b07
---
core/res/res/values/dimens.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index d165930d3c9..eb537474b97 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -35,7 +35,7 @@
<dimen name="status_bar_height">@dimen/status_bar_height_portrait</dimen>
<!-- Height of the status bar in portrait. The height should be
Max((status bar content height + waterfall top size), top cutout size) -->
- <dimen name="status_bar_height_portrait">24dp</dimen>
+ <dimen name="status_bar_height_portrait">28dp</dimen>
<!-- Height of the status bar in landscape. The height should be
Max((status bar content height + waterfall top size), top cutout size) -->
<dimen name="status_bar_height_landscape">@dimen/status_bar_height_portrait</dimen>
--
2.25.1

View File

@ -0,0 +1,46 @@
From 39e612fc6c8c818da613564cb284d6881b53603e Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 7 Oct 2020 14:00:35 +0000
Subject: [PATCH 04/18] UI: Always render windows into cutouts
Eliminates black/white letterboxing
Quick and dirty way to do the latter - wait for proper fix from Google
Change-Id: I4661c7979bfa7de453329fcddbaeefc2009e2da3
---
services/core/java/com/android/server/wm/DisplayPolicy.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 18119560cd1..6f18d102019 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -1702,7 +1702,6 @@ public class DisplayPolicy {
void simulateLayoutDisplay(DisplayFrames displayFrames, InsetsState insetsState,
SparseArray<Rect> barContentFrames) {
displayFrames.onBeginLayout();
- updateInsetsStateForDisplayCutout(displayFrames, insetsState);
insetsState.setDisplayFrame(displayFrames.mUnrestricted);
final WindowFrames simulatedWindowFrames = new WindowFrames();
if (mNavigationBar != null) {
@@ -1731,8 +1730,6 @@ public class DisplayPolicy {
*/
public void beginLayoutLw(DisplayFrames displayFrames, int uiMode) {
displayFrames.onBeginLayout();
- updateInsetsStateForDisplayCutout(displayFrames,
- mDisplayContent.getInsetsStateController().getRawInsetsState());
mSystemGestures.screenWidth = displayFrames.mUnrestricted.width();
mSystemGestures.screenHeight = displayFrames.mUnrestricted.height();
@@ -2593,7 +2590,7 @@ public class DisplayPolicy {
}
}
- final int cutoutMode = attrs.layoutInDisplayCutoutMode;
+ final int cutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
final boolean attachedInParent = attached != null && !layoutInScreen;
final boolean requestedFullscreen = (fl & FLAG_FULLSCREEN) != 0
|| (requestedSysUiFl & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0
--
2.25.1

View File

@ -0,0 +1,34 @@
From 9a8d7eada09d1940b3e12dcbbb95b1e6cfdafb18 Mon Sep 17 00:00:00 2001
From: Vachounet <vachounet@live.fr>
Date: Wed, 14 Oct 2020 11:43:10 +0200
Subject: [PATCH 05/18] UI: Remove black background from power menu
Change-Id: I87092d57ea457e6d6783c87b8a64b4e69dec2d8a
---
.../android/systemui/globalactions/GlobalActionsDialog.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index f8f94b0bff6..04d35341c41 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -2696,7 +2696,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
initializeWalletView();
if (mBackgroundDrawable == null) {
mBackgroundDrawable = new ScrimDrawable();
- mScrimAlpha = 1.0f;
+ mScrimAlpha = 0.45f;
}
getWindow().setBackgroundDrawable(mBackgroundDrawable);
}
@@ -2733,7 +2733,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
if (!(mBackgroundDrawable instanceof ScrimDrawable)) {
return;
}
- ((ScrimDrawable) mBackgroundDrawable).setColor(Color.BLACK, animate);
View decorView = getWindow().getDecorView();
if (colors.supportsDarkText()) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR |
--
2.25.1

View File

@ -0,0 +1,88 @@
From 508d9e0843d9519344d76cd32e38148ee8975833 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 26 Oct 2020 14:06:56 +0000
Subject: [PATCH 06/18] UI: Reconfigure power menu items
- Show only the important items (GTFO Emergency)
- Make 4 columns
- Always include screenshot
Change-Id: I32cca6e2c6bb64d891efee959127edf7c0802cbc
---
core/res/res/values/config.xml | 5 +----
packages/SystemUI/res/values-land/config.xml | 19 ++++++++-----------
packages/SystemUI/res/values/config.xml | 2 +-
3 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index b1ee670fc6a..5efb4156466 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2779,13 +2779,10 @@
"logout" = Logout the current user
-->
<string-array translatable="false" name="config_globalActionsList">
- <item>emergency</item>
- <item>lockdown</item>
<item>power</item>
<item>restart</item>
- <item>logout</item>
<item>screenshot</item>
- <item>bugreport</item>
+ <item>airplane</item>
</string-array>
<!-- Number of milliseconds to hold a wake lock to ensure that drawing is fully
diff --git a/packages/SystemUI/res/values-land/config.xml b/packages/SystemUI/res/values-land/config.xml
index 2f7fbaff4ed..8b7ae652846 100644
--- a/packages/SystemUI/res/values-land/config.xml
+++ b/packages/SystemUI/res/values-land/config.xml
@@ -3,16 +3,16 @@
/*
** Copyright 2011, 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
+** 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
+** 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
+** 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.
*/
-->
@@ -34,7 +34,4 @@
<!-- Max number of columns for quick controls area -->
<integer name="controls_max_columns">4</integer>
-
- <!-- Max number of columns for power menu -->
- <integer name="power_menu_max_columns">4</integer>
</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index d86f3fa277f..fd9ec3166fb 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -572,7 +572,7 @@
<integer name="controls_max_columns">2</integer>
<!-- Max number of columns for power menu -->
- <integer name="power_menu_max_columns">3</integer>
+ <integer name="power_menu_max_columns">4</integer>
<!-- If the dp width of the available space is <= this value, potentially adjust the number
of columns-->
--
2.25.1

View File

@ -0,0 +1,34 @@
From 2253b5c60f551017965f7d6131ce777ac56713ce Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 15 May 2021 10:15:12 +0000
Subject: [PATCH 07/18] UI: Tap outside to dismiss power menu
Change-Id: Id713b84a2edb3facc184394963f98291abe6ae2c
---
.../systemui/globalactions/GlobalActionsDialog.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index 04d35341c41..4552792b3f5 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -2699,6 +2699,16 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
mScrimAlpha = 0.45f;
}
getWindow().setBackgroundDrawable(mBackgroundDrawable);
+
+ ViewGroup root = findViewById(com.android.systemui.R.id.global_actions_grid_root);
+ if (root != null) {
+ root.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ dismiss();
+ }
+ });
+ }
}
private void fixNavBarClipping() {
--
2.25.1

View File

@ -0,0 +1,28 @@
From 557c1fd05415a15beb4c1d6f6c021dc66a28957d Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 29 Jun 2021 22:57:01 +0000
Subject: [PATCH 08/18] UI: Relax requirement for HINT_SUPPORTS_DARK_TEXT
I decide what's good enough for a wallpaper!
Change-Id: I5ccd85b3df12e53746a4ac6cbc37ba8d11f6c336
---
core/java/android/app/WallpaperColors.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/java/android/app/WallpaperColors.java b/core/java/android/app/WallpaperColors.java
index e4818b27434..67208f0ebed 100644
--- a/core/java/android/app/WallpaperColors.java
+++ b/core/java/android/app/WallpaperColors.java
@@ -413,7 +413,7 @@ public final class WallpaperColors implements Parcelable {
int hints = 0;
double meanLuminance = totalLuminance / pixels.length;
- if (meanLuminance > BRIGHT_IMAGE_MEAN_LUMINANCE && darkPixels < maxDarkPixels) {
+ if (meanLuminance > BRIGHT_IMAGE_MEAN_LUMINANCE) {
hints |= HINT_SUPPORTS_DARK_TEXT;
}
if (meanLuminance < DARK_THEME_MEAN_LUMINANCE) {
--
2.25.1

View File

@ -0,0 +1,107 @@
From e894e06a986225263ec0828595edc5f22f01d59b Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 29 Jun 2021 23:01:07 +0000
Subject: [PATCH 09/18] UI: Force dark QS scrim
Side effect from using light wallpapers
Change-Id: I241dfd7cf8d8bfce1503e7872c5359c380fdbfed
---
.../systemui/qs/QuickStatusBarHeader.java | 5 -----
.../stack/NotificationStackScrollLayout.java | 2 +-
.../statusbar/phone/ScrimController.java | 21 ++++++-------------
3 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
index 94fd996d085..f82ec46c1ea 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
@@ -411,11 +411,6 @@ public class QuickStatusBarHeader extends RelativeLayout implements
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
updateResources();
-
- // Update color schemes in landscape to use wallpaperTextColor
- boolean shouldUseWallpaperTextColor =
- newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE;
- mClockView.useWallpaperTextColor(shouldUseWallpaperTextColor);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index a4a58194a46..05199cec01a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -541,7 +541,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
private SysuiColorExtractor.OnColorsChangedListener mOnColorsChangedListener =
(colorExtractor, which) -> {
- final boolean useDarkText = mColorExtractor.getNeutralColors().supportsDarkText();
+ final boolean useDarkText = false;
updateDecorViews(useDarkText);
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 686b8712723..96702a831cd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -35,9 +35,7 @@ import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.colorextraction.ColorExtractor;
import com.android.internal.colorextraction.ColorExtractor.GradientColors;
-import com.android.internal.colorextraction.ColorExtractor.OnColorsChangedListener;
import com.android.internal.graphics.ColorUtils;
import com.android.internal.util.function.TriConsumer;
import com.android.keyguard.KeyguardUpdateMonitor;
@@ -69,8 +67,7 @@ import javax.inject.Singleton;
* security method gets shown).
*/
@Singleton
-public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnColorsChangedListener,
- Dumpable {
+public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dumpable {
static final String TAG = "ScrimController";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
@@ -149,7 +146,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
private final KeyguardVisibilityCallback mKeyguardVisibilityCallback;
private final Handler mHandler;
- private final SysuiColorExtractor mColorExtractor;
private GradientColors mColors;
private boolean mNeedsDrawableColorUpdate;
@@ -226,9 +222,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
}
});
- mColorExtractor = sysuiColorExtractor;
- mColorExtractor.addOnColorsChangedListener(this);
- mColors = mColorExtractor.getNeutralColors();
+ mColors = new GradientColors();
+ mColors.setMainColor(-14671580);
+ mColors.setSecondaryColor(-14671580);
+ mColors.setColorPalette(new int[] {-14671580});
+ mColors.setSupportsDarkText(false);
mNeedsDrawableColorUpdate = true;
}
@@ -941,13 +939,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
// Don't care in the base class.
}
- @Override
- public void onColorsChanged(ColorExtractor colorExtractor, int which) {
- mColors = mColorExtractor.getNeutralColors();
- mNeedsDrawableColorUpdate = true;
- scheduleUpdate();
- }
-
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println(" ScrimController: ");
--
2.25.1

View File

@ -0,0 +1,30 @@
From 5ad738126de00c6c36b6a00ad0cc0afa5546fe56 Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Thu, 27 Dec 2018 16:38:19 +0800
Subject: [PATCH 10/18] Keyguard: Show shortcuts by default
Change-Id: I5655e0be26cec61214735719dffcda810286cd41
---
packages/SystemUI/res/values/config.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index fd9ec3166fb..2fb057cb635 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -69,10 +69,10 @@
<integer translatable="false" name="config_search_panel_view_vibration_duration">20</integer>
<!-- Show mic or phone affordance on Keyguard -->
- <bool name="config_keyguardShowLeftAffordance">false</bool>
+ <bool name="config_keyguardShowLeftAffordance">true</bool>
<!-- Show camera affordance on Keyguard -->
- <bool name="config_keyguardShowCameraAffordance">false</bool>
+ <bool name="config_keyguardShowCameraAffordance">true</bool>
<!-- The length of the vibration when the notification pops open. -->
<integer name="one_finger_pop_duration_ms">10</integer>
--
2.25.1

View File

@ -0,0 +1,260 @@
From 205d654cd20275c36b5d0826bfe8648ab80118ea Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 2 Nov 2019 07:52:36 +0000
Subject: [PATCH 11/18] Keyguard: Revert date and clock to Lollipop style
Also ported dynamic date format based on alarm presence from Oreo
Change-Id: I0f61c641ffb2a3e1e6b4da738792ee4ac1d77434
---
.../layout/keyguard_clock_switch.xml | 3 ---
.../layout/keyguard_status_view.xml | 1 -
.../res-keyguard/values-h560dp/dimens.xml | 2 +-
.../res-keyguard/values-h650dp/dimens.xml | 2 +-
.../SystemUI/res-keyguard/values/dimens.xml | 6 ++---
.../SystemUI/res-keyguard/values/strings.xml | 4 ++--
.../SystemUI/res-keyguard/values/styles.xml | 18 ++++-----------
.../res/layout/keyguard_status_bar.xml | 2 +-
.../android/keyguard/KeyguardSliceView.java | 2 +-
.../keyguard/KeyguardSliceProvider.java | 22 +++++++++++--------
10 files changed, 26 insertions(+), 36 deletions(-)
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml b/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml
index bf2963cd0b7..5fb06f38bd4 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml
@@ -36,8 +36,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
- android:paddingBottom="@dimen/title_clock_padding"
- android:letterSpacing="0.02"
android:textColor="?attr/wallpaperTextColor"
android:singleLine="true"
style="@style/widget_big"
@@ -51,7 +49,6 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal"
- android:letterSpacing="0.03"
android:textColor="?attr/wallpaperTextColor"
android:singleLine="true"
style="@style/widget_title_bold"
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_status_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_status_view.xml
index 10cd3cba713..9845a02399b 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_status_view.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_status_view.xml
@@ -67,7 +67,6 @@
android:layout_centerHorizontal="true"
android:textColor="?attr/wallpaperTextColorSecondary"
android:textSize="@dimen/widget_label_font_size"
- android:letterSpacing="0.05"
android:ellipsize="marquee"
android:singleLine="true" />
<com.android.systemui.statusbar.phone.NotificationIconContainer
diff --git a/packages/SystemUI/res-keyguard/values-h560dp/dimens.xml b/packages/SystemUI/res-keyguard/values-h560dp/dimens.xml
index 669f8fb642d..345b3d9c707 100644
--- a/packages/SystemUI/res-keyguard/values-h560dp/dimens.xml
+++ b/packages/SystemUI/res-keyguard/values-h560dp/dimens.xml
@@ -16,5 +16,5 @@
-->
<resources>
- <dimen name="widget_big_font_size">54dp</dimen>
+ <dimen name="widget_big_font_size">88dp</dimen>
</resources>
diff --git a/packages/SystemUI/res-keyguard/values-h650dp/dimens.xml b/packages/SystemUI/res-keyguard/values-h650dp/dimens.xml
index 669f8fb642d..345b3d9c707 100644
--- a/packages/SystemUI/res-keyguard/values-h650dp/dimens.xml
+++ b/packages/SystemUI/res-keyguard/values-h650dp/dimens.xml
@@ -16,5 +16,5 @@
-->
<resources>
- <dimen name="widget_big_font_size">54dp</dimen>
+ <dimen name="widget_big_font_size">88dp</dimen>
</resources>
diff --git a/packages/SystemUI/res-keyguard/values/dimens.xml b/packages/SystemUI/res-keyguard/values/dimens.xml
index f9389ce24d9..cf3a8d79712 100644
--- a/packages/SystemUI/res-keyguard/values/dimens.xml
+++ b/packages/SystemUI/res-keyguard/values/dimens.xml
@@ -42,13 +42,13 @@
<dimen name="eca_overlap">-10dip</dimen>
<!-- Slice header -->
- <dimen name="widget_title_font_size">24dp</dimen>
+ <dimen name="widget_title_font_size">16dp</dimen>
<dimen name="header_subtitle_padding">12dp</dimen>
<dimen name="header_icon_size">16dp</dimen>
<!-- Slice subtitle -->
- <dimen name="widget_label_font_size">18dp</dimen>
+ <dimen name="widget_label_font_size">16dp</dimen>
<!-- Clock without header -->
- <dimen name="widget_big_font_size">54dp</dimen>
+ <dimen name="widget_big_font_size">88dp</dimen>
<dimen name="bottom_text_spacing_digital">0dp</dimen>
<dimen name="title_clock_padding">4dp</dimen>
<!-- Clock with header -->
diff --git a/packages/SystemUI/res-keyguard/values/strings.xml b/packages/SystemUI/res-keyguard/values/strings.xml
index 4b6621379b4..3f7b909bf8e 100644
--- a/packages/SystemUI/res-keyguard/values/strings.xml
+++ b/packages/SystemUI/res-keyguard/values/strings.xml
@@ -115,9 +115,9 @@
<string name="keyguard_carrier_name_with_sim_locked_template" translatable="false"><xliff:g id="carrier">%s</xliff:g> (<xliff:g id="message">%s</xliff:g>)</string>
<!-- Time format strings for fall-back clock widget -->
- <string name="keyguard_widget_12_hours_format" translatable="false">h:mm</string>
+ <string name="keyguard_widget_12_hours_format" translatable="false">hh:mm</string>
<!-- Time format strings for fall-back clock widget -->
- <string name="keyguard_widget_24_hours_format" translatable="false">kk:mm</string>
+ <string name="keyguard_widget_24_hours_format" translatable="false">HH:mm</string>
<!-- The character used in keyguard_widget_12_hours_format and keyguard_widget_24_hours_format
to represent a ":". -->
<string name="keyguard_fancy_colon" translatable="false"></string>
diff --git a/packages/SystemUI/res-keyguard/values/styles.xml b/packages/SystemUI/res-keyguard/values/styles.xml
index 401f3e3e068..6ad077aaa5a 100644
--- a/packages/SystemUI/res-keyguard/values/styles.xml
+++ b/packages/SystemUI/res-keyguard/values/styles.xml
@@ -65,29 +65,23 @@
<style name="widget_big">
<item name="android:textSize">@dimen/widget_big_font_size</item>
<item name="android:paddingBottom">@dimen/bottom_text_spacing_digital</item>
- <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:fontFamily">sans-serif-thin</item>
<item name="android:fontFeatureSettings">@*android:string/config_headlineFontFeatureSettings</item>
<item name="android:ellipsize">none</item>
- <item name="android:shadowColor">@color/keyguard_shadow_color</item>
- <item name="android:shadowRadius">?attr/shadowRadius</item>
</style>
<style name="widget_title_bold">
<item name="android:textStyle">bold</item>
<item name="android:textSize">@dimen/widget_title_font_size</item>
<item name="android:paddingBottom">@dimen/widget_vertical_padding_clock</item>
- <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:fontFamily">sans-serif</item>
<item name="android:ellipsize">none</item>
- <item name="android:shadowColor">@color/keyguard_shadow_color</item>
- <item name="android:shadowRadius">?attr/shadowRadius</item>
</style>
<style name="widget_small_bold">
<item name="android:textStyle">bold</item>
<item name="android:textSize">@dimen/widget_small_font_size</item>
<item name="android:paddingBottom">@dimen/bottom_text_spacing_digital</item>
- <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+ <item name="android:fontFamily">sans-serif</item>
<item name="android:ellipsize">none</item>
- <item name="android:shadowColor">@color/keyguard_shadow_color</item>
- <item name="android:shadowRadius">?attr/shadowRadius</item>
</style>
<style name="BouncerSecurityContainer">
@@ -119,9 +113,7 @@
<item name="android:gravity">center</item>
<item name="android:ellipsize">end</item>
<item name="android:maxLines">2</item>
- <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
- <item name="android:shadowColor">@color/keyguard_shadow_color</item>
- <item name="android:shadowRadius">?attr/shadowRadius</item>
+ <item name="android:fontFamily">sans-serif</item>
</style>
<style name="TextAppearance.Keyguard.Secondary">
@@ -135,8 +127,6 @@
<item name="android:textSize">14sp</item>
<item name="android:maxLines">1</item>
<item name="android:textColor">?attr/wallpaperTextColor</item>
- <item name="android:shadowColor">@color/keyguard_shadow_color</item>
- <item name="android:shadowRadius">?attr/shadowRadius</item>
</style>
</resources>
diff --git a/packages/SystemUI/res/layout/keyguard_status_bar.xml b/packages/SystemUI/res/layout/keyguard_status_bar.xml
index 2b22cc196db..58343800c2e 100644
--- a/packages/SystemUI/res/layout/keyguard_status_bar.xml
+++ b/packages/SystemUI/res/layout/keyguard_status_bar.xml
@@ -73,7 +73,7 @@
android:gravity="center_vertical"
android:ellipsize="marquee"
android:textDirection="locale"
- android:textAppearance="@style/TextAppearance.StatusBar.Clock"
+ android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/wallpaperTextColorSecondary"
android:singleLine="true"
systemui:showMissingSim="true"
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
index f639c880c97..5c42937eb6a 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
@@ -502,7 +502,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (child instanceof KeyguardSliceTextView) {
- ((KeyguardSliceTextView) child).setMaxWidth(width / 3);
+ ((KeyguardSliceTextView) child).setMaxWidth(width);
}
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardSliceProvider.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardSliceProvider.java
index 3a37c0fd463..70b7e5354e2 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardSliceProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardSliceProvider.java
@@ -95,7 +95,7 @@ public class KeyguardSliceProvider extends SliceProvider implements
* Only show alarms that will ring within N hours.
*/
@VisibleForTesting
- static final int ALARM_VISIBILITY_HOURS = 12;
+ static final int ALARM_VISIBILITY_HOURS = 24;
private static final Object sInstanceLock = new Object();
private static KeyguardSliceProvider sInstance;
@@ -304,7 +304,10 @@ public class KeyguardSliceProvider extends SliceProvider implements
if (oldInstance != null) {
oldInstance.onDestroy();
}
- mDatePattern = getContext().getString(R.string.system_ui_aod_date_pattern);
+ boolean isNextAlarmPresent = withinNHoursLocked(mNextAlarmInfo, ALARM_VISIBILITY_HOURS);
+ mDatePattern = getContext().getString(isNextAlarmPresent
+ ? R.string.abbrev_wday_month_day_no_year_alarm
+ : R.string.abbrev_wday_month_day_no_year);
mPendingIntent = PendingIntent.getActivity(getContext(), 0,
new Intent(getContext(), KeyguardSliceProvider.class), 0);
mMediaManager.addCallback(this);
@@ -355,14 +358,17 @@ public class KeyguardSliceProvider extends SliceProvider implements
synchronized (this) {
if (withinNHoursLocked(mNextAlarmInfo, ALARM_VISIBILITY_HOURS)) {
String pattern = android.text.format.DateFormat.is24HourFormat(getContext(),
- ActivityManager.getCurrentUser()) ? "HH:mm" : "h:mm";
+ ActivityManager.getCurrentUser()) ? "E HH:mm" : "E hh:mm";
mNextAlarm = android.text.format.DateFormat.format(pattern,
mNextAlarmInfo.getTriggerTime()).toString();
+ mDatePattern = getContext().getString(R.string.abbrev_wday_month_day_no_year_alarm);
} else {
mNextAlarm = "";
+ mDatePattern = getContext().getString(R.string.abbrev_wday_month_day_no_year);
}
}
notifyChange();
+ updateClockLocked();
}
private boolean withinNHoursLocked(AlarmManager.AlarmClockInfo alarmClockInfo, int hours) {
@@ -411,12 +417,10 @@ public class KeyguardSliceProvider extends SliceProvider implements
}
protected String getFormattedDateLocked() {
- if (mDateFormat == null) {
- final Locale l = Locale.getDefault();
- DateFormat format = DateFormat.getInstanceForSkeleton(mDatePattern, l);
- format.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
- mDateFormat = format;
- }
+ final Locale l = Locale.getDefault();
+ DateFormat format = DateFormat.getInstanceForSkeleton(mDatePattern, l);
+ format.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
+ mDateFormat = format;
mCurrentTime.setTime(System.currentTimeMillis());
return mDateFormat.format(mCurrentTime);
}
--
2.25.1

View File

@ -0,0 +1,54 @@
From 535b165f24d4166c515d2ad61ec65874d786fef5 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 2 Nov 2019 11:11:07 +0000
Subject: [PATCH 12/18] Keyguard: Fix clock position
New method - way easier than what was done on Pie
Still not perfect:
- Notification padding has to be taken care of in some other way - directly altering stackScrollerPadding causes visual glitches
Change-Id: Ia5cebd04c2cb4b324c04019afdf045d5489cf2b8
---
.../statusbar/phone/KeyguardClockPositionAlgorithm.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
index a3f14ba28dc..d1982ae5ad2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
@@ -177,7 +177,8 @@ public class KeyguardClockPositionAlgorithm {
}
private int getMaxClockY() {
- return mHeight / 2 - mKeyguardStatusHeight - mClockNotificationsMargin;
+ // Align the center of the clock at 1/3 of the screen
+ return mHeight / 3 - mKeyguardStatusHeight / 2;
}
private int getPreferredClockY() {
@@ -214,12 +215,11 @@ public class KeyguardClockPositionAlgorithm {
}
private int getClockY(float panelExpansion) {
- // Dark: Align the bottom edge of the clock at about half of the screen:
float clockYDark = (mHasCustomClock ? getPreferredClockY() : getMaxClockY())
+ burnInPreventionOffsetY();
clockYDark = MathUtils.max(0, clockYDark);
- float clockYRegular = getExpandedPreferredClockY();
+ float clockYRegular = getMaxClockY();
float clockYBouncer = -mKeyguardStatusHeight;
// Move clock up while collapsing the shade
@@ -240,7 +240,7 @@ public class KeyguardClockPositionAlgorithm {
* @return Alpha from 0 to 1.
*/
private float getClockAlpha(int y) {
- float alphaKeyguard = Math.max(0, y / Math.max(1f, getClockY(1f)));
+ float alphaKeyguard = Math.max(0, y / Math.max(1f, getMaxClockY()));
alphaKeyguard = Interpolators.ACCELERATE.getInterpolation(alphaKeyguard);
return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount);
}
--
2.25.1

View File

@ -0,0 +1,31 @@
From 525d4852c431af17570f778b4294876393a6c615 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 2 Nov 2019 06:41:03 +0000
Subject: [PATCH 13/18] Keyguard: Hide padlock
It's just fking ugly.
Please Google, stop your UI designers.
Change-Id: Ie91e80ca5c6637a51a8acc72fb28cd6ac2a7abb6
---
packages/SystemUI/res/values/dimens.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index e414861b0cd..19341fdb415 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -823,8 +823,8 @@
<dimen name="keyguard_affordance_width">56dp</dimen>
<!-- The width/height of the unlock icon view on keyguard. -->
- <dimen name="keyguard_lock_height">42dp</dimen>
- <dimen name="keyguard_lock_width">42dp</dimen>
+ <dimen name="keyguard_lock_height">0dp</dimen>
+ <dimen name="keyguard_lock_width">0dp</dimen>
<dimen name="keyguard_lock_padding">20dp</dimen>
<dimen name="keyguard_indication_margin_bottom">40dp</dimen>
--
2.25.1

View File

@ -0,0 +1,89 @@
From 62e1f218db18a9bcacba85c479a2c40625e958f6 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 2 Nov 2019 08:31:36 +0000
Subject: [PATCH 14/18] Keyguard: Refine indication text
- Always show "Swipe up to unlock" hint
- Put the text in-line with bottom shortcuts
- Don't show charging state alongside other hints
Change-Id: Ib771c35610f712a1de34736e817bcfe616ac37d8
---
packages/SystemUI/res/values-sw600dp-land/dimens.xml | 2 +-
packages/SystemUI/res/values-sw600dp/dimens.xml | 2 +-
packages/SystemUI/res/values/dimens.xml | 2 +-
.../statusbar/KeyguardIndicationController.java | 12 ++----------
4 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/packages/SystemUI/res/values-sw600dp-land/dimens.xml b/packages/SystemUI/res/values-sw600dp-land/dimens.xml
index f2df4b9023b..7719a0ae0ba 100644
--- a/packages/SystemUI/res/values-sw600dp-land/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp-land/dimens.xml
@@ -18,7 +18,7 @@
<resources>
<dimen name="keyguard_clock_notifications_margin">36dp</dimen>
- <dimen name="keyguard_indication_margin_bottom">80dp</dimen>
+ <dimen name="keyguard_indication_margin_bottom">40dp</dimen>
<!-- Screen pinning request width (just a little bit bigger than the three buttons here -->
<dimen name="screen_pinning_request_width">490dp</dimen>
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index aa574c7d9f6..d06906bab08 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -71,7 +71,7 @@
phone hints. -->
<dimen name="edge_tap_area_width">80dp</dimen>
- <dimen name="keyguard_indication_margin_bottom">90dp</dimen>
+ <dimen name="keyguard_indication_margin_bottom">40dp</dimen>
<!-- Margin on the right side of the system icon group on Keyguard. -->
<dimen name="system_icons_keyguard_padding_end">2dp</dimen>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 19341fdb415..7190def8786 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -827,7 +827,7 @@
<dimen name="keyguard_lock_width">0dp</dimen>
<dimen name="keyguard_lock_padding">20dp</dimen>
- <dimen name="keyguard_indication_margin_bottom">40dp</dimen>
+ <dimen name="keyguard_indication_margin_bottom">20dp</dimen>
<!-- The text size for battery level -->
<dimen name="battery_level_text_size">12sp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index dd6a0f053f9..1c67f914105 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -447,15 +447,7 @@ public class KeyguardIndicationController implements StateListener,
isError = mTransientTextIsError;
} else if (!TextUtils.isEmpty(trustGrantedIndication)
&& mKeyguardUpdateMonitor.getUserHasTrust(userId)) {
- if (powerIndication != null) {
- String indication = mContext.getResources().getString(
- R.string.keyguard_indication_trust_unlocked_plugged_in,
- trustGrantedIndication, powerIndication);
- mTextView.switchIndication(indication);
- hideIndication = !mBatteryPresent;
- } else {
- mTextView.switchIndication(trustGrantedIndication);
- }
+ mTextView.switchIndication(trustGrantedIndication);
} else if (!TextUtils.isEmpty(mAlignmentIndication)) {
mTextView.switchIndication(mAlignmentIndication);
isError = true;
@@ -475,7 +467,7 @@ public class KeyguardIndicationController implements StateListener,
&& !mKeyguardUpdateMonitor.getUserHasTrust(userId)) {
mTextView.switchIndication(trustManagedIndication);
} else {
- mTextView.switchIndication(mRestingIndication);
+ mTextView.switchIndication(R.string.keyguard_unlock);
}
mTextView.setTextColor(isError ? Utils.getColorError(mContext)
: mInitialTextColorState);
--
2.25.1

View File

@ -0,0 +1,133 @@
From 00720384d76b0a650014db49705df71e055b18ec Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 20 Mar 2021 10:35:14 +0000
Subject: [PATCH 15/18] Keyguard/UI: Fix status bar margins and paddings
- Change keyguard_carrier_text_margin into a padding
- Link keyguard paddings to status_bar_padding_{start|end}
- Add status_bar_padding_{start|end} to quick settings header
Change-Id: Ic91fa398813e1907297bb0892c444d96405950e7
---
packages/SystemUI/res/layout/keyguard_status_bar.xml | 2 +-
.../layout/quick_status_bar_header_system_icons.xml | 6 ++++--
packages/SystemUI/res/values-sw600dp/dimens.xml | 6 ------
packages/SystemUI/res/values/dimens.xml | 4 ++--
.../statusbar/phone/KeyguardStatusBarView.java | 11 -----------
5 files changed, 7 insertions(+), 22 deletions(-)
diff --git a/packages/SystemUI/res/layout/keyguard_status_bar.xml b/packages/SystemUI/res/layout/keyguard_status_bar.xml
index 58343800c2e..3782df2539e 100644
--- a/packages/SystemUI/res/layout/keyguard_status_bar.xml
+++ b/packages/SystemUI/res/layout/keyguard_status_bar.xml
@@ -68,7 +68,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/status_bar_padding_top"
- android:layout_marginStart="@dimen/keyguard_carrier_text_margin"
+ android:paddingStart="@dimen/keyguard_carrier_text_margin"
android:layout_toStartOf="@id/system_icons_container"
android:gravity="center_vertical"
android:ellipsize="marquee"
diff --git a/packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml b/packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml
index 3c748018187..74bcbf2685e 100644
--- a/packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml
+++ b/packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml
@@ -32,7 +32,8 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
- android:gravity="center_vertical|start" >
+ android:gravity="center_vertical|start"
+ android:paddingStart="@dimen/status_bar_padding_start" >
<com.android.systemui.statusbar.policy.Clock
android:id="@+id/clock"
@@ -59,7 +60,8 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
- android:gravity="center_vertical|end" >
+ android:gravity="center_vertical|end"
+ android:paddingEnd="@dimen/status_bar_padding_end" >
<include layout="@layout/ongoing_privacy_chip" />
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index d06906bab08..75fd4abba84 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -60,9 +60,6 @@
<!-- end margin for multi user switch in collapsed quick settings -->
<dimen name="multi_user_switch_keyguard_margin">6dp</dimen>
- <!-- Margin on the left side of the carrier text on Keyguard -->
- <dimen name="keyguard_carrier_text_margin">24dp</dimen>
-
<!-- The width/height of the phone/camera/unlock icon on keyguard. -->
<dimen name="keyguard_affordance_height">80dp</dimen>
<dimen name="keyguard_affordance_width">120dp</dimen>
@@ -73,9 +70,6 @@
<dimen name="keyguard_indication_margin_bottom">40dp</dimen>
- <!-- Margin on the right side of the system icon group on Keyguard. -->
- <dimen name="system_icons_keyguard_padding_end">2dp</dimen>
-
<!-- Screen pinning request width -->
<dimen name="screen_pinning_request_width">400dp</dimen>
<!-- Screen pinning request bottom button circle widths -->
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 7190def8786..9172bfa823e 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -784,7 +784,7 @@
<dimen name="kg_framed_avatar_size">54dp</dimen>
<!-- Margin on the left side of the carrier text on Keyguard -->
- <dimen name="keyguard_carrier_text_margin">16dp</dimen>
+ <dimen name="keyguard_carrier_text_margin">@dimen/status_bar_padding_start</dimen>
<!-- Margin on the left side of the battery % in the header. -->
<dimen name="header_battery_margin_expanded">6dp</dimen>
@@ -793,7 +793,7 @@
<dimen name="header_battery_margin_keyguard">6dp</dimen>
<!-- Margin on the right side of the system icon group on Keyguard. -->
- <dimen name="system_icons_keyguard_padding_end">4dp</dimen>
+ <dimen name="system_icons_keyguard_padding_end">@dimen/status_bar_padding_end</dimen>
<!-- Additional translation (downwards) for appearing notifications when going to the full shade
from Keyguard. -->
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
index 9baac56410a..c75cab3d469 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -238,7 +238,6 @@ public class KeyguardStatusBarView extends RelativeLayout
Pair<Integer, Integer> cornerCutoutMargins =
StatusBarWindowView.cornerCutoutMargins(mDisplayCutout, getDisplay());
updatePadding(cornerCutoutMargins);
- updateCarrierLabelParams();
if (mDisplayCutout == null || cornerCutoutMargins != null) {
return updateLayoutParamsNoCutout();
} else {
@@ -255,16 +254,6 @@ public class KeyguardStatusBarView extends RelativeLayout
setPadding(mPadding.first, waterfallTop, mPadding.second, 0);
}
- private void updateCarrierLabelParams() {
- int marginStart = calculateMargin(
- getResources().getDimensionPixelSize(R.dimen.keyguard_carrier_text_margin),
- mPadding.first);
- MarginLayoutParams lp = (MarginLayoutParams) mCarrierLabel.getLayoutParams();
- lp.setMarginStart(marginStart);
-
- mCarrierLabel.setLayoutParams(lp);
- }
-
private boolean updateLayoutParamsNoCutout() {
if (mLayoutState == LAYOUT_NO_CUTOUT) {
return false;
--
2.25.1

View File

@ -0,0 +1,53 @@
From 0d94e66575aa5c5eda8a4a93b8747fd335db5dce Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Fri, 22 Mar 2019 00:41:20 +0800
Subject: [PATCH 16/18] Disable FP lockouts
Both timed and permanent lockouts - GET THE FUCK OUT
Android 10 seems to have unified biometrics procedures - only disable lockouts for FP for now
Change-Id: I2d4b091f3546d4d7903bfb4d5585629212dc9915
---
.../fingerprint/FingerprintService.java | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
index def1a873590..e8362580510 100644
--- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
@@ -173,15 +173,7 @@ public class FingerprintService extends BiometricServiceBase {
@Override
public int handleFailedAttempt() {
- final int currentUser = ActivityManager.getCurrentUser();
- mFailedAttempts.put(currentUser, mFailedAttempts.get(currentUser, 0) + 1);
- mTimedLockoutCleared.put(ActivityManager.getCurrentUser(), false);
-
- if (getLockoutMode() != AuthenticationClient.LOCKOUT_NONE) {
- scheduleLockoutResetForUser(currentUser);
- }
-
- return super.handleFailedAttempt();
+ return AuthenticationClient.LOCKOUT_NONE;
}
boolean isDetectOnly() {
@@ -983,15 +975,6 @@ public class FingerprintService extends BiometricServiceBase {
@Override
protected int getLockoutMode() {
- final int currentUser = ActivityManager.getCurrentUser();
- final int failedAttempts = mFailedAttempts.get(currentUser, 0);
- if (failedAttempts >= MAX_FAILED_ATTEMPTS_LOCKOUT_PERMANENT) {
- return AuthenticationClient.LOCKOUT_PERMANENT;
- } else if (failedAttempts > 0
- && !mTimedLockoutCleared.get(currentUser, false)
- && (failedAttempts % MAX_FAILED_ATTEMPTS_LOCKOUT_TIMED == 0)) {
- return AuthenticationClient.LOCKOUT_TIMED;
- }
return AuthenticationClient.LOCKOUT_NONE;
}
--
2.25.1

View File

@ -0,0 +1,387 @@
From 8670dcd137ae5b202cb97e83e60f8ba672395a82 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 20 Jun 2021 03:39:32 +0000
Subject: [PATCH 17/18] Add MiuiNavbarOverlay
Change-Id: I0e6791abc3c9521d7dc612df2fec2b041affe7e9
---
packages/overlays/Android.mk | 1 +
.../overlays/MiuiNavbarOverlay/Android.mk | 27 ++++++++++++++++++
.../MiuiNavbarOverlay/AndroidManifest.xml | 21 ++++++++++++++
.../res/drawable-440dpi-v4/ic_sysbar_back.png | Bin 0 -> 2756 bytes
.../ic_sysbar_back_darkmode.png | Bin 0 -> 2547 bytes
.../drawable-440dpi-v4/ic_sysbar_docked.png | Bin 0 -> 3642 bytes
.../ic_sysbar_docked_darkmode.png | Bin 0 -> 2810 bytes
.../res/drawable-440dpi-v4/ic_sysbar_home.png | Bin 0 -> 1362 bytes
.../ic_sysbar_home_darkmode.png | Bin 0 -> 980 bytes
.../drawable-440dpi-v4/ic_sysbar_recent.png | Bin 0 -> 278 bytes
.../ic_sysbar_recent_darkmode.png | Bin 0 -> 205 bytes
11 files changed, 49 insertions(+)
create mode 100644 packages/overlays/MiuiNavbarOverlay/Android.mk
create mode 100644 packages/overlays/MiuiNavbarOverlay/AndroidManifest.xml
create mode 100644 packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_back.png
create mode 100644 packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_back_darkmode.png
create mode 100644 packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_docked.png
create mode 100644 packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_docked_darkmode.png
create mode 100644 packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_home.png
create mode 100644 packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_home_darkmode.png
create mode 100644 packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_recent.png
create mode 100644 packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_recent_darkmode.png
diff --git a/packages/overlays/Android.mk b/packages/overlays/Android.mk
index 999ab080246..de3afebac43 100644
--- a/packages/overlays/Android.mk
+++ b/packages/overlays/Android.mk
@@ -72,6 +72,7 @@ LOCAL_REQUIRED_MODULES := \
IconShapeTaperedRectOverlay \
IconShapeTeardropOverlay \
IconShapeVesselOverlay \
+ MiuiNavbarOverlay \
NavigationBarMode3ButtonOverlay \
NavigationBarModeGesturalOverlay \
NavigationBarModeGesturalOverlayNarrowBack \
diff --git a/packages/overlays/MiuiNavbarOverlay/Android.mk b/packages/overlays/MiuiNavbarOverlay/Android.mk
new file mode 100644
index 00000000000..3a577ef5920
--- /dev/null
+++ b/packages/overlays/MiuiNavbarOverlay/Android.mk
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2020, 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.
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_PRODUCT_MODULE := true
+
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+
+LOCAL_PACKAGE_NAME := MiuiNavbarOverlay
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_RRO_PACKAGE)
diff --git a/packages/overlays/MiuiNavbarOverlay/AndroidManifest.xml b/packages/overlays/MiuiNavbarOverlay/AndroidManifest.xml
new file mode 100644
index 00000000000..3956effddfb
--- /dev/null
+++ b/packages/overlays/MiuiNavbarOverlay/AndroidManifest.xml
@@ -0,0 +1,21 @@
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.miui.systemui.navbar.overlay"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <overlay android:targetPackage="com.android.systemui" android:priority="1337" android:isStatic="true"/>
+</manifest>
diff --git a/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_back.png b/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_back.png
new file mode 100644
index 0000000000000000000000000000000000000000..be2b145b4c698679bfdfdc3e5834ad12a56724c0
GIT binary patch
literal 2756
zcmcgu3s4hx8V?1-3OZnL5L?tGprz_2n-D@036KXu)CfXOJj=t)?k3rRWWy$qfRADd
zhu~RzrHmZ`k!wBAa-g0-rC<@UbSw%?@2-FjLbWI3sc4FiE8=+@UZak6oX*Yd%<lg8
z|Nnj8_xql+C5ap3=6k*A#b7YztKyYO^xNUO0Ve${b@zQjzvi0be`{edy!~9a8{=SQ
z0E02-I-%KO-J;$gK}jPA!ALF6u^Y`an!$*Swwn<&6Ssm|Tu+#!?7J;(Y>>dD?38dd
ztTrof0}-E3;mP?MHE4b&D#qB+QDCH9LMt%hRs^&gvrHC=UCN%+E1}n}Z7v&}gjh4B
zY?;d-xJ8`^Do6?k!#P3-<q7y;gqXt<!eYK)HOPl~5nMQe%L{{Go&*+3!o=Y8#ip%M
zm`;+UTsv)x{*tl{R;yXU<=SjEjxCHsQhF{=EEaQNK9|pjXar=*Gg%QkWU>U$Xi(x7
zlp@Slf;53Hjfj@au}axA(<v8>=2^8S%XFCNfN|}JnaktAE|(^O7&?nH=TKRb#xazO
zXW>TNWVO&(-YnK^Ag!duK>mX2+2iL7(4keUXKlQci_ti1!eWihrQMhg$V<@{O`aL&
zCgBz`heGk#T$*OE%Nw&qLE(s%q%<U%HIt~s8OoqS;Yy4M3{4?S7-_S-^Nb9xM69@!
z&4>9g1PdUZSi=)Z;4q0mv<jvd@Dx-{VuUX5c_<&&z+wr^e-1~N42D>dS0gc0q9Z9I
zLVHUX5k1Z|oAhjOHii-fnMG2xNt##Kv->KAB9S6>L>7HuNs5z$s#t}PCl(4JK8H6+
zRIQe%OcpC*LUEN+%BCa3AqY&Oi@?J$Ow5Nc1V$i!xIhPKg(wU~XoZ+CLZFL41n7*s
zl0<V{`Ja);Xn7tSCgcf3;dFTT0*D_WKq0M&r-igAj_`Ftfmj4%Gx7-(LH8e$^{e%`
zy3$oRl6b;Gr!;T6Z<6us=~Wg1PS%P9L0vr{Wuva-<1~Y*ZQ>;ncs&oM<ZT9=R{DyH
zn1WeIoz;d=xJ*w+>vf8b`%C;SNbalIzh3@c#{R`3{gu?GBa0dklOCsMDwpkYhU=O>
zQ+eUOn6k;UXC~DQoF0F!<?P(0KV~O4ZlYCF^j!XUap^q<!=qTGlxgghcLpzI2I7Hd
zop&1=Rb{C=O13WFv&cEW&Z{wW;e<Q&?MZ<+BoVl;U0-vbb#Cc)|K)p_8jp83c{$Qs
zf#$i|iq9(c4X9IU6PsEtnf9^*eRi@sPh4r$f7vp`odAP8ZY+*k++U>^ZVLS7lRN7l
zGj9J74={mtxg3rG{8<h+`H2sG=lME{3bz&bt`6~VFWeRs6aad7&uwP}ZTX)=m&8A2
z<bEDn+B8vnHu!AKy$90a>eHA0^M}}$j0Nn&!DSa(^KN}#w`^tkw+ViJesRq{pPnhb
zetNmiJ2qydzrX+F*1FBVSA4B?vU;l?=0D88{Gim=ZOI}|s)%}cdtiN9T3S#2#PE$v
z718cb|70_~Q{Hs`<9eWKq`PVjExG8r^3<tQ%iQ<7J^n7e=TLQ9gAX_dsM2>==4BGZ
zu@9BzC*uzicE4Tlr0%{ayKp?GGHU1ezBRVdAIpHh4&2tewg0R3&kcRSg@f;(a14JD
z;%IJe?&)Lu%KdusfwggQ`!y@ee+~z}x_$Fz9tFJ-BydIo?Z=XjrXSa=w5UAB#>O(j
z<zV58Lu-NG6&Ghf2f7AA97RP%U4w&z2~#JMC6U?J&UgKj%FCVaAir0*&`d!05%AN`
z6Xp9r+EfCo{X*H>87s@zrIZ0)Md!+|UcGuW!Vv?gBUb@TCNq6?`MS0h3s!SDyZZY2
z9$j3!0H`VP6!i`bJ>79kGrqiJxO3lIL!|$1--Gso`c%#%ge8lre(JpULr0I%U$#bW
zIM%X1JMeD8uC~_J3ERS0V`Dqkbp*=xJPvp=Jv}o*4|M%4v)=2iT}OILNAQjj?j84j
z8PGd?=6!k1y*oPIXJ?iMW%;}j^G$DW@2Z@u>WTcYfbY`x`!@Nw9Y!(i$HsL>eu|!V
zYcRuC?!BRE^Qh>?M*&oGYR8%n<c8fu;-D00P960={75z_mFq8Ob;wx?VMSd_P%NO1
zy7hNM^|g?aouxE-ASTDg>A84uN0N`?@~s8uMrC^ny2nO(+S2Marz|s+To)apFUHaY
zZTxnryk82`26T3Ie(;;xe+-oc)TgyP+{BualgDfAM>p3#ImztsJp1Xt3)YWyuh?7A
z?Q}YAnT?mLRr8XQlkd7$5y#_z?e55&j+zZCEEA)HE$`LEg!=D2Ky(yuOO7sB81xtI
zX}j~9^U4=wM%vb`2P-Nocld}taaHOcjg{w%KR515?39hZm&k0m>4`VY^SF`@H7YJN
h9r{0Z;ER1d?z2;NqUud$cCPC`Qx&^WSufw__%Gd*;i3Ql
literal 0
HcmV?d00001
diff --git a/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_back_darkmode.png b/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_back_darkmode.png
new file mode 100644
index 0000000000000000000000000000000000000000..4873f84ff7f4750fa3adc70428ffb123502c1051
GIT binary patch
literal 2547
zcmb_eeQeZZ81J!-O&ofY7;XsC6~zzi_3L(9o89Ji-N!}lm~(+4Q|z_9t?aJ7wPkn1
zfy<Q1N5sVaL5?ZINzkZ#i3x{-Y|2E!v6)~*5ZF)|2|5SPgf9`_?&AVxDjF|o`}Xbc
z`8~hq<9%|gOFhMtCrz6KLC|DZ30nr9O~#cn5!}}#n6HD!9l?@?8U)=r#kfq+hSx0+
zl=PESUZGdG=Q6w!uyTUp6|Lbw5TGF_Codf2_!?1%y<(LlJCMPT_am?*IFJRIZrmMo
ziq%rdGF5zPnWvmzR>RW*l9vnTgc(2(5Ood?2mG?egdNB*F9X)bHip2%5WU8M<Qop*
z3U?{&R8$epwAxXgu#s>UZ6)kDP1+uVNu0>S@GOj=P@G_JJ44a%=nnzjRKdrTu|=c4
zz?%c9*7YERVWCjS8ltR<T7?lbO=CETkt7Nbs8%oQTo{$LSz`>WsPU>4)FnlR4MxtZ
zEY%$dP&yJqAQ-2Wwb3+zgkfPWh!IxY2x%B7@Nrylsp=ngF7TM>7XzZKYXD2cvB7FZ
zSF~#7FR0_6Z*c%p>vqR|jH@LOh`Z4A!a5MfXhOzCYvuJp5i1ilWvR-Gg>^vYEF+pA
z<5WdXSJZMv@sAa%bWAerbQ*=ph96!a$$}En9=XXzWI0`QAS6!WC~iXux}3;naEh^I
z&%wb0AA!0RLGsn#3MKJ!oMv#6!HHX-plbw9=l&5a@QhDU100B13UE~-7L=<HIG#zy
zsrVHYI0ovdoA+H#XQ`_ABtQ6|l@%Aju0p4spzU^)v=YN|-EPJuYdR<MqKkDPAU{?~
z5*Q!n&BA${LP-(NMrofd3-x+QaO3TnbS6)6w2d6IXBB>_(FJ4nf?>~lMcU3$XeKX^
zC{5YCD2-?0C_&PkS0rsbne7|1pQlRT6mtIm%wwEQqkWhXNdtwgA3Z%!iM69EzXT6=
z48!rpNpK*%(E_4?jBZQgW#G0V7@-YSi-7cR`eFp8DLy^KsbYQ=$ky$&9`;xIHLmU-
z)ZbS9##28|tNuszqsir~Ik`#%!xck}crarOjg$uabJd2w-88bs;9w3K%lH5WFYysB
z%79u01Ns?xr3r!(wz}B-^6={er+U|J(JTiqUYb=r=?+)j*+%v?w(NOt*UUFdHlyw5
zewov1Kk?#Ly5gAsp5x!BkN<A+KDn+0K~`^eKX8v{`o-)h)=(Ad^0W*NeA2sp*Ojk4
z$L0?1Ydf)g%fk2P&)M9vZ04p~Jkiv=$(u4EHNVT8XlYuLk%A}Q>oh-?@@O;MVJ=V2
zZ_Ied(gZn6iT@dxz2}l?QDA3<|9p?wU)Pu3XY1=ft6n)i|8!<uZdzmP<ix$ElTc+s
z&X<?kZ=C+g`9*BVf<$*jde7^gtX+3yP(4Y{CR>;EFHfs|=cwyc%>Gg==jDv1wXO9i
za{teI*@9iE0OJeO(an)d#Rr^kc+Sgp8Md^_6WwXGFTCAS#LdqT`WJT8bcjb9py>9V
z!taSzGdVQ34-eK;c_x;P{l0rsHv(uA!uLkoBW)9Ywl{VD0E8S(N1`7@?w$~u*1350
zjDo_TCHiipEvYWOv#4eAn@Bi4`cdR=Q^?Y}b9Q=xZ{wuBiIv~RdI<KyqPF)w5A1x}
z{Udhp>eZ`{bj;~k=UZ`q^g(3B_1$e%OM2J8Kz2R!scbL0fIMXBobD!GdTald#UE8(
z%%i%@UpIy}ys9K^?2aAT$BVOPPc2}7OFfyg_uJTRQ}Qck2Hn=g##NVBpE*@Dm^n1i
z(ein)p(WJ>BP)beXRiBBC*{bg2RHarptOq#pB+Ase57IO4mtHcH)B|BJag#6lT>d)
z&e!MKYd16)pcy-+T#iQ8NA~PL>UxV>Ywqi@Y)j6S`k$w?tzd_2HABdEi<&LDf&OGl
zTMQD)&(DC^16irql!1BVKzD548=h$^kFSKxX^W`?7wW0OL$Ts(m0$Hf=7d(Q+HUb)
zZja176mx*WEKzSvUf!OU*cv&PpiG!*8*(2$`^!o+r{-7RHTJTToo?Eeu+BEr?K!7Y
z*9^Z;G+Rzj%oUn%d}G_QeqvzVy#Kj5|3$lBneo8k53^T$kGYM%Wv)UGyRG24rau72
C-gtlj
literal 0
HcmV?d00001
diff --git a/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_docked.png b/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_docked.png
new file mode 100644
index 0000000000000000000000000000000000000000..1c88fc5d571d0ec91b735082cb9c512603b9ceec
GIT binary patch
literal 3642
zcmd5<c|4T)AAgXLtU?sZ>`;z1=4ec27}t!mFecWOW6V65n4>u|Nyt(m{I-K4RF+T?
zD;v2IE9>Y`v5jG4)vknAtz6k>N?yCa-~O)sYv(o3Jm2U0eSbg4`}_WUW+sK=?xeCt
zdkp{pDlX1sDs)ejUW%)s&s4c}i_lGp>+Ht|0A+RQB?IJ~+Xw*ix=b%$fv?*x0-eJ$
zqcJ$4pqYrph0p+CWh3I!=#iiR77B(l*+lr{%_caE$sodg%-v9KToM?;bdKSHyJOtF
z=rNIWJOgfH4YLvvAOkE=K!b@`QEWazM1;S$OMu4GX(Sx>9wLY&!tJCEVZLq@7>UCJ
zVdiEy1RagVz;@ux&^QzxgEfU=Q0N^<)D9$iI|79!pm2okc-Zm_4te7-!U$Bd<FYU4
zi3pDn2)G0!GCDfiEPA^chZl}S<MDVT3WLO85D)^vKfo5yL<lxt|Dy#m$fxs|Tmh5A
zhDj~bLODVK5e`NAAq5t9#Vnh@OcO*HQbgk-(Pk)VO7DRT`U;LK<VC%A&Y&Z~D3ArR
z1$+pLUcquBI06nog7a@ouPpz;0Yt5v+lr4rjfKTpalscj?1$1=Cge}ie6Iss5J?63
z93hVmI_!tS)R$(%C6IU^O~B!KaX3*Q4~p_JWEhDgJs1m^kq?v2;6(F{f42uD(*z(9
zjzM8i2ox59#(QBf1aor&8v7Z_f`CGOfVy!Q%&-Ih3f)dXLvP$4ppa@9Gy(0uf*Eu|
z7>CEAK{+#7v~Uo~WrxFID@+ndoG1<tatuYc{rB@OBoc+k31db<3w)}RJ<P>{ghS(T
zI0VKF{XSebH-ZbBFQBpMpbMD@hxjpLG8u$WIxRE|2Z9JRnt?{(vDi=qEewl6phC?-
z9NIh-1%hE8_meqvp;QGQ_cQ*_{T@6fRE4ytzidZZn^O4@oSA&+U=J);&u(zv@+gW4
zd#@M*jV`SOBAhOj0LXwZPc#2A10T#rM}Uyg|DcNxFg_<t5KZHOcHt0P|BLjHQ2a<~
z*?vd``OjItU;AB&e}qGQLpoe(SkS{t%LCa^pW{Idtrjhl4*-g-E@V3|(Ycp-tO$+S
z&FxK=+vlxrqVESZoEf;j@ym6`TKrmdN42#hk`pIQVr1+tAak^g?MGujO?qpO{vqvD
zHRYZ@)@0Cf=sFkqkax9h%U4c?&Y?!xhLT5C<2_vy<2|I{u6V)m>NPj(CVp9L&g@tS
z-yi+VrXX+DW}!c6PoMm!)CSdrdOgZ2*#!7H83!0(B)k6a@^F|sDOZw3F?#K~J^@wF
z-woWEO3H4<*{t)OyK%TkFGEo$LH;~E3%OXB=D5_PrGm5vf)gHIkL-&ZkVqCw%gXXP
z7(6GeHtRHqU;oL`lc^UCNEiOG3aBz|H*lc>&HK)!vc%hf8|9IHS>9K?O#F+e#yQ2a
z4^hXj6f>93=I1vGhg(w)0$33hTO(s#{sJdZv<HSqMn(!od9?>8#BF|lezimlrb^HD
z3UjP-P=WGBNkn#Za#B50JUjlTuM+oDU84mS`%rG5&mo`Z^EL1v>(UQ}D<4QtLMSUM
z_gNAMahe04n`QTX{r&hib>+y&oSHo*ryuVuI^k)mseHnqR!2uiUR=WhC>jnfmwL-a
zEG{rGXH&`W4w2Ph&aQ1@Z||4=jfdvr96V3lnkmT5y;*l~W+GVb&W;%3V@c~?xdaS>
z5YsFSG@MEnhJ}SSj!#Yw$(>iR)wWf$)g63kwFU-<o3;dJrXEroHfI6>3JMA{J$LU8
ztsUH8+KHK)o3maGdvtS4S$TVmo~;V`n535fe8(;2*Hce#>j2iaES=jlz%nZ<i>+W2
z$>aT^1)PfMBVE70c0|#YkT>z#CrWG<STA}dn_w=I)cbqNT#Fg`Hhub5%Vx{{f{RKq
z!QHULugb>U<3XYD&8^YSY%NNFQmn}(_q;iuO5fOLTGiFnvB$QRv>&mN0o*T8d|&za
z2L#OM5@V`2bDjriTgShP^|0D9G^VAoCRw*$=F*YkP2_7h98Pm#gM+79_}%<PL;_;U
zaYJOX?0F%VJCznf!{sh+87!fbdNtq!4F_k;Wc6bu5=nuFheyGSmoFC;Z9hxUs1It+
zeZ4WUVfBWfiVLiekdT@2@$pFlbX;Tc87%Q=X=!PEp%OVFXJ1lLQBlPcu~;EdoZ2@0
zbrf!1)vZ@kIk_d3nWIxzuBF>vDGcm0Iqljuv?I^`@(F|Ftu80pEbL7*(~8tn$d2BR
zGBIbn44-m+RT`HHoif=1p>T1Hu2V_8BAiaAE4cOUi5^;igmz`Es_IP3&BBKbTguYw
z^lTp){;*zlUBQ_%KLrN{E>673t|ahk2PF6J-<ONHSbHQ)gtb~yALLsLr=N8fL__Ru
zRZGbr!z+o}>1<Dpt)IG3_jsN%0`64lo;ENZZ|biym25ao^UI=%YnbBwm3z#zT#Fv`
zQcGWB3+^Jjy1HWd3vXXF$r-^=^ZiqA`lk%1_F5;dsz}ybzf-B=nSMy`gS*73eX^Y)
zD7_1Z`_EC-$ZFz+B9D99qI=_VgC{#5_WQ)CcN?@!x1Q?g==g$2Bo-9+{@mkhT7%F`
zW2KSd#(r5NRi;iG99)2)Onr;Ojl0|{O*;j;mm;8`a-P-EHhQeR?RzdacV7JT_R*!a
zllLi(Un_b}I=Wt855qw!hh=w47UNYK{IAv3%}H8Y$u{-hcTsjfq&KLZA5))FRD}rC
zK2rJ1T&J(juHHR*Iy#n$6$t7~ObIThsParcWO<}K@MgxUZ@f)5Aac9oE;FCZ9HB9G
z7Ev1^Iu`7<w(m2UjSZTfQ9XM5DFahF_l4{Ii0ZAUT@RI%?RDCA62I;o9Y`1*9j%C-
z7?|A&ykHmlFdE#h-~i{NpKN{t`ekie__n8~C(ay&x|gn%Vr&w$B`mJ@$5R>!j|T?_
z_1rx?mTpN-0sN;e$<|mqYkP_6`PJ~GilBxV3!_^tEiHXOO<_$sZBuj2{LJK%@ms%d
z*b;&~?DI)!3bY3<Jq(PVymE1I@t|X9s!GV>KrNr11#XI??cAxXzI#ypD=(8bhnuLT
zngw}ye%R{4W{<0t<-tvj^))rW-a|SUQFrY+;K7BeC*QERb>!96Y_q^8%IHmA^iwAd
zJ@(gJzb>4Y&nZS6PBEU8e>~Ejsg)@2l%b24tN7A)=Ozu{>LrhYclKGM&riC|#=c_}
zwKW8cNt{dV=$>OQUd%%Z)9*i)TTsx1x3IXO)%<zAb9g+I{KooQaGSh_t4&SucOji+
zPZS4zaV9zHZ4jyVxPDhp&%4IUmtRc(fa|P!ZRnA|u)DX~A+Rqyt!>!9cF$vBAkz87
zkI$wLbXS=w0}Q{c0DpgK#z@leD-l#+TSF`RHNCyXCp#Dix1F3dP)mtYYFru~9u6j0
zT4pAWD85lWjDfmy;fuM8^BE|&>9aR<ux)ojA>PN-MRrjP24m^F@4jQrjEbYXJ4Sgk
z-?q2gkkq@)v7Lo7BJ_MoP%UrNY5v!j^C@LzHqHiWXCtt62;EQGZ$G_OX5?z6vBtQ$
zv%@%J#J7f(4M1JEy~?zKTKZEBOQ)Dw{&U?s-`?tE1=TIF{PF(ErbLKVt)-Ep7>)Y3
zmB;;;C`Ss;J@85~Rzb>^s&u0=Z1)0xudnCjUkeLb#35AXG~LEX`tQ!g!JS-gACmYR
D=8d64
literal 0
HcmV?d00001
diff --git a/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_docked_darkmode.png b/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_docked_darkmode.png
new file mode 100644
index 0000000000000000000000000000000000000000..fe51e11921ecb35c5535e7c446769af7f66be893
GIT binary patch
literal 2810
zcmcIm3se(V8jh_}EK8-jfcRpFisopZKuAUc4GBuXuz*;Bl4?jMA>=V}5=f#b5>wH&
zNOz?^0L5da^%X&CG(sC#P&iP~WhtQrr3fM-rHFt=DYz3}$L@Bwk8?Wb+_`t|{qFa_
z|1$?7BQ`j{x#&#{2II^LWk;j4-aZ^1(Dz?ocNs&cxysNu6$az9z&>VSa`P8rFmskj
zVq(>?+>M|BmJ|3wI1wUf<w_Kd!2|?pm3)B|QUi&QSfXHH2g=H^fJDf^Zt>%ixJnk3
zBnjPtK$~_%#0Yjs1#}@cC=dwHf+&F;Qu6_=T&7TgS_XE47ev?gZ6X$!fT*PmEYmI!
zh~-8CEEs_RKLQmmAp24Pe>#CoCDAFqYXJ(0>`x^56Ujb!5*Z{>K_5CW^<YtHh)@JZ
zv)50_LcbW;B(+)z5{Vj(hM@5wz=)Vgrqk&}5`{>i;86r#rBkT+TD(HFe42p`sRW2b
zsg}SBz|P1|gj3WEEUM|G33BBOtwJ^BCe&d>Eni6_6G(QGCV)c03{IJX$R>mf1w=>&
z$svVWg<{DwSY;BdhE+-M|Dc{Z{)qt8wOsCujGxs-E}s#hQir6XW=uKcXVIz{of0BO
zLn=505kMiSsG7^|)+j+10`b)_5(C4s=|DwJs|>JM_Q249)mtPAA*@m1UbzFY`D%!P
zrI08jJjoYNrpHhypr0Q|_FY4wfh5u-lnV<bBHe#OeLyk=B>VgXie`<Fujc<ESSSER
zFe2xpHcRAuF+@}<#8_a)lOPM0!3ZiC)z0VDeGZEiiNGR>3_VaqZwLlBAuKAHPNm{0
z1oDKsTrS8_sMLIg0OGJ2SkylRi9`sBXk?nNfF{5T{i$TU(AO8j(?nD{o=Q)INCJ^R
z**8%%eV+{rQtVkUeP8$+@BamnpjF71{caw6ZQ9cZ43((R!0M)|XA`u2Y9*5Z6Bz^Y
z1@=l{U<LLRfP~noZOQNUz$C3E2|`K#PhL#IRIo^`;Uf@JjC$+Wq#hB~pJ*@JNmGdb
zY30P(D<wV+NBf3-In%JvkC~PSDbPNLpbgCy>ah>)lLii(8Kcebzsuc!V$0GuI>awl
zKKQ(mz4v(ayJf{4l_4t~-GU<TTtDl?GrKVT^|zvu@hjKN-ORof>8>}smVR9r8}m<W
zh&#{G^<3);?tT+Dw<xTy#!Ty>z@Ih*BLgSu?>&<}_;O%Z&v;M!^X~kild63eWir`*
zGgOwo$4p=0m@(U{bhg(=0Q)E~d%oe}e8W3>7oOfF)a7)z%WHFk)pLUZ=6(XxafM^!
z%0C9IY)gHK87eL*K^nT^`^L1GfodMj!1yM6m)W$nbg^c*tL1TW(75}hj*rJjmfY$r
zvTeq7XE*Iw{$tOoHLNcVEHlLSeQEOwyj+1Sws}~h!|369Wm9ZiT$Ge|b6~rc0~J(V
zj;?$Dc3_oP>AoM<wJ+4W4~FMgI+^!eFyARCH@qC~YAe3xInY#^b&c=(EXi0uUMv0X
z;D*60o#jA3g?+HtVzHbbD-rMgz&T*wg2J3FMWb0SGvoVarMYj-&9~_HN~O}GhEJ+f
z7ZrxsK5B5O=qk+F&=Yqm2bs0?lF71k-qWU?O3#zW#m0V8U4K_&?cnCLof)R94ziRC
z(-F}PAb=O9(?xv{hD)zJUVBc1KX0XE%{Me1?i!UEHH7n#<sl3TeWderGQMdwljcWn
z&)nb^E0tbTz2FwL^4EK;4K&`x)jNDRuQ{H0Z)agnOHb4(Yw3Gs3!dM(KO8jpeZc$a
zWzO42zgd-YvO;_<AjP4)Vra~Ey5aiXHLWpE>fi78tTx79DA|(dPy6s$XBVxwd&HAi
zm?k&eR_3_PT4voHm+9SesKd$W{If4^wx3wryjn23Fz2w1bTU5pdO=r4bX|D(S<|1Z
z)Xtks*6h}VT?sdt#&h3g@y1Gc+OO`n5jxAqY$aFc>o(^d3Ct{)8Y|#%-0h8h&VwF@
z9(#9IJ2&~=$nr=mwt4fa-ncSYc~|=x^-0jS&!xwVl=jY6*PFc$a^hN)9z@B7qpJq<
zqU(x28(E*UIrHHn@5P(m9TcP`|6^rArF%Fo-J5Ba4C@SgTdQ-*j>bIov~9z6-*+sy
z=fY!Y?kr|0nQh0OxXbUSM@b)v4~M<HdYv;z(Q@Pnx*j!M-(NP!X}LsR@~@|>Hi{Q%
zE_%fqMn*<>@j>I(+Fs9&zeU$I>%Kl~YR|~L!a39HaBQd5YK^!x8F%w-lb7~%&XZ=H
z+e4|_s$}En<A&Wk=G0ta-akY|gU)+zndjDR#+oaapa%~}2zNN^=T@%st`UdfZsX5K
z;<{ab<Ri&aN6nciy)qR^J7axe32}Y2(=D4DaiX-{w61nFQ_KIVYk||nl!UxvxgJ=@
zPyXaq(EQZ>``&ENi>7hMdC%_F_+PY^hPRo)r3OWZW=K2MPrcDED2RL!Xt8vkJE)zX
z-V~oT)Oux5R;-E33*V;tVNb)yb+5NR>W-2ZRjJp$7KAHI+dUEV4C~Ug_)(`b$H#2-
z`bQ_KuDK1jhWpnoWa7F50`&#S+^1N^Ir+wKLF%`c_w_FNG}$;%Q}cLP|G-;sNxL%F
zjkdIn7B)5DillcP<S(B8-D*l`w7N#LCG5&?4-_@xs>vH$T>QQN$hPt;8`hqev)+b-
VfHkC3x%R(PPDlj%Qt&qYzX3LdVM71_
literal 0
HcmV?d00001
diff --git a/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_home.png b/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_home.png
new file mode 100644
index 0000000000000000000000000000000000000000..20f1d887aedebaadec7f31184bdfe3e662401522
GIT binary patch
literal 1362
zcma)5dsvcZ6eq3COPOfdW%DV^ZrZSmmu5@DVMeK8>Y7WZW@(O;T+M9eB{VT<`aG7k
zn)f@oE<`v`G!hdlR3b#c8xe|l8>DE0=1%!ff9^cb_kQR6zW4o|-#O>~uHt;XmYJ+I
zK_C#zum>?m;Z6Mb7#YIa&@1aeAQowH-T|Hv{vWHXtnBFM=<e<w92^`Q8&j**TCH|w
zW=5ye&3!WP0UQ|_Q79BrskFVly|A!wfjKuf7x4M{d8JaBnwknAkw}F7z<|f&A$<GE
z#9}dz$7^nGX0cc_8jVh;L(;OcvZ|`8#>Pg#+uGV-5Af^tdQj5Y*@;G@7g7WV2lw^$
z&Cbrcy1D|=)YK%ANCpN5N=ix~<n#IPDIy{wJ3E`nWcKv*3=a<jJ~cJf+S&>ZaQ652
zkB^VPe*JoAXb4sSfdMK7NivzNx3?D%jYb1`<#IVVU0q$En!#X*L?S?ds;;h1AP_)}
zAPmlOI2^#?IGhE}g|<Kzp-{LW0Lq7!LM=f-K_n8XzP_H#W&;}}s;H>Q%*+JYC=?2V
z!GL%y77OKo5-yhu+n_ns)zwrgwWXy6T1_UCp`W0EKp^Dh<v}6PaFC%=sbDCRlamt@
z6CeiW0^~4=G>fQ@x1sX<QD1+=qAyI$kd`a0R;^yM1V^rBzv>>;Oz3t0N?$cpk-RL7
z-Curq>S*LLrm$bkV3lSj#D<6Y;{swYW|gxi%Zs*{e(6A+T4!*U^3;3jAJaPzMpw75
z7$ut5KkB^M^5?QL0f}~RdGFoYzGCL-{5n-sF6Va91!l$rZes=YHif6k(V{Rhzm^#u
zalK`;ZDwOVJvHuRU~uxaZ`Dc^TF`p)x#X>!QNDJ?g&SrFgh3=0gAPcLj)}XDS)x}j
zQJ<v!mA=U?%l=1~tj%`B)z`KbFE+KKzBz$GdPW=@wWdy+ogj$E`&FZwuZ!Zp<C4}~
zVm#p%keE^NFI+55ke}Hcsp&xT<5FtE)tFl*wILQcp5N@wHNu;kTknn!mb^C}u(Xb{
zz`fa%H*memyTCaq1Ap2W>D!)vB`lDpEI*IgAvkB_L`bG*pdVVjPYM(XQGXx5K?%)o
zLs2>$w}*(t!qJq_*t<Eng8LR58%v)#oqHZo6K-pf@#;>Nf;aRca6{9uQ_PEv<)W-?
z(KCaVz2Og5`HT(EW0DOY#`%Z2w?rbt$vWfcc*OArS@cn<@fq^g9Guwf{7Pas%bMNJ
zdS?{t^03BBAX+^7!xLN9zWoH>T^@;-lRUM^DZ}5M%WCC|WMSxw>0+B=^sbRM4jZXO
z$_Lnf*!02(cHH5lbT?VLt;YvjoU;yD7jgjM%PiY#eFT3yJ0;{s)Z^`kQt+<!k~_Qu
zviuCA6KQS^l4A0z$7lHCo-;d7g&3e}+$(1}x<hC;kGbLH_zAlm>$e4s;^kW?4ngm_
zE`Q~cX8O<Z(zEsV8qXf?Mb7nT$Cn62o198j$sS3_dA5Umo!g_|H>CWM;Mc75nWk1-
zsTCC62DdZ&CLU}r=+K8QH9PflBu(;$$CuS~(S5S#8@}fRZa&GnX#a%YkXXbwx5=MX
z``wiJ|MZgXydqYc;eH`$&5TsFXJu)BBv++(-ld-NA|wj=+9rOa!u0;M{>s}ZN=&zg
jp|o;zi!=ZHCR`6amaD0~y#7)m{38ggr!VHdM;P%x23q9L
literal 0
HcmV?d00001
diff --git a/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_home_darkmode.png b/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_home_darkmode.png
new file mode 100644
index 0000000000000000000000000000000000000000..96dc83e4a42d70c1b11ac5a55ea5eb8cd75e1e20
GIT binary patch
literal 980
zcmeAS@N?(olHy`uVBq!ia0vp^O(4v{3?%p7eQ=(EfiWY%C&U%V?H>iS4*_MFJ{MqE
zmzM<j1v8iwPFQ>B+}+pje*SoQ_Tb9?Tpg9&|JF;%JijfpWO-*ypo^KYc~ESA_nHsA
ztz3e$KC_1!6n_!c@R_*xN!py_HCyTq=gggUaniy|?MuCzA69H^h|Zp|b=B<p2PGc`
z0>b30*|@*0n4jWq;gIy|zKGh99kpj}USHgEp;$&A80||uT^vIyZoR$k8h+S8g!O?F
zcj^bHLXDPyjKZ$qJ6m_`-hKM-Z=Y)^yB^s@+{vH0dq%aAaitu;AQIT=<@xp3rAvP$
zy;7MXy;6S{7k&Q3%$mf?)m#uB5~Fl^!4@93r=m)tT64E<TJ6;MO6v5gt#7SPb6q!g
zS=4*(tJ=ib0ZZOj6rVo7V5@I<#(RMk0++cf?<&vlvtrdMVZ3YmE^z(23+e$2<s}SK
z3ljnsIEfmhoN8+nY~)&eV1{Nl6Oi%vK#S&VmSrqjKFn8_<*>~VU17l9;(OC(gF?VT
zew|sHRA+K^s)$ZwynjDjB9%2Z@o9hj@z9yqKg!oksmhKrP8D1bl-3+)o+@o5{UvQu
za+deA^S<)eZhOAF(C5HfE5hn~GjCG+m+o&3f0++AEUdr7$EqdsvefBVI!p9|LmNK}
z*BAXVwz%BS@myD^`ADnrrX%|0>yoZt>&?Br{aWc8JyVg;b6@KwX1@Ay&*p-y%_*L#
z{^ysm=`T&%{PpeY3#V^a$E?)Zo3}Wqvw!=8=ht19w|5|cm|EtWFQ%k?JmTvKOfn3f
Lu6{1-oD!M<_NCyP
literal 0
HcmV?d00001
diff --git a/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_recent.png b/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_recent.png
new file mode 100644
index 0000000000000000000000000000000000000000..4f0d314e2621d018c3cd2e4267cf4cf82a78943f
GIT binary patch
literal 278
zcmeAS@N?(olHy`uVBq!ia0vp^O(4v{3?%p7eQ+K~IR*HHxB_W3aOlvXS731D$dNyP
z{`~&^8>ry@`}c3(z6CO@t*tk0+O&D|W?NfZAou_O|I!nsR|8q1B|(0{3``sX!dw~0
z&!m6(D0J#1t5jH`B>TrxD!+gV@;qG}Ln>~)y?T=OumO*&<LOWDj(nQ-FWQ&&(?pJ@
znOy%Gk7P>$)d4|WP*!pH)Y~Ek3+0ck%$oDNf%ERC$_@LN)Si65+@j0wqw%{iOg5Zz
u=kcQOsZZh^l}((KO_)H0lQP7Be}}|<Jmh~yiM-bb33$5txvX<aXaWF$9A~fq
literal 0
HcmV?d00001
diff --git a/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_recent_darkmode.png b/packages/overlays/MiuiNavbarOverlay/res/drawable-440dpi-v4/ic_sysbar_recent_darkmode.png
new file mode 100644
index 0000000000000000000000000000000000000000..f53ec649e615e8491fb6abb63d169ab7e0faa1ce
GIT binary patch
literal 205
zcmeAS@N?(olHy`uVBq!ia0vp^O(4v{3?%p7eQ+K~DF*n2xB}^ZynuIaZ52=vS4ogx
zFoXa0-5=lXWwUX~o_?MiC>rSL;uunK>+RLuyayBnTpaC=HT>3}!PR$SSH`j?-mt2r
zKs7+%uwa{9mTBst&#^sIIN#?w`Oh@C&bRjEiUzlg7B>c|g@RIyV08!V`R32zx~(4j
Q*9XM+boFyt=akR{0CQqV3jhEB
literal 0
HcmV?d00001
--
2.25.1

View File

@ -0,0 +1,81 @@
From e799f913b42c58821408527a73aac4115d69df11 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:42 +0000
Subject: [PATCH 18/18] Revert "[DO NOT MERGE] Reduce padding in QS for small
screens"
This reverts commit c3182c54802105c614848b26250c2682eb9900bf.
---
.../res/values-h740dp-port/dimens.xml | 27 -------------------
packages/SystemUI/res/values/dimens.xml | 11 ++++----
2 files changed, 5 insertions(+), 33 deletions(-)
delete mode 100644 packages/SystemUI/res/values-h740dp-port/dimens.xml
diff --git a/packages/SystemUI/res/values-h740dp-port/dimens.xml b/packages/SystemUI/res/values-h740dp-port/dimens.xml
deleted file mode 100644
index 966066ffe56..00000000000
--- a/packages/SystemUI/res/values-h740dp-port/dimens.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- ~ Copyright (C) 2020 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
- -->
-
-<resources>
- <dimen name="qs_tile_height">106dp</dimen>
- <dimen name="qs_tile_margin_vertical">24dp</dimen>
-
- <!-- The height of the qs customize header. Should be
- (qs_panel_padding_top (48dp) + brightness_mirror_height (48dp) + qs_tile_margin_top (18dp)) -
- (Toolbar_minWidth (56dp) + qs_tile_margin_top_bottom (12dp))
- -->
- <dimen name="qs_customize_header_min_height">46dp</dimen>
- <dimen name="qs_tile_margin_top">18dp</dimen>
-</resources>
\ No newline at end of file
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 9172bfa823e..cb6f550ec49 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -490,21 +490,20 @@
<!-- The size of the gesture span needed to activate the "pull" notification expansion -->
<dimen name="pull_span_min">25dp</dimen>
- <dimen name="qs_tile_height">96dp</dimen>
+ <dimen name="qs_tile_height">106dp</dimen>
<!--notification_side_paddings + notification_content_margin_start - (qs_quick_tile_size - qs_tile_background_size) / 2 -->
<dimen name="qs_tile_layout_margin_side">18dp</dimen>
<dimen name="qs_tile_margin_horizontal">18dp</dimen>
<dimen name="qs_tile_margin_horizontal_two_line">2dp</dimen>
- <dimen name="qs_tile_margin_vertical">2dp</dimen>
+ <dimen name="qs_tile_margin_vertical">24dp</dimen>
<dimen name="qs_tile_margin_top_bottom">12dp</dimen>
<dimen name="qs_tile_margin_top_bottom_negative">-12dp</dimen>
<!-- The height of the qs customize header. Should be
- (qs_panel_padding_top (48dp) + brightness_mirror_height (48dp) + qs_tile_margin_top (0dp)) -
+ (qs_panel_padding_top (48dp) + brightness_mirror_height (48dp) + qs_tile_margin_top (18dp)) -
(Toolbar_minWidth (56dp) + qs_tile_margin_top_bottom (12dp))
-->
- <dimen name="qs_customize_header_min_height">28dp</dimen>
- <dimen name="qs_tile_margin_top">0dp</dimen>
- <dimen name="qs_tile_icon_background_stroke_width">-1dp</dimen>
+ <dimen name="qs_customize_header_min_height">46dp</dimen>
+ <dimen name="qs_tile_margin_top">18dp</dimen>
<dimen name="qs_tile_background_size">44dp</dimen>
<dimen name="qs_quick_tile_size">48dp</dimen>
<dimen name="qs_quick_tile_padding">12dp</dimen>
--
2.25.1

View File

@ -0,0 +1,28 @@
From e89e2d8f376fcb77078ba06138afa395f91ab55d Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Wed, 5 Jun 2019 05:10:00 +0000
Subject: [PATCH] WiFi: Relax throttling greatly for foreground apps
...to the extent that it virtually doesn't exist
Change-Id: Ic01d08ef9c09de128ac08ecebb52aa7f90cf9e4e
---
service/java/com/android/server/wifi/ScanRequestProxy.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/service/java/com/android/server/wifi/ScanRequestProxy.java b/service/java/com/android/server/wifi/ScanRequestProxy.java
index 0a9a446ab..3cedc343e 100644
--- a/service/java/com/android/server/wifi/ScanRequestProxy.java
+++ b/service/java/com/android/server/wifi/ScanRequestProxy.java
@@ -67,7 +67,7 @@ public class ScanRequestProxy {
private static final String TAG = "WifiScanRequestProxy";
@VisibleForTesting
- public static final int SCAN_REQUEST_THROTTLE_TIME_WINDOW_FG_APPS_MS = 120 * 1000;
+ public static final int SCAN_REQUEST_THROTTLE_TIME_WINDOW_FG_APPS_MS = 1;
@VisibleForTesting
public static final int SCAN_REQUEST_THROTTLE_MAX_IN_TIME_WINDOW_FG_APPS = 4;
@VisibleForTesting
--
2.17.1

View File

@ -0,0 +1,62 @@
From f6baebedc09b503e477f7f4f1d83ac494d5028d3 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 8 Jun 2021 12:00:26 +0000
Subject: [PATCH] Telephony: Disable SPN retrieval
Kills "double carrier name" on lock screen
Not ideal, but not worth wasting more time on
Change-Id: I06dd17989194590972e526de85dbacf74eff805e
---
.../internal/telephony/uicc/IccRecords.java | 25 +++++--------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/src/java/com/android/internal/telephony/uicc/IccRecords.java b/src/java/com/android/internal/telephony/uicc/IccRecords.java
index b33e899b9..220ed875d 100644
--- a/src/java/com/android/internal/telephony/uicc/IccRecords.java
+++ b/src/java/com/android/internal/telephony/uicc/IccRecords.java
@@ -717,35 +717,22 @@ public abstract class IccRecords extends Handler implements IccConstants {
}
/**
- * Return Service Provider Name stored in SIM (EF_SPN=0x6F46) or in RUIM (EF_RUIM_SPN=0x6F41).
+ * Return null, disabling Service Provider Name.
*
- * @return null if SIM is not yet ready or no RUIM entry
+ * @return null
*/
public String getServiceProviderName() {
- if (mCarrierTestOverride.isInTestMode()) {
- String fakeSpn = mCarrierTestOverride.getFakeSpn();
- if (fakeSpn != null) {
- return fakeSpn;
- }
- }
- return mSpn;
+ return null;
}
/**
- * Return Service Provider Name stored in SIM (EF_SPN=0x6F46) or in RUIM (EF_RUIM_SPN=0x6F41) or
- * the brand override. The brand override has higher priority than the SPN from SIM.
+ * Return null, disabling Service Provider Name.
*
- * @return service provider name.
+ * @return null
*/
@Nullable
public String getServiceProviderNameWithBrandOverride() {
- if (mParentApp != null && mParentApp.getUiccProfile() != null) {
- String brandOverride = mParentApp.getUiccProfile().getOperatorBrandOverride();
- if (!TextUtils.isEmpty(brandOverride)) {
- return brandOverride;
- }
- }
- return mSpn;
+ return null;
}
protected void setServiceProviderName(String spn) {
--
2.25.1

View File

@ -0,0 +1,33 @@
From 8a3d38d3148713836c12d85f7fc4a6a366cc00e4 Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Mon, 4 Mar 2019 14:27:56 +0800
Subject: [PATCH] sdk: Do not warn about SELinux and build signature status
Change-Id: I6e1ca9f2c2f7763364a9a370f444dfe8059d0563
---
.../org/lineageos/platform/internal/TrustInterfaceService.java | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/lineage/lib/main/java/org/lineageos/platform/internal/TrustInterfaceService.java b/lineage/lib/main/java/org/lineageos/platform/internal/TrustInterfaceService.java
index 2dcb938..e9f2dca 100644
--- a/lineage/lib/main/java/org/lineageos/platform/internal/TrustInterfaceService.java
+++ b/lineage/lib/main/java/org/lineageos/platform/internal/TrustInterfaceService.java
@@ -197,15 +197,6 @@ public class TrustInterfaceService extends LineageSystemService {
}
private void runTestInternal() {
- int selinuxStatus = getSELinuxStatus();
- if (selinuxStatus != TrustInterface.TRUST_FEATURE_LEVEL_GOOD) {
- postNotificationForFeatureInternal(TrustInterface.TRUST_WARN_SELINUX);
- }
-
- int keysStatus = getKeysStatus();
- if (keysStatus != TrustInterface.TRUST_FEATURE_LEVEL_GOOD) {
- postNotificationForFeatureInternal(TrustInterface.TRUST_WARN_PUBLIC_KEY);
- }
}
/* Utils */
--
2.7.4

View File

@ -0,0 +1,561 @@
From c17ad9817f16ca7ef8d0209713dec79a0d0afbac Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Wed, 26 Dec 2018 22:38:54 +0800
Subject: [PATCH 2/2] DeskClock: Revert date and clock to Lollipop style
Also added dynamic date format based on alarm presence
Change-Id: I04ce41d4817c794edb1579dc3a493a1cf1e8d658
---
res/layout-land/main_clock_frame.xml | 1 +
res/layout/date_and_next_alarm_time.xml | 6 ++----
res/layout/digital_widget.xml | 4 ++--
res/layout/digital_widget_sizer.xml | 2 --
res/layout/main_clock_frame.xml | 1 +
res/layout/stopwatch_time.xml | 1 -
res/layout/timer_setup_time.xml | 2 +-
res/layout/world_clock_remote_list_item.xml | 8 +++----
res/values-h560dp/dimens.xml | 2 +-
res/values-h650dp/dimens.xml | 2 +-
res/values-v21/styles.xml | 8 +++----
res/values-v23/styles.xml | 2 --
res/values/dimens.xml | 10 ++++-----
res/values/styles.xml | 5 +++--
.../alarmclock/DigitalAppWidgetProvider.java | 10 +++++++--
src/com/android/deskclock/ClockFragment.java | 21 ++++++++++++-------
src/com/android/deskclock/Screensaver.java | 8 ++++---
.../deskclock/ScreensaverActivity.java | 8 ++++---
src/com/android/deskclock/Utils.java | 16 ++++++++++++--
19 files changed, 70 insertions(+), 47 deletions(-)
diff --git a/res/layout-land/main_clock_frame.xml b/res/layout-land/main_clock_frame.xml
index b72f62333..a1fa3557d 100644
--- a/res/layout-land/main_clock_frame.xml
+++ b/res/layout-land/main_clock_frame.xml
@@ -38,6 +38,7 @@
<com.android.deskclock.widget.AutoSizingTextClock
android:id="@+id/digital_clock"
style="@style/display_time"
+ android:fontFamily="sans-serif-thin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="none"
diff --git a/res/layout/date_and_next_alarm_time.xml b/res/layout/date_and_next_alarm_time.xml
index ad25502a8..e4edff237 100644
--- a/res/layout/date_and_next_alarm_time.xml
+++ b/res/layout/date_and_next_alarm_time.xml
@@ -25,8 +25,7 @@
android:id="@+id/date"
style="@style/body"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAllCaps="true" />
+ android:layout_height="wrap_content" />
<TextView
android:id="@+id/nextAlarmIcon"
@@ -45,7 +44,6 @@
android:id="@+id/nextAlarm"
style="@style/body"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAllCaps="true" />
+ android:layout_height="wrap_content" />
</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/digital_widget.xml b/res/layout/digital_widget.xml
index c5b4837a6..7e2bae454 100644
--- a/res/layout/digital_widget.xml
+++ b/res/layout/digital_widget.xml
@@ -43,13 +43,13 @@
<TextClock
android:id="@+id/date"
style="@style/widget_label"
+ android:fontFamily="sans-serif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="none"
android:includeFontPadding="false"
android:singleLine="true"
- android:textAllCaps="true"
android:textColor="@color/white" />
<ImageView
@@ -63,13 +63,13 @@
<TextView
android:id="@+id/nextAlarm"
style="@style/widget_label"
+ android:fontFamily="sans-serif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="none"
android:includeFontPadding="false"
android:singleLine="true"
- android:textAllCaps="true"
android:textColor="@color/white" />
</LinearLayout>
diff --git a/res/layout/digital_widget_sizer.xml b/res/layout/digital_widget_sizer.xml
index f524cf536..7b08ca590 100644
--- a/res/layout/digital_widget_sizer.xml
+++ b/res/layout/digital_widget_sizer.xml
@@ -46,7 +46,6 @@
android:includeFontPadding="false"
android:ellipsize="none"
android:singleLine="true"
- android:textAllCaps="true"
android:textColor="@color/white" />
<!-- This view is drawn to a Bitmap and sent to the widget as an icon. -->
@@ -71,7 +70,6 @@
android:includeFontPadding="false"
android:ellipsize="none"
android:singleLine="true"
- android:textAllCaps="true"
android:textColor="@color/white" />
</LinearLayout>
diff --git a/res/layout/main_clock_frame.xml b/res/layout/main_clock_frame.xml
index ab960728f..2042c5b04 100644
--- a/res/layout/main_clock_frame.xml
+++ b/res/layout/main_clock_frame.xml
@@ -51,6 +51,7 @@
<com.android.deskclock.widget.AutoSizingTextClock
android:id="@+id/digital_clock"
style="@style/display_time"
+ android:fontFamily="sans-serif-thin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="none"
diff --git a/res/layout/stopwatch_time.xml b/res/layout/stopwatch_time.xml
index c1895b488..71320fcd0 100644
--- a/res/layout/stopwatch_time.xml
+++ b/res/layout/stopwatch_time.xml
@@ -42,7 +42,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:duplicateParentState="true"
- android:fontFamily="sans-serif"
android:includeFontPadding="false"
android:paddingEnd="30dp"
android:paddingStart="3dp"
diff --git a/res/layout/timer_setup_time.xml b/res/layout/timer_setup_time.xml
index 572063fc6..14e9ea3bb 100644
--- a/res/layout/timer_setup_time.xml
+++ b/res/layout/timer_setup_time.xml
@@ -32,7 +32,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="none"
- android:fontFamily="sans-serif"
+ android:fontFamily="sans-serif-light"
android:fontFeatureSettings="tnum"
android:includeFontPadding="false"
android:singleLine="true"
diff --git a/res/layout/world_clock_remote_list_item.xml b/res/layout/world_clock_remote_list_item.xml
index 9a69cb517..f5f4eaa21 100644
--- a/res/layout/world_clock_remote_list_item.xml
+++ b/res/layout/world_clock_remote_list_item.xml
@@ -58,13 +58,13 @@
<TextView
android:id="@+id/city_name_left"
style="@style/widget_label"
+ android:fontFamily="sans-serif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
- android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="@dimen/city_widget_name_font_size" />
@@ -73,6 +73,7 @@
<TextView
android:id="@+id/city_day_left"
style="@style/widget_label"
+ android:fontFamily="sans-serif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/style_label_space"
@@ -81,7 +82,6 @@
android:format24Hour="@string/abbrev_wday"
android:includeFontPadding="false"
android:singleLine="true"
- android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="@dimen/city_widget_name_font_size" />
@@ -120,13 +120,13 @@
<TextView
android:id="@+id/city_name_right"
style="@style/widget_label"
+ android:fontFamily="sans-serif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
- android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="@dimen/city_widget_name_font_size" />
@@ -135,6 +135,7 @@
<TextView
android:id="@+id/city_day_right"
style="@style/widget_label"
+ android:fontFamily="sans-serif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/style_label_space"
@@ -143,7 +144,6 @@
android:format24Hour="@string/abbrev_wday"
android:includeFontPadding="false"
android:singleLine="true"
- android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="@dimen/city_widget_name_font_size" />
diff --git a/res/values-h560dp/dimens.xml b/res/values-h560dp/dimens.xml
index 003a5ad9f..6e25621ab 100644
--- a/res/values-h560dp/dimens.xml
+++ b/res/values-h560dp/dimens.xml
@@ -16,5 +16,5 @@
<resources>
<!-- The maximum size of the font for the time in widgets. -->
- <dimen name="widget_max_clock_font_size">96dp</dimen>
+ <dimen name="widget_max_clock_font_size">88dp</dimen>
</resources>
\ No newline at end of file
diff --git a/res/values-h650dp/dimens.xml b/res/values-h650dp/dimens.xml
index 2cc58cb32..6e25621ab 100644
--- a/res/values-h650dp/dimens.xml
+++ b/res/values-h650dp/dimens.xml
@@ -16,5 +16,5 @@
<resources>
<!-- The maximum size of the font for the time in widgets. -->
- <dimen name="widget_max_clock_font_size">100dp</dimen>
+ <dimen name="widget_max_clock_font_size">88dp</dimen>
</resources>
\ No newline at end of file
diff --git a/res/values-v21/styles.xml b/res/values-v21/styles.xml
index f1dca16c0..7bc382a4d 100644
--- a/res/values-v21/styles.xml
+++ b/res/values-v21/styles.xml
@@ -18,17 +18,17 @@
<resources>
<style name="body">
- <item name="android:textSize">14sp</item>
+ <item name="android:textSize">16sp</item>
<item name="android:textColor">@color/white</item>
- <item name="android:fontFamily">sans-serif-medium</item>
+ <item name="android:fontFamily">sans-serif</item>
</style>
<style name="PrimaryLabelTextAppearance" parent="PrimaryLabelTextParentAppearance">
- <item name="android:fontFamily">sans-serif-medium</item>
+ <item name="android:fontFamily">sans-serif</item>
</style>
<style name="SecondaryLabelTextAppearance" parent="SecondaryLabelTextParentAppearance">
- <item name="android:fontFamily">sans-serif-medium</item>
+ <item name="android:fontFamily">sans-serif</item>
</style>
</resources>
diff --git a/res/values-v23/styles.xml b/res/values-v23/styles.xml
index 34dcf5d73..6bf964256 100644
--- a/res/values-v23/styles.xml
+++ b/res/values-v23/styles.xml
@@ -26,8 +26,6 @@
</style>
<style name="widget_label" parent="label">
- <item name="android:textAllCaps">true</item>
- <item name="android:letterSpacing">0.15</item>
<item name="android:shadowRadius">@dimen/widget_shadow_radius</item>
<item name="android:shadowColor">@color/widget_shadow_color</item>
<item name="android:shadowDx">@dimen/widget_shadow_dx</item>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 6a384e94b..442fdb1cc 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -44,7 +44,7 @@
<dimen name="alarm_lockscreen_bottom_margin">40dp</dimen>
<dimen name="main_clock_font_size">64sp</dimen>
- <dimen name="main_clock_digital_font_size">90sp</dimen>
+ <dimen name="main_clock_digital_font_size">88sp</dimen>
<dimen name="main_clock_digital_padding">24dp</dimen>
<dimen name="big_font_size">32sp</dimen>
<dimen name="label_font_size">16sp</dimen>
@@ -93,15 +93,15 @@
<dimen name="digital_widget_city_24_medium_font_size">40sp</dimen>
<!-- The fixed size of the font for the city name / day of week in the city widget. -->
- <dimen name="city_widget_name_font_size">10dp</dimen>
+ <dimen name="city_widget_name_font_size">12dp</dimen>
<!-- The maximum size of the font for the time in widgets. -->
<dimen name="widget_max_clock_font_size">88dp</dimen>
<dimen name="widget_min_world_city_list_size">80dp</dimen>
<!-- shadow styles for widget text with drop shadows -->
- <item name="widget_shadow_radius" format="float" type="dimen">2.75</item>
- <item name="widget_shadow_dx" format="float" type="dimen">2.0</item>
- <item name="widget_shadow_dy" format="float" type="dimen">2.0</item>
+ <item name="widget_shadow_radius" format="float" type="dimen">0</item>
+ <item name="widget_shadow_dx" format="float" type="dimen">0</item>
+ <item name="widget_shadow_dy" format="float" type="dimen">0</item>
<!-- Divider height -->
<dimen name="hairline_height">1dp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index fbe62ae3a..ca60e46b8 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -51,12 +51,13 @@
<style name="world_clock_time">
<item name="android:textSize">48sp</item>
<item name="android:textColor">@color/white</item>
- <item name="android:fontFamily">sans-serif-light</item>
+ <item name="android:fontFamily">sans-serif-thin</item>
</style>
<style name="body">
- <item name="android:textSize">14sp</item>
+ <item name="android:textSize">16sp</item>
<item name="android:textColor">@color/white</item>
+ <item name="android:fontFamily">sans-serif</item>
</style>
<style name="big_thin">
diff --git a/src/com/android/alarmclock/DigitalAppWidgetProvider.java b/src/com/android/alarmclock/DigitalAppWidgetProvider.java
index 3be07eca7..86f1d991e 100644
--- a/src/com/android/alarmclock/DigitalAppWidgetProvider.java
+++ b/src/com/android/alarmclock/DigitalAppWidgetProvider.java
@@ -453,7 +453,13 @@ public class DigitalAppWidgetProvider extends AppWidgetProvider {
*/
private static String getDateFormat(Context context) {
final Locale locale = Locale.getDefault();
- final String skeleton = context.getString(R.string.abbrev_wday_month_day_no_year);
+ final String nextAlarmTime = Utils.getNextAlarm(context);
+ final String skeleton;
+ if (TextUtils.isEmpty(nextAlarmTime)) {
+ skeleton = context.getString(R.string.full_wday_month_day_no_year);
+ } else {
+ skeleton = context.getString(R.string.abbrev_wday_month_day_no_year);
+ }
return DateFormat.getBestDateTimePattern(locale, skeleton);
}
@@ -495,7 +501,7 @@ public class DigitalAppWidgetProvider extends AppWidgetProvider {
private int getClockFontSizePx() { return mClockFontSizePx; }
private void setClockFontSizePx(int clockFontSizePx) {
mClockFontSizePx = clockFontSizePx;
- mFontSizePx = max(1, round(clockFontSizePx / 7.5f));
+ mFontSizePx = max(1, round(clockFontSizePx / 5.5f));
mIconFontSizePx = (int) (mFontSizePx * 1.4f);
mIconPaddingPx = mFontSizePx / 3;
}
diff --git a/src/com/android/deskclock/ClockFragment.java b/src/com/android/deskclock/ClockFragment.java
index b487e52be..1459094ee 100644
--- a/src/com/android/deskclock/ClockFragment.java
+++ b/src/com/android/deskclock/ClockFragment.java
@@ -80,6 +80,7 @@ public final class ClockFragment extends DeskClockFragment {
private SelectedCitiesAdapter mCityAdapter;
private RecyclerView mCityList;
private String mDateFormat;
+ private String mDateFormatAlarm;
private String mDateFormatForAccessibility;
/**
@@ -103,11 +104,12 @@ public final class ClockFragment extends DeskClockFragment {
final View fragmentView = inflater.inflate(R.layout.clock_fragment, container, false);
- mDateFormat = getString(R.string.abbrev_wday_month_day_no_year);
+ mDateFormat = getString(R.string.full_wday_month_day_no_year);
+ mDateFormatAlarm = getString(R.string.abbrev_wday_month_day_no_year);
mDateFormatForAccessibility = getString(R.string.full_wday_month_day_no_year);
mCityAdapter = new SelectedCitiesAdapter(getActivity(), mDateFormat,
- mDateFormatForAccessibility);
+ mDateFormatAlarm, mDateFormatForAccessibility);
mCityList = (RecyclerView) fragmentView.findViewById(R.id.cities);
mCityList.setLayoutManager(new LinearLayoutManager(getActivity()));
@@ -129,7 +131,7 @@ public final class ClockFragment extends DeskClockFragment {
mDigitalClock = (TextClock) mClockFrame.findViewById(R.id.digital_clock);
mAnalogClock = (AnalogClock) mClockFrame.findViewById(R.id.analog_clock);
Utils.setClockIconTypeface(mClockFrame);
- Utils.updateDate(mDateFormat, mDateFormatForAccessibility, mClockFrame);
+ Utils.updateDate(getActivity(), mDateFormat, mDateFormatAlarm, mDateFormatForAccessibility, mClockFrame);
Utils.setClockStyle(mDigitalClock, mAnalogClock);
Utils.setClockSecondsEnabled(mDigitalClock, mAnalogClock);
}
@@ -146,7 +148,8 @@ public final class ClockFragment extends DeskClockFragment {
final Activity activity = getActivity();
- mDateFormat = getString(R.string.abbrev_wday_month_day_no_year);
+ mDateFormat = getString(R.string.full_wday_month_day_no_year);
+ mDateFormatAlarm = getString(R.string.abbrev_wday_month_day_no_year);
mDateFormatForAccessibility = getString(R.string.full_wday_month_day_no_year);
// Watch for system events that effect clock time or format.
@@ -348,13 +351,15 @@ public final class ClockFragment extends DeskClockFragment {
private final Context mContext;
private final boolean mIsPortrait;
private final boolean mShowHomeClock;
- private final String mDateFormat;
- private final String mDateFormatForAccessibility;
+ private static String mDateFormat;
+ private static String mDateFormatAlarm;
+ private static String mDateFormatForAccessibility;
private SelectedCitiesAdapter(Context context, String dateFormat,
- String dateFormatForAccessibility) {
+ String dateFormatAlarm, String dateFormatForAccessibility) {
mContext = context;
mDateFormat = dateFormat;
+ mDateFormatAlarm = dateFormatAlarm;
mDateFormatForAccessibility = dateFormatForAccessibility;
mInflater = LayoutInflater.from(context);
mIsPortrait = Utils.isPortrait(context);
@@ -541,7 +546,7 @@ public final class ClockFragment extends DeskClockFragment {
String dateFormatForAccessibility, boolean showHairline) {
Utils.refreshAlarm(context, itemView);
- Utils.updateDate(dateFormat, dateFormatForAccessibility, itemView);
+ Utils.updateDate(context, mDateFormat, mDateFormatAlarm, mDateFormatForAccessibility, itemView);
Utils.setClockStyle(mDigitalClock, mAnalogClock);
mHairline.setVisibility(showHairline ? VISIBLE : GONE);
diff --git a/src/com/android/deskclock/Screensaver.java b/src/com/android/deskclock/Screensaver.java
index 68899d96e..7f01d880a 100644
--- a/src/com/android/deskclock/Screensaver.java
+++ b/src/com/android/deskclock/Screensaver.java
@@ -43,6 +43,7 @@ public final class Screensaver extends DreamService {
private MoveScreensaverRunnable mPositionUpdater;
private String mDateFormat;
+ private String mDateFormatAlarm;
private String mDateFormatForAccessibility;
private View mContentView;
@@ -63,7 +64,7 @@ public final class Screensaver extends DreamService {
private final Runnable mMidnightUpdater = new Runnable() {
@Override
public void run() {
- Utils.updateDate(mDateFormat, mDateFormatForAccessibility, mContentView);
+ Utils.updateDate(Screensaver.this, mDateFormat, mDateFormatAlarm, mDateFormatForAccessibility, mContentView);
}
};
@@ -84,7 +85,8 @@ public final class Screensaver extends DreamService {
setTheme(R.style.Theme_DeskClock);
super.onCreate();
- mDateFormat = getString(R.string.abbrev_wday_month_day_no_year);
+ mDateFormat = getString(R.string.full_wday_month_day_no_year);
+ mDateFormatAlarm = getString(R.string.abbrev_wday_month_day_no_year);
mDateFormatForAccessibility = getString(R.string.full_wday_month_day_no_year);
}
@@ -129,7 +131,7 @@ public final class Screensaver extends DreamService {
getContentResolver().registerContentObserver(uri, false, mSettingsContentObserver);
}
- Utils.updateDate(mDateFormat, mDateFormatForAccessibility, mContentView);
+ Utils.updateDate(this, mDateFormat, mDateFormatAlarm, mDateFormatForAccessibility, mContentView);
Utils.refreshAlarm(this, mContentView);
startPositionUpdater();
diff --git a/src/com/android/deskclock/ScreensaverActivity.java b/src/com/android/deskclock/ScreensaverActivity.java
index c7d54af3f..14c9bab00 100644
--- a/src/com/android/deskclock/ScreensaverActivity.java
+++ b/src/com/android/deskclock/ScreensaverActivity.java
@@ -87,11 +87,12 @@ public class ScreensaverActivity extends BaseActivity {
private final Runnable mMidnightUpdater = new Runnable() {
@Override
public void run() {
- Utils.updateDate(mDateFormat, mDateFormatForAccessibility, mContentView);
+ Utils.updateDate(ScreensaverActivity.this, mDateFormat, mDateFormatAlarm, mDateFormatForAccessibility, mContentView);
}
};
private String mDateFormat;
+ private String mDateFormatAlarm;
private String mDateFormatForAccessibility;
private View mContentView;
@@ -103,7 +104,8 @@ public class ScreensaverActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- mDateFormat = getString(R.string.abbrev_wday_month_day_no_year);
+ mDateFormat = getString(R.string.full_wday_month_day_no_year);
+ mDateFormatAlarm = getString(R.string.abbrev_wday_month_day_no_year);
mDateFormatForAccessibility = getString(R.string.full_wday_month_day_no_year);
setContentView(R.layout.desk_clock_saver);
@@ -160,7 +162,7 @@ public class ScreensaverActivity extends BaseActivity {
public void onResume() {
super.onResume();
- Utils.updateDate(mDateFormat, mDateFormatForAccessibility, mContentView);
+ Utils.updateDate(ScreensaverActivity.this, mDateFormat, mDateFormatAlarm, mDateFormatForAccessibility, mContentView);
Utils.refreshAlarm(ScreensaverActivity.this, mContentView);
startPositionUpdater();
diff --git a/src/com/android/deskclock/Utils.java b/src/com/android/deskclock/Utils.java
index 6d97912f7..cba5c0909 100644
--- a/src/com/android/deskclock/Utils.java
+++ b/src/com/android/deskclock/Utils.java
@@ -353,6 +353,11 @@ public class Utils {
nextAlarmView.setVisibility(View.GONE);
nextAlarmIconView.setVisibility(View.GONE);
}
+
+ String mDateFormat = context.getString(R.string.full_wday_month_day_no_year);
+ String mDateFormatAlarm = context.getString(R.string.abbrev_wday_month_day_no_year);
+ String mDateFormatForAccessibility = context.getString(R.string.full_wday_month_day_no_year);
+ Utils.updateDate(context, mDateFormat, mDateFormatAlarm, mDateFormatForAccessibility, clock);
}
public static void setClockIconTypeface(View clock) {
@@ -363,14 +368,21 @@ public class Utils {
/**
* Clock views can call this to refresh their date.
**/
- public static void updateDate(String dateSkeleton, String descriptionSkeleton, View clock) {
+ public static void updateDate(Context context, String dateSkeleton, String dateSkeletonAlarm, String descriptionSkeleton, View clock) {
final TextView dateDisplay = (TextView) clock.findViewById(R.id.date);
if (dateDisplay == null) {
return;
}
final Locale l = Locale.getDefault();
- final String datePattern = DateFormat.getBestDateTimePattern(l, dateSkeleton);
+ final String datePattern;
+ final String alarm = getNextAlarm(context);
+ if (!TextUtils.isEmpty(alarm)) {
+ datePattern = DateFormat.getBestDateTimePattern(l, dateSkeletonAlarm);
+ } else {
+ datePattern = DateFormat.getBestDateTimePattern(l, dateSkeleton);
+ }
+
final String descriptionPattern = DateFormat.getBestDateTimePattern(l, descriptionSkeleton);
final Date now = new Date();
--
2.25.1

View File

@ -0,0 +1,30 @@
From 734d1b69c62d1ab2e097da3e5c15ce041394d558 Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Mon, 1 Jul 2019 07:03:04 +0000
Subject: [PATCH 1/2] vendor_lineage: Ignore neverallows... again
Because unofficial builds are better than no builds!
Change-Id: I4b19d09b28f79c6f5020bf03fdf8931145bca03a
---
build/core/config.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/build/core/config.mk b/build/core/config.mk
index f2e595ff..d6d036a9 100644
--- a/build/core/config.mk
+++ b/build/core/config.mk
@@ -20,5 +20,10 @@ FRAMEWORK_LINEAGE_PLATFORM_API_FILE := $(TOPDIR)lineage-sdk/api/lineage_current.
FRAMEWORK_LINEAGE_PLATFORM_REMOVED_API_FILE := $(TOPDIR)lineage-sdk/api/lineage_removed.txt
FRAMEWORK_LINEAGE_API_NEEDS_UPDATE_TEXT := $(TOPDIR)vendor/lineage/build/core/apicheck_msg_current.txt
+# We modify several neverallows, so let the build proceed
+ifneq ($(TARGET_BUILD_VARIANT),user)
+SELINUX_IGNORE_NEVERALLOWS := true
+endif
+
# Rules for QCOM targets
include $(TOPDIR)vendor/lineage/build/core/qcom_target.mk
--
2.25.1

View File

@ -0,0 +1,36 @@
From f20707d1b08d3c6fbaf301e4fb621f081b7a81f1 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 20 Jun 2021 09:09:15 +0000
Subject: [PATCH 2/2] build: Integrate prop modifications (2/2)
Change-Id: I076973f902ab20011964e50955e4326c18d5b34e
---
build/core/main_version.mk | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/build/core/main_version.mk b/build/core/main_version.mk
index dddeee77..dd86cbfd 100644
--- a/build/core/main_version.mk
+++ b/build/core/main_version.mk
@@ -5,17 +5,12 @@ ADDITIONAL_BUILD_PROPERTIES += \
endif
# LineageOS System Version
+# Do not set Display Versions here, due to Makefile not playing nice with spaces
ADDITIONAL_BUILD_PROPERTIES += \
- ro.lineage.version=$(LINEAGE_VERSION) \
ro.lineage.releasetype=$(LINEAGE_BUILDTYPE) \
ro.lineage.build.version=$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR) \
- ro.modversion=$(LINEAGE_VERSION) \
ro.lineagelegal.url=https://lineageos.org/legal
-# LineageOS Platform Display Version
-ADDITIONAL_BUILD_PROPERTIES += \
- ro.lineage.display.version=$(LINEAGE_DISPLAY_VERSION)
-
# LineageOS Platform SDK Version
ADDITIONAL_BUILD_PROPERTIES += \
ro.lineage.build.version.plat.sdk=$(LINEAGE_PLATFORM_SDK_VERSION)
--
2.25.1

View File

@ -0,0 +1,48 @@
From 44c6b955f1b787984bcddb53d35bf8eda20e02d1 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:40 +0000
Subject: [PATCH] Revert "recovery: Allow custom bootloader msg offset in block
misc"
This reverts commit 0e369f42b82c4d12edba9a46dd20bee0d4b783ec.
---
bootloader_message/Android.bp | 1 -
.../include/bootloader_message/bootloader_message.h | 10 +++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/bootloader_message/Android.bp b/bootloader_message/Android.bp
index f23b1dea..6443a077 100644
--- a/bootloader_message/Android.bp
+++ b/bootloader_message/Android.bp
@@ -16,7 +16,6 @@
cc_defaults {
name: "libbootloader_message_defaults",
- defaults: ["bootloader_message_offset_defaults"],
srcs: ["bootloader_message.cpp"],
cflags: [
"-Wall",
diff --git a/bootloader_message/include/bootloader_message/bootloader_message.h b/bootloader_message/include/bootloader_message/bootloader_message.h
index 387692b9..e4cf09b2 100644
--- a/bootloader_message/include/bootloader_message/bootloader_message.h
+++ b/bootloader_message/include/bootloader_message/bootloader_message.h
@@ -29,11 +29,11 @@
// 32K - 64K System space, used for miscellanious AOSP features. See below.
// Note that these offsets are admitted by bootloader,recovery and uncrypt, so they
// are not configurable without changing all of them.
-constexpr size_t BOOTLOADER_MESSAGE_OFFSET_IN_MISC = BOARD_RECOVERY_BLDRMSG_OFFSET;
-constexpr size_t VENDOR_SPACE_OFFSET_IN_MISC = 2 * 1024 + BOARD_RECOVERY_BLDRMSG_OFFSET;
-constexpr size_t WIPE_PACKAGE_OFFSET_IN_MISC = 16 * 1024 + BOARD_RECOVERY_BLDRMSG_OFFSET;
-constexpr size_t SYSTEM_SPACE_OFFSET_IN_MISC = 32 * 1024 + BOARD_RECOVERY_BLDRMSG_OFFSET;
-constexpr size_t SYSTEM_SPACE_SIZE_IN_MISC = 32 * 1024 + BOARD_RECOVERY_BLDRMSG_OFFSET;
+constexpr size_t BOOTLOADER_MESSAGE_OFFSET_IN_MISC = 0;
+constexpr size_t VENDOR_SPACE_OFFSET_IN_MISC = 2 * 1024;
+constexpr size_t WIPE_PACKAGE_OFFSET_IN_MISC = 16 * 1024;
+constexpr size_t SYSTEM_SPACE_OFFSET_IN_MISC = 32 * 1024;
+constexpr size_t SYSTEM_SPACE_SIZE_IN_MISC = 32 * 1024;
/* Bootloader Message (2-KiB)
*
--
2.25.1

View File

@ -0,0 +1,60 @@
From e679bd168b2d45d552e43072f11786f2891358db Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 5 Oct 2020 01:51:46 +0000
Subject: [PATCH 1/2] build: Don't handle apns-conf
Leave it to vendor/lineage instead
Change-Id: I51fb1436ee0ee2e33b20ca0810b69e827f3f34dc
---
target/product/aosp_product.mk | 5 -----
target/product/full_base_telephony.mk | 5 -----
target/product/mainline.mk | 4 ----
3 files changed, 14 deletions(-)
diff --git a/target/product/aosp_product.mk b/target/product/aosp_product.mk
index 3e03e6213..1e370fce8 100644
--- a/target/product/aosp_product.mk
+++ b/target/product/aosp_product.mk
@@ -40,11 +40,6 @@ PRODUCT_PACKAGES += \
WallpaperPicker \
ifeq ($(LINEAGE_BUILD),)
-# Telephony:
-# Provide a APN configuration to GSI product
-PRODUCT_COPY_FILES += \
- device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml
-
# NFC:
# Provide a libnfc-nci.conf to GSI product
PRODUCT_COPY_FILES += \
diff --git a/target/product/full_base_telephony.mk b/target/product/full_base_telephony.mk
index 314de3e92..ad46fb97f 100644
--- a/target/product/full_base_telephony.mk
+++ b/target/product/full_base_telephony.mk
@@ -30,10 +30,5 @@ endif
PRODUCT_COPY_FILES := \
frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
-ifeq ($(LINEAGE_BUILD),)
-PRODUCT_COPY_FILES += \
- device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
-endif
-
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk)
diff --git a/target/product/mainline.mk b/target/product/mainline.mk
index 418b1eedd..9754cc8e2 100644
--- a/target/product/mainline.mk
+++ b/target/product/mainline.mk
@@ -40,7 +40,3 @@ endif
PRODUCT_PACKAGES += \
PhotoTable \
WallpaperPicker \
-
-ifeq ($(LINEAGE_BUILD),)
-PRODUCT_COPY_FILES += device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml
-endif
--
2.25.1

View File

@ -0,0 +1,31 @@
From d2ccffcaf2ad6f8b467afb04683677a3271deafa Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:40 +0000
Subject: [PATCH 2/2] Revert "mainline_system: Exclude vendor.lineage.power@1.0
from artifact path requirements"
This reverts commit 78c28df40f72fdcbe3f82a83828060ad19765fa1.
---
target/product/mainline_system.mk | 6 ------
1 file changed, 6 deletions(-)
diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk
index e9f9dde13..a787707a0 100644
--- a/target/product/mainline_system.mk
+++ b/target/product/mainline_system.mk
@@ -135,12 +135,6 @@ _base_mk_allowed_list :=
_my_allowed_list := $(_base_mk_allowed_list)
-# vendor.lineage.power@1.0 currently violates the artifact path requirements
-# Exclude it from the check for now
-_my_allowed_list += \
- $(TARGET_COPY_OUT_SYSTEM_EXT)/lib/vendor.lineage.power@1.0.so \
- $(TARGET_COPY_OUT_SYSTEM_EXT)/lib64/vendor.lineage.power@1.0.so \
-
# For mainline, system.img should be mounted at /, so we include ROOT here.
_my_paths := \
$(TARGET_COPY_OUT_ROOT)/ \
--
2.25.1

View File

@ -0,0 +1,22 @@
From 13f428e6a81c5bba49ecfe5323b450ddae5025b0 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:40 +0000
Subject: [PATCH 1/7] Revert "Update lineage.mk for LineageOS 16.0"
This reverts commit 82b15278bad816632dcaeaed623b569978e9840d.
---
lineage.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/lineage.mk b/lineage.mk
index 172bb01..f6315b9 100644
--- a/lineage.mk
+++ b/lineage.mk
@@ -1,3 +1,4 @@
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)
+$(call inherit-product, device/lineage/sepolicy/common/sepolicy.mk)
-include vendor/lineage/build/core/config.mk
-include vendor/lineage/build/core/apicheck.mk
--
2.25.1

View File

@ -0,0 +1,29 @@
From ecd6a5affd7df4bd9ab4b89472b2cadc15a6aeba Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 23 Oct 2019 09:38:16 +0000
Subject: [PATCH 2/7] Remove fsck SELinux labels
These are covered by LOS sepolicy
Change-Id: I7c63c9aed39afc07b8c80918053154113f848cd9
---
sepolicy/file_contexts | 3 ---
1 file changed, 3 deletions(-)
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 7cfb226..7ab5e91 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -6,9 +6,6 @@
/system/bin/phh-on-data.sh u:object_r:phhsu_exec:s0
/system/bin/asus-motor u:object_r:phhsu_exec:s0
-#/system/bin/fsck\.exfat u:object_r:fsck_exec:s0
-/system/bin/fsck\.ntfs u:object_r:fsck_exec:s0
-
/bt_firmware(/.*)? u:object_r:bt_firmware_file:s0
/sec_storage(/.*)? u:object_r:teecd_data_file:s0
--
2.25.1

View File

@ -0,0 +1,135 @@
From cceaa8cfab8e6f00b1c0d79f2852f7fb2623b075 Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Mon, 15 Jul 2019 10:43:52 +0000
Subject: [PATCH 3/7] treble: Add overlay-lineage
Change-Id: I9d313b1488d98acc7cf37d23820946ee99745426
---
base.mk | 12 ++-
.../lineage/res/res/values/config.xml | 81 +++++++++++++++++++
2 files changed, 90 insertions(+), 3 deletions(-)
create mode 100644 overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml
diff --git a/base.mk b/base.mk
index 43f3707..5d16dbe 100644
--- a/base.mk
+++ b/base.mk
@@ -13,7 +13,13 @@ PRODUCT_COPY_FILES += \
device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += device/phh/treble/sepolicy
-PRODUCT_PACKAGE_OVERLAYS += device/phh/treble/overlay
+
+PRODUCT_PACKAGE_OVERLAYS += \
+ device/phh/treble/overlay \
+ device/phh/treble/overlay-lineage
+
+PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += \
+ device/phh/treble/overlay-lineage/lineage-sdk
$(call inherit-product, vendor/hardware_overlay/overlay.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
@@ -30,11 +36,11 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
ro.build.version.security_patch=$(PLATFORM_SECURITY_PATCH) \
ro.adb.secure=0 \
ro.logd.auditd=true
-
+
#Huawei HiSuite (also other OEM custom programs I guess) it's of no use in AOSP builds
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
persist.sys.usb.config=adb \
- ro.cust.cdrom=/dev/null
+ ro.cust.cdrom=/dev/null
#VNDK config files
PRODUCT_COPY_FILES += \
diff --git a/overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml b/overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml
new file mode 100644
index 0000000..8df673a
--- /dev/null
+++ b/overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015-2016 The CyanogenMod Project
+ 2017-2018 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.
+-->
+<resources>
+ <!-- Whether device has screen with higher aspect ratio -->
+ <bool name="config_haveHigherAspectRatioScreen">true</bool>
+
+ <!-- All the capabilities of the LEDs on this device, stored as a bit field.
+ This integer should equal the sum of the corresponding value for each
+ of the following capabilities present:
+ // Device has a color adjustable battery light.
+ LIGHTS_RGB_NOTIFICATION_LED = 1
+ // Device has a color adjustable notification light.
+ LIGHTS_RGB_BATTERY_LED = 2
+ LIGHTS_MULTIPLE_NOTIFICATION_LED = 4 (deprecated)
+ // The notification light has adjustable pulsing capability.
+ LIGHTS_PULSATING_LED = 8
+ // Device has a multi-segment battery light that is able to
+ // use the light brightness value to determine how many
+ // segments to show (in order to represent battery level).
+ LIGHTS_SEGMENTED_BATTERY_LED = 16
+ // The notification light supports HAL adjustable brightness
+ // via the alpha channel.
+ // Note: if a device notification light supports LIGHTS_RGB_NOTIFICATION_LED
+ // then HAL support is not necessary for brightness control. In this case,
+ // brightness support will be provided by lineage-sdk through the scaling of
+ // RGB color values.
+ LIGHTS_ADJUSTABLE_NOTIFICATION_LED_BRIGHTNESS = 32
+ // Device has a battery light.
+ LIGHTS_BATTERY_LED = 64
+ // The battery light supports HAL adjustable brightness via
+ // the alpha channel.
+ // Note: if a device battery light supports LIGHTS_RGB_BATTERY_LED then HAL
+ // support is not necessary for brightness control. In this case,
+ // brightness support will be provided by lineage-sdk through the scaling of
+ // RGB color values.
+ LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS = 128
+ For example, a device with notification and battery lights that supports
+ pulsating and RGB control would set this config to 75. -->
+ <integer name="config_deviceLightCapabilities">255</integer>
+
+ <!-- Hardware keys present on the device, stored as a bit field.
+ This integer should equal the sum of the corresponding value for each
+ of the following keys present:
+ 1 - Home
+ 2 - Back
+ 4 - Menu
+ 8 - Assistant (search)
+ 16 - App switch
+ 32 - Camera
+ 64 - Volume rocker
+ For example, a device with Home, Back and Menu keys would set this
+ config to 7. -->
+ <integer name="config_deviceHardwareKeys">127</integer>
+
+ <!-- Hardware keys present on the device with the ability to wake, stored as a bit field.
+ This integer should equal the sum of the corresponding value for each
+ of the following keys present:
+ 1 - Home
+ 2 - Back
+ 4 - Menu
+ 8 - Assistant (search)
+ 16 - App switch
+ 32 - Camera
+ 64 - Volume rocker
+ For example, a device with Home, Back and Menu keys would set this
+ config to 7. -->
+ <integer name="config_deviceHardwareWakeKeys">127</integer>
+</resources>
--
2.25.1

View File

@ -0,0 +1,25 @@
From 1ab462e2b735ff92e75fc9eef0d62b3b920771f1 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 10 Sep 2019 02:42:36 +0000
Subject: [PATCH 4/7] treble: Don't specify config_wallpaperCropperPackage
Change-Id: I72b59def304779e4bd9a399c01cf1180d15bf444
---
overlay/frameworks/base/core/res/res/values/config.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 2d5c21e..7a15163 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -22,7 +22,6 @@
<string name="config_icon_mask" translatable="false">"M50 0C77.6 0 100 22.4 100 50C100 77.6 77.6 100 50 100C22.4 100 0 77.6 0 50C0 22.4 22.4 0 50 0Z"</string>
<bool name="config_useRoundIcon">true</bool>
- <string name="config_wallpaperCropperPackage">com.android.wallpaperpicker</string>
<bool name="config_unplugTurnsOnScreen">true</bool>
<integer name="config_multiuserMaximumUsers">5</integer>
<bool name="config_enableMultiUserUI">true</bool>
--
2.25.1

View File

@ -0,0 +1,39 @@
From 1e5aef82a995e0244b3eb084fca25c7f1eedc324 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 27 Jun 2021 15:37:56 +0000
Subject: [PATCH 5/7] treble: Don't handle apns-conf
LineageOS has its own well-maintained copy
Change-Id: If568101f21098c75879af8b9b6141af179566960
---
base-pre.mk | 3 ---
base.mk | 4 ----
2 files changed, 7 deletions(-)
diff --git a/base-pre.mk b/base-pre.mk
index 6a317e4..e69de29 100644
--- a/base-pre.mk
+++ b/base-pre.mk
@@ -1,3 +0,0 @@
-#Use a more decent APN config
-PRODUCT_COPY_FILES += \
- device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
diff --git a/base.mk b/base.mk
index 5d16dbe..878aaae 100644
--- a/base.mk
+++ b/base.mk
@@ -8,10 +8,6 @@ PRODUCT_COPY_FILES := \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
-#Use a more decent APN config
-PRODUCT_COPY_FILES += \
- device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
-
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += device/phh/treble/sepolicy
PRODUCT_PACKAGE_OVERLAYS += \
--
2.25.1

View File

@ -0,0 +1,22 @@
From d7b179f234d76c3acf7a723fc05f07efe9adc84c Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 09:29:32 +0000
Subject: [PATCH 6/7] treble: Set BOARD_EXT4_SHARE_DUP_BLOCKS explicitly
Change-Id: I725443154fabde548d2e6c1b072d34c27596c421
---
board-base.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/board-base.mk b/board-base.mk
index 0da1061..e270068 100644
--- a/board-base.mk
+++ b/board-base.mk
@@ -4,3 +4,4 @@ TARGET_EXFAT_DRIVER := exfat
DEVICE_FRAMEWORK_MANIFEST_FILE := device/phh/treble/framework_manifest.xml
BOARD_ROOT_EXTRA_FOLDERS += bt_firmware sec_storage efs
+BOARD_EXT4_SHARE_DUP_BLOCKS := true
--
2.25.1

View File

@ -0,0 +1,20 @@
From 9d0b5acf3e811eb17eb7501dd43ff952ec3b172f Mon Sep 17 00:00:00 2001
From: Victor Bo <bvoid@yandex.ru>
Date: Tue, 15 Sep 2020 21:26:45 -0400
Subject: [PATCH 7/7] add offline charger sepolicy
---
sepolicy/gsicharger.te | 1 +
1 file changed, 1 insertion(+)
create mode 100644 sepolicy/gsicharger.te
diff --git a/sepolicy/gsicharger.te b/sepolicy/gsicharger.te
new file mode 100644
index 0000000..91cfb5c
--- /dev/null
+++ b/sepolicy/gsicharger.te
@@ -0,0 +1 @@
+permissive charger;
--
2.25.1

View File

@ -0,0 +1,51 @@
From 0ec12cb7e70f7a0cbeee9934d9b9aa5680359491 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:40 +0000
Subject: [PATCH] Revert "camera: Allow devices to load custom CameraParameter
code"
This reverts commit 5a5606dbd92f01de322c797a7128fce69902d067.
---
camera/Android.bp | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/camera/Android.bp b/camera/Android.bp
index 21ef9eed70..fa36bb31b1 100644
--- a/camera/Android.bp
+++ b/camera/Android.bp
@@ -14,7 +14,6 @@
cc_library_shared {
name: "libcamera_client",
- defaults: ["camera_parameter_library_defaults"],
aidl: {
export_aidl_headers: true,
@@ -33,6 +32,7 @@ cc_library_shared {
// Source for camera interface parcelables, and manually-written interfaces
"Camera.cpp",
"CameraMetadata.cpp",
+ "CameraParameters.cpp",
"CaptureResult.cpp",
"CameraParameters2.cpp",
"ICamera.cpp",
@@ -77,16 +77,6 @@ cc_library_shared {
}
-cc_library_static {
- name: "libcamera_parameters",
-
- export_include_dirs: [
- "include",
- ],
- srcs: ["CameraParameters.cpp"],
-
-}
-
// AIDL interface between camera clients and the camera service.
filegroup {
name: "libcamera_client_aidl",
--
2.25.1

View File

@ -0,0 +1,40 @@
From 15c6984df105af4e92c20c33ef53451eb99524a9 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:40 +0000
Subject: [PATCH] Revert "Add suspend_resume trace events to the atrace 'freq'
category."
This reverts commit 581c22f979af05e48ad4843cdfa9605186d286da.
---
cmds/atrace/atrace.cpp | 1 -
cmds/atrace/atrace.rc | 2 --
2 files changed, 3 deletions(-)
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index 28fdaa430..36a35f9f7 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -171,7 +171,6 @@ static const TracingCategory k_categories[] = {
{ OPT, "events/clk/clk_disable/enable" },
{ OPT, "events/clk/clk_enable/enable" },
{ OPT, "events/power/cpu_frequency_limits/enable" },
- { OPT, "events/power/suspend_resume/enable" },
} },
{ "membus", "Memory Bus Utilization", 0, {
{ REQ, "events/memory_bus/enable" },
diff --git a/cmds/atrace/atrace.rc b/cmds/atrace/atrace.rc
index f442dae66..3fb58275e 100644
--- a/cmds/atrace/atrace.rc
+++ b/cmds/atrace/atrace.rc
@@ -49,8 +49,6 @@ on late-init
chmod 0666 /sys/kernel/tracing/events/power/cpu_frequency_limits/enable
chmod 0666 /sys/kernel/debug/tracing/events/power/gpu_frequency/enable
chmod 0666 /sys/kernel/tracing/events/power/gpu_frequency/enable
- chmod 0666 /sys/kernel/debug/tracing/events/power/suspend_resume/enable
- chmod 0666 /sys/kernel/tracing/events/power/suspend_resume/enable
chmod 0666 /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
chmod 0666 /sys/kernel/tracing/events/cpufreq_interactive/enable
chmod 0666 /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_begin/enable
--
2.25.1

View File

@ -0,0 +1,43 @@
From 0b1838a0019eae94f2c2e1d9931bbdb33ac28dad Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:40 +0000
Subject: [PATCH] Revert "Bluetooth: Reset packages/apps/Bluetooth to upstream"
This reverts commit 4ceb47e32c1be30640e40f81b6f741942f8598ed.
---
Android.bp | 5 -----
tests/robotests/Android.mk | 4 ----
2 files changed, 9 deletions(-)
diff --git a/Android.bp b/Android.bp
index c16faff96..08e0ee116 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,8 +1,3 @@
-// Bluetooth is in it's own namespace to allow it to be replaced with an
-// alternate implementation.
-soong_namespace {
-}
-
// MAP API module
java_library {
diff --git a/tests/robotests/Android.mk b/tests/robotests/Android.mk
index 678ab4bc1..0cb6917ce 100644
--- a/tests/robotests/Android.mk
+++ b/tests/robotests/Android.mk
@@ -1,5 +1,3 @@
-ifneq ($(TARGET_USE_QTI_BT_STACK),true)
-
#############################################################
# Bluetooth Robolectric test target. #
#############################################################
@@ -47,5 +45,3 @@ LOCAL_TEST_PACKAGE := Bluetooth
LOCAL_INSTRUMENT_SOURCE_DIRS := $(dir $(LOCAL_PATH))../src
include external/robolectric-shadows/run_robotests.mk
-
-endif
--
2.25.1

View File

@ -0,0 +1,186 @@
From e587d5f4e924737b481095925d152d9d31adf2cc Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 19 Dec 2020 15:57:27 +0000
Subject: [PATCH 1/4] Revert "init: Add vendor-specific initialization hooks."
This reverts commit 7bc78d1354cd2e8df1ba693c627d5be39206e375.
Change-Id: I0c3241ef3626bc989b34723e30b2339e4a62399d
---
init/Android.bp | 9 ---------
init/NOTICE | 26 --------------------------
init/property_service.cpp | 4 ----
init/vendor_init.cpp | 37 -------------------------------------
init/vendor_init.h | 33 ---------------------------------
5 files changed, 109 deletions(-)
delete mode 100644 init/vendor_init.cpp
delete mode 100644 init/vendor_init.h
diff --git a/init/Android.bp b/init/Android.bp
index e28d9f026..827a8293f 100644
--- a/init/Android.bp
+++ b/init/Android.bp
@@ -71,14 +71,6 @@ init_host_sources = [
"host_init_verifier.cpp",
]
-cc_library_static {
- name: "vendor_init",
- recovery_available: true,
- srcs: [
- "vendor_init.cpp",
- ],
-}
-
cc_defaults {
name: "init_defaults",
cpp_std: "experimental",
@@ -169,7 +161,6 @@ cc_library_static {
defaults: [
"init_defaults",
"selinux_policy_version",
- "vendor_init_defaults",
],
srcs: init_common_sources + init_device_sources,
whole_static_libs: [
diff --git a/init/NOTICE b/init/NOTICE
index 383d0f541..c5b1efa7a 100644
--- a/init/NOTICE
+++ b/init/NOTICE
@@ -188,29 +188,3 @@
END OF TERMS AND CONDITIONS
-Copyright (c) 2013, The Linux Foundation. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
- * Neither the name of The Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 44b51c2cf..019955b16 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -70,7 +70,6 @@
#include "subcontext.h"
#include "system/core/init/property_service.pb.h"
#include "util.h"
-#include "vendor_init.h"
using namespace std::literals;
@@ -976,9 +975,6 @@ void PropertyLoadBootDefaults() {
}
}
- // Update with vendor-specific property runtime overrides
- vendor_load_properties();
-
property_initialize_ro_product_props();
property_derive_build_fingerprint();
property_initialize_ro_cpu_abilist();
diff --git a/init/vendor_init.cpp b/init/vendor_init.cpp
deleted file mode 100644
index d3fd5ffe2..000000000
--- a/init/vendor_init.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-Copyright (c) 2013, The Linux Foundation. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
- * Neither the name of The Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "vendor_init.h"
-
-/* init vendor override stubs */
-
-__attribute__ ((weak))
-void vendor_load_properties()
-{
-}
diff --git a/init/vendor_init.h b/init/vendor_init.h
deleted file mode 100644
index 9afb449be..000000000
--- a/init/vendor_init.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-Copyright (c) 2013, The Linux Foundation. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
- * Neither the name of The Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __INIT_VENDOR__H__
-#define __INIT_VENDOR__H__
-extern void vendor_load_properties(void);
-#endif /* __INIT_VENDOR__H__ */
--
2.25.1

View File

@ -0,0 +1,38 @@
From abbb1f38b347c8681cac4388d49c227e874ea3d9 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 4 Sep 2019 21:11:48 +0200
Subject: [PATCH 2/4] Panic into recovery rather than bootloader
Getting last_kmsg/pstore from bootloader isn't possible for other people
than the OEM, but we have TWRP to access last_kmsg/pstore
Change-Id: If04bb6572dc66677d7b44f7d302b2d69ce526200
---
init/reboot_utils.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/init/reboot_utils.cpp b/init/reboot_utils.cpp
index 76460a5df..5a12dd7af 100644
--- a/init/reboot_utils.cpp
+++ b/init/reboot_utils.cpp
@@ -34,7 +34,7 @@
namespace android {
namespace init {
-static std::string init_fatal_reboot_target = "bootloader";
+static std::string init_fatal_reboot_target = "recovery";
static bool init_fatal_panic = false;
void SetFatalRebootTarget() {
@@ -48,7 +48,7 @@ void SetFatalRebootTarget() {
const char kRebootTargetString[] = "androidboot.init_fatal_reboot_target=";
auto start_pos = cmdline.find(kRebootTargetString);
if (start_pos == std::string::npos) {
- return; // We already default to bootloader if no setting is provided.
+ return; // We already default to recovery if no setting is provided
}
start_pos += sizeof(kRebootTargetString) - 1;
--
2.25.1

View File

@ -0,0 +1,87 @@
From 9a9baec3df926da5cf27c690590482e11172f821 Mon Sep 17 00:00:00 2001
From: Victor Bo <bvoid@yandex.ru>
Date: Wed, 3 Mar 2021 06:31:17 -0500
Subject: [PATCH 3/4] Restore /sbin for Magisk compatibility
Squash of:
- Revert "Do not create /sbin"
- Revert "Remove sbin from fs_config.cpp"
- add /sbin to the PATH
Change-Id: I1224c9b64ce8eb14f7d15c8441c0633a7e6a20de
---
CleanSpec.mk | 2 --
libcutils/fs_config.cpp | 3 +++
rootdir/Android.mk | 2 +-
rootdir/init.environ.rc.in | 1 +
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 0a534a2bd..81150a0fa 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -80,8 +80,6 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/vndksp.libraries.txt)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/sbin/charger)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/sbin/charger)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/sbin)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/sbin)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product_services)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/product_services.img)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/product_services)
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index 5805a4d19..b30707fc8 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -80,6 +80,7 @@ static const struct fs_path_config android_dirs[] = {
{ 00771, AID_SYSTEM, AID_SYSTEM, 0, "data" },
{ 00755, AID_ROOT, AID_SYSTEM, 0, "mnt" },
{ 00751, AID_ROOT, AID_SHELL, 0, "product/bin" },
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin" },
{ 00777, AID_ROOT, AID_ROOT, 0, "sdcard" },
{ 00751, AID_ROOT, AID_SDCARD_R, 0, "storage" },
{ 00751, AID_ROOT, AID_SHELL, 0, "system/bin" },
@@ -164,6 +165,7 @@ static const struct fs_path_config android_files[] = {
{ 00600, AID_ROOT, AID_ROOT, 0, "system_ext/build.prop" },
{ 00444, AID_ROOT, AID_ROOT, 0, system_ext_conf_dir + 1 },
{ 00444, AID_ROOT, AID_ROOT, 0, system_ext_conf_file + 1 },
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin/fs_mgr" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/crash_dump32" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/crash_dump64" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/debuggerd" },
@@ -209,6 +211,7 @@ static const struct fs_path_config android_files[] = {
{ 00750, AID_ROOT, AID_SHELL, 0, "init*" },
{ 00755, AID_ROOT, AID_SHELL, 0, "odm/bin/*" },
{ 00755, AID_ROOT, AID_SHELL, 0, "product/bin/*" },
+ { 00750, AID_ROOT, AID_SHELL, 0, "sbin/*" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/bin/*" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/xbin/*" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin/*" },
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 7d383f522..6d518dcb3 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -77,7 +77,7 @@ endif
#
# create some directories (some are mount points) and symlinks
LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \
- dev proc sys system data data_mirror odm oem acct config storage mnt apex debug_ramdisk \
+ sbin dev proc sys system data data_mirror odm oem acct config storage mnt apex debug_ramdisk \
linkerconfig postinstall $(BOARD_ROOT_EXTRA_FOLDERS)); \
ln -sf /system/bin $(TARGET_ROOT_OUT)/bin; \
ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \
diff --git a/rootdir/init.environ.rc.in b/rootdir/init.environ.rc.in
index fdaaf1abe..72ba861a8 100644
--- a/rootdir/init.environ.rc.in
+++ b/rootdir/init.environ.rc.in
@@ -10,6 +10,7 @@ on early-init
export ANDROID_TZDATA_ROOT /apex/com.android.tzdata
export EXTERNAL_STORAGE /sdcard
export ASEC_MOUNTPOINT /mnt/asec
+ export PATH /sbin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
export BOOTCLASSPATH %BOOTCLASSPATH%
export DEX2OATBOOTCLASSPATH %DEX2OATBOOTCLASSPATH%
export SYSTEMSERVERCLASSPATH %SYSTEMSERVERCLASSPATH%
--
2.25.1

View File

@ -0,0 +1,52 @@
From f2b0a4042521fc7ad60de242227fcbcf21691a3b Mon Sep 17 00:00:00 2001
From: Victor Bo <bvoid@yandex.ru>
Date: Wed, 26 Feb 2020 07:23:44 +0200
Subject: [PATCH 4/4] fix offline charger v7
modified: rootdir/init.rc
---
rootdir/init.rc | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/rootdir/init.rc b/rootdir/init.rc
index a9af0b094..b136f1059 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -11,6 +11,11 @@ import /vendor/etc/init/hw/init.${ro.hardware}.rc
import /system/etc/init/hw/init.usb.configfs.rc
import /system/etc/init/hw/init.${ro.zygote}.rc
+service gsicharger /bin/charger
+ class gsicharger
+ user system
+ group system shell input graphics wakelock
+
# Cgroups are mounted right before early-init using list from /etc/cgroups.json
on early-init
# Disable sysrq from keyboard
@@ -399,7 +404,7 @@ on init
# Healthd can trigger a full boot from charger mode by signaling this
# property when the power button is held.
on property:sys.boot_from_charger_mode=1
- class_stop charger
+ class_stop gsicharger
trigger late-init
on load_persist_props_action
@@ -945,8 +950,12 @@ on nonencrypted
on property:sys.init_log_level=*
loglevel ${sys.init_log_level}
+on charger && property:ro.hardware=mt*
+ write /sys/class/leds/lcd-backlight/trigger "backlight"
+ write /sys/class/android_usb/android0/enable 1
+
on charger
- class_start charger
+ class_start gsicharger
on property:vold.decrypt=trigger_load_persist_props
load_persist_props
--
2.25.1

View File

@ -0,0 +1,24 @@
From 4f035a6b34ee9f42774998de1c5008f6bce30a18 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 01:43:40 +0000
Subject: [PATCH] Revert "system_suspend: start early"
This reverts commit cb732f9b635b5f6f79e447ddaf743ebb800b8535.
---
suspend/1.0/default/android.system.suspend@1.0-service.rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/suspend/1.0/default/android.system.suspend@1.0-service.rc b/suspend/1.0/default/android.system.suspend@1.0-service.rc
index 965ca16..c5d3869 100644
--- a/suspend/1.0/default/android.system.suspend@1.0-service.rc
+++ b/suspend/1.0/default/android.system.suspend@1.0-service.rc
@@ -1,5 +1,5 @@
service system_suspend /system/bin/hw/android.system.suspend@1.0-service
- class early_hal
+ class hal
user system
group system wakelock
capabilities BLOCK_SUSPEND
--
2.25.1

View File

@ -0,0 +1,42 @@
From f12f94ae51ec13744bd2f93585ce744128ee192f Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 5 Oct 2020 01:29:18 +0000
Subject: [PATCH] Revert "sepolicy: Relabel wifi. properties as wifi_prop"
This reverts commit bf52f194873840546c996c232eb44c8427ddcd5c.
Change-Id: I0446540331684eb57f7e17bcc3273d6247915854
---
private/property_contexts | 1 -
private/system_server.te | 3 ---
2 files changed, 4 deletions(-)
diff --git a/private/property_contexts b/private/property_contexts
index a4fab1f22..cf0a2dee5 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -171,7 +171,6 @@ dalvik. u:object_r:dalvik_prop:s0
ro.dalvik. u:object_r:dalvik_prop:s0
# Shared between system server and wificond
-wifi. u:object_r:wifi_prop:s0
wlan. u:object_r:wifi_prop:s0
# Lowpan properties
diff --git a/private/system_server.te b/private/system_server.te
index 3c1d192d7..b63b47d3d 100644
--- a/private/system_server.te
+++ b/private/system_server.te
@@ -676,9 +676,6 @@ get_prop(system_server, mock_ota_prop)
# Read the property as feature flag for protecting apks with fs-verity.
get_prop(system_server, apk_verity_prop)
-# Read wifi.interface
-get_prop(system_server, wifi_prop)
-
# Read the vendor property that indicates if Incremental features is enabled
get_prop(system_server, incremental_prop)
--
2.25.1

View File

@ -0,0 +1,45 @@
From f0b8b09faba7f40bfe376a7c6d3a0f81e7d587c4 Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Sun, 3 Mar 2019 14:07:33 +0800
Subject: [PATCH] build_soong: Disable generated_kernel_headers
...but done in a way so that there's no need to remove generated_kernel_headers from individual projects - thanks @ExpressLuke
Change-Id: I630857cec208f1830e776bf5031d7bb9bc4435d0
---
build/soong/Android.bp | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/build/soong/Android.bp b/build/soong/Android.bp
index 5076e684..2279bf44 100644
--- a/build/soong/Android.bp
+++ b/build/soong/Android.bp
@@ -20,9 +20,6 @@ bootstrap_go_package {
lineage_generator {
name: "generated_kernel_includes",
- // The headers make command
- cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_SOURCE) O=$(KERNEL_BUILD_OUT_PREFIX)$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install",
-
// Directories that can be imported by a cc_* module generated_headers property
export_include_dirs: [
"usr/audio/include/uapi",
@@ -30,15 +27,6 @@ lineage_generator {
"usr/include/audio/include/uapi",
"usr/techpack/audio/include",
],
-
- // Sources for dependency tracking
- dep_root: "$(TARGET_KERNEL_SOURCE)",
- dep_files: [
- "Makefile",
- "include/**/*",
- "arch/$(KERNEL_ARCH)/include/**/*",
- "techpack/audio/include/**/*",
- ],
}
cc_library_headers {
--
2.25.1

View File

@ -0,0 +1,23 @@
From 79bc0294a742981eff0905118921e035241878dc Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 8 Aug 2021 09:31:01 +0000
Subject: [PATCH 1/3] Revert "treble: Set BOARD_EXT4_SHARE_DUP_BLOCKS
explicitly"
This reverts commit d7b179f234d76c3acf7a723fc05f07efe9adc84c.
---
board-base.mk | 1 -
1 file changed, 1 deletion(-)
diff --git a/board-base.mk b/board-base.mk
index e270068..0da1061 100644
--- a/board-base.mk
+++ b/board-base.mk
@@ -4,4 +4,3 @@ TARGET_EXFAT_DRIVER := exfat
DEVICE_FRAMEWORK_MANIFEST_FILE := device/phh/treble/framework_manifest.xml
BOARD_ROOT_EXTRA_FOLDERS += bt_firmware sec_storage efs
-BOARD_EXT4_SHARE_DUP_BLOCKS := true
--
2.25.1

View File

@ -0,0 +1,430 @@
From ec91b5cae6341702dc39bf6e579a4fd791af87c0 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 22 Jun 2021 13:38:31 +0000
Subject: [PATCH 2/3] Add Meizu 18 vibrator support
Thanks to:
- @phhusson for guidance
- Google for marlin HAL as reference in implementing 1.0
- @xingrz for Meizu 16th HAL as reference in implementing 1.3
Change-Id: Iecf12cd814e8773abfd78a19f98e31125a73761a
---
base.mk | 3 +
framework_manifest.xml | 10 ++
hal/meizu-vibrator/Android.bp | 31 ++++
hal/meizu-vibrator/Vibrator.cpp | 140 ++++++++++++++++++
hal/meizu-vibrator/Vibrator.h | 60 ++++++++
...oid.hardware.vibrator@1.3-service.meizu.rc | 4 +
hal/meizu-vibrator/service.cpp | 72 +++++++++
sepolicy/file_contexts | 1 +
sepolicy/hal.te | 11 ++
9 files changed, 332 insertions(+)
create mode 100644 hal/meizu-vibrator/Android.bp
create mode 100644 hal/meizu-vibrator/Vibrator.cpp
create mode 100644 hal/meizu-vibrator/Vibrator.h
create mode 100644 hal/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
create mode 100644 hal/meizu-vibrator/service.cpp
diff --git a/base.mk b/base.mk
index 878aaae..1755f9e 100644
--- a/base.mk
+++ b/base.mk
@@ -203,3 +203,6 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
# AOSP overlays
PRODUCT_PACKAGES += \
NavigationBarMode2ButtonOverlay
+
+PRODUCT_PACKAGES += \
+ android.hardware.vibrator@1.3-service.meizu
diff --git a/framework_manifest.xml b/framework_manifest.xml
index cb37b49..1b45b4a 100644
--- a/framework_manifest.xml
+++ b/framework_manifest.xml
@@ -19,5 +19,15 @@
<instance>default</instance>
</interface>
</hal>
+
+ <hal>
+ <name>android.hardware.vibrator</name>
+ <transport>hwbinder</transport>
+ <version>1.3</version>
+ <interface>
+ <name>IVibrator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
</manifest>
diff --git a/hal/meizu-vibrator/Android.bp b/hal/meizu-vibrator/Android.bp
new file mode 100644
index 0000000..4e3c1b9
--- /dev/null
+++ b/hal/meizu-vibrator/Android.bp
@@ -0,0 +1,31 @@
+//
+// Copyright (C) 2017 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.
+cc_binary {
+ name: "android.hardware.vibrator@1.3-service.meizu",
+ relative_install_path: "hw",
+ init_rc: ["android.hardware.vibrator@1.3-service.meizu.rc"],
+ srcs: ["service.cpp", "Vibrator.cpp"],
+ cflags: ["-Wall", "-Werror"],
+ shared_libs: [
+ "libhidlbase",
+ "liblog",
+ "libutils",
+ "libhardware",
+ "android.hardware.vibrator@1.0",
+ "android.hardware.vibrator@1.1",
+ "android.hardware.vibrator@1.2",
+ "android.hardware.vibrator@1.3",
+ ],
+}
diff --git a/hal/meizu-vibrator/Vibrator.cpp b/hal/meizu-vibrator/Vibrator.cpp
new file mode 100644
index 0000000..8f12987
--- /dev/null
+++ b/hal/meizu-vibrator/Vibrator.cpp
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#define LOG_TAG "VibratorService"
+
+#include <log/log.h>
+
+#include <hardware/hardware.h>
+#include <hardware/vibrator.h>
+
+#include "Vibrator.h"
+
+#include <cinttypes>
+#include <cmath>
+#include <iostream>
+#include <fstream>
+#include <thread>
+#include <unistd.h>
+
+namespace android {
+namespace hardware {
+namespace vibrator {
+namespace V1_3 {
+namespace implementation {
+
+Vibrator::Vibrator(std::ofstream&& timeoutAndAmplitude, std::ofstream&& waveNumber, std::ofstream&& effectTrigger) :
+ mTimeoutAndAmplitude(std::move(timeoutAndAmplitude)),
+ mWaveNumber(std::move(waveNumber)),
+ mEffectTrigger(std::move(effectTrigger)) {}
+
+Return<Status> Vibrator::on(uint32_t timeout_ms) {
+ // Wave number 12 for vibrations slightly stronger than stock (13)
+ mWaveNumber << 12 << std::endl;
+ mTimeoutAndAmplitude << timeout_ms << std::endl;
+ if (!mTimeoutAndAmplitude) {
+ ALOGE("Failed to turn vibrator on (%d): %s", errno, strerror(errno));
+ return Status::UNKNOWN_ERROR;
+ }
+ return Status::OK;
+}
+
+Return<Status> Vibrator::off() {
+ mTimeoutAndAmplitude << 0 << std::endl;
+ if (!mTimeoutAndAmplitude) {
+ ALOGE("Failed to turn vibrator off (%d): %s", errno, strerror(errno));
+ return Status::UNKNOWN_ERROR;
+ }
+ return Status::OK;
+}
+
+Return<bool> Vibrator::supportsAmplitudeControl() {
+ return false;
+}
+
+Return<Status> Vibrator::setAmplitude(uint8_t) {
+ return Status::UNSUPPORTED_OPERATION;
+}
+
+Return<void> Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
+}
+
+Return<void> Vibrator::perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, perform_cb _hidl_cb) {
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
+}
+
+Return<void> Vibrator::perform_1_2(V1_2::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
+}
+
+Return<void> Vibrator::perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
+}
+
+Return<bool> Vibrator::supportsExternalControl() {
+ return false;
+}
+
+Return<Status> Vibrator::setExternalControl(bool) {
+ return Status::UNSUPPORTED_OPERATION;
+}
+
+Return<void> Vibrator::perform(Effect effect, EffectStrength, perform_cb _hidl_cb) {
+ uint32_t id;
+ switch (effect) {
+ case Effect::CLICK:
+ id = 31008;
+ break;
+ case Effect::DOUBLE_CLICK:
+ id = 31003;
+ break;
+ case Effect::TICK:
+ case Effect::TEXTURE_TICK:
+ id = 21000;
+ break;
+ case Effect::THUD:
+ id = 30900;
+ break;
+ case Effect::POP:
+ id = 22520;
+ break;
+ case Effect::HEAVY_CLICK:
+ id = 30900;
+ break;
+ default:
+ _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
+ return Void();
+ }
+ mEffectTrigger << id << std::endl;
+ _hidl_cb(Status::OK, 200);
+ return Void();
+}
+
+template <typename T> Return<void> Vibrator::perform(T effect, EffectStrength strength, perform_cb _hidl_cb) {
+ auto validRange = hidl_enum_range<T>();
+ if (effect < *validRange.begin() || effect > *std::prev(validRange.end())) {
+ _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
+ return Void();
+ }
+ return perform(static_cast<Effect>(effect), strength, _hidl_cb);
+}
+
+} // namespace implementation
+} // namespace V1_3
+} // namespace vibrator
+} // namespace hardware
+} // namespace android
diff --git a/hal/meizu-vibrator/Vibrator.h b/hal/meizu-vibrator/Vibrator.h
new file mode 100644
index 0000000..df901aa
--- /dev/null
+++ b/hal/meizu-vibrator/Vibrator.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+#ifndef ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
+#define ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
+
+#include <android/hardware/vibrator/1.3/IVibrator.h>
+#include <hidl/Status.h>
+
+#include <fstream>
+
+namespace android {
+namespace hardware {
+namespace vibrator {
+namespace V1_3 {
+namespace implementation {
+
+using android::hardware::vibrator::V1_0::EffectStrength;
+using android::hardware::vibrator::V1_0::Status;
+
+class Vibrator : public IVibrator {
+public:
+ Vibrator(std::ofstream&& timeoutAndAmplitude, std::ofstream&& waveNumber, std::ofstream&& effectTrigger);
+ Return<Status> on(uint32_t timeoutMs) override;
+ Return<Status> off() override;
+ Return<bool> supportsAmplitudeControl() override;
+ Return<Status> setAmplitude(uint8_t amplitude) override;
+ Return<void> perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
+ Return<void> perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, perform_cb _hidl_cb) override;
+ Return<void> perform_1_2(V1_2::Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
+ Return<void> perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
+ Return<bool> supportsExternalControl() override;
+ Return<Status> setExternalControl(bool enabled) override;
+
+private:
+ Return<void> perform(Effect effect, EffectStrength strength, perform_cb _hidl_cb);
+ template <typename T> Return<void> perform(T effect, EffectStrength strength, perform_cb _hidl_cb);
+ std::ofstream mTimeoutAndAmplitude;
+ std::ofstream mWaveNumber;
+ std::ofstream mEffectTrigger;
+};
+} // namespace implementation
+} // namespace V1_3
+} // namespace vibrator
+} // namespace hardware
+} // namespace android
+
+#endif // ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
diff --git a/hal/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc b/hal/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
new file mode 100644
index 0000000..ddf39c4
--- /dev/null
+++ b/hal/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
@@ -0,0 +1,4 @@
+service vibrator.meizu /system/bin/hw/android.hardware.vibrator@1.3-service.meizu
+ class late_start
+ user system
+ group system
diff --git a/hal/meizu-vibrator/service.cpp b/hal/meizu-vibrator/service.cpp
new file mode 100644
index 0000000..1405dfb
--- /dev/null
+++ b/hal/meizu-vibrator/service.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+#define LOG_TAG "android.hardware.vibrator@1.3-service.meizu"
+
+#include <android/hardware/vibrator/1.3/IVibrator.h>
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
+#include <utils/Errors.h>
+#include <utils/StrongPointer.h>
+
+#include "Vibrator.h"
+
+using android::hardware::configureRpcThreadpool;
+using android::hardware::joinRpcThreadpool;
+using android::hardware::vibrator::V1_3::IVibrator;
+using android::hardware::vibrator::V1_3::implementation::Vibrator;
+using namespace android;
+
+static const char *CONTROL_PATH_TIMEOUT = "/sys/class/timed_output/vibrator/enable";
+static const char *PATH_WAVE_NUMBER = "/sys/class/meizu/motor/waveform";
+static const char *CONTROL_PATH_EFFECT = "/sys/class/meizu/motor/on_off";
+
+status_t registerVibratorService() {
+ std::ofstream timeoutAndAmplitude{CONTROL_PATH_TIMEOUT};
+ if (!timeoutAndAmplitude) {
+ int error = errno;
+ ALOGE("Failed to open %s (%d): %s", CONTROL_PATH_TIMEOUT, error, strerror(error));
+ return -error;
+ }
+
+ std::ofstream waveNumber{PATH_WAVE_NUMBER};
+ if (!waveNumber) {
+ int error = errno;
+ ALOGE("Failed to open %s (%d): %s", PATH_WAVE_NUMBER, error, strerror(error));
+ return -error;
+ }
+
+ std::ofstream effectTrigger{CONTROL_PATH_EFFECT};
+ if (!effectTrigger) {
+ int error = errno;
+ ALOGE("Failed to open %s (%d): %s", CONTROL_PATH_EFFECT, error, strerror(error));
+ return -error;
+ }
+
+ sp<IVibrator> vibrator = new Vibrator(std::move(timeoutAndAmplitude), std::move(waveNumber), std::move(effectTrigger));
+ (void) vibrator->registerAsService(); // suppress unused-result warning
+ return OK;
+}
+
+int main() {
+ configureRpcThreadpool(1, true);
+ status_t status = registerVibratorService();
+
+ if (status != OK) {
+ return status;
+ }
+
+ joinRpcThreadpool();
+}
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 7ab5e91..2b59077 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -12,6 +12,7 @@
/dev/dsm u:object_r:dmd_device:s0
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oppo.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
+/system/bin/hw/android.hardware.vibrator@1.3-service.meizu u:object_r:hal_vibrator_default_exec:s0
/efs u:object_r:efs_file:s0
diff --git a/sepolicy/hal.te b/sepolicy/hal.te
index cb44422..280ae2d 100644
--- a/sepolicy/hal.te
+++ b/sepolicy/hal.te
@@ -8,3 +8,14 @@ init_daemon_domain(hal_fingerprint_oppo_compat)
type hal_fingerprint_oppo, domain;
allow hal_fingerprint_oppo vendor_default_prop:property_service { set };
+
+type vib_strength_sysfs, fs_type, sysfs_type;
+
+type hal_vibrator_default, domain;
+hal_server_domain(hal_vibrator_default, hal_vibrator)
+
+type hal_vibrator_default_exec, exec_type, vendor_file_type, file_type;
+init_daemon_domain(hal_vibrator_default)
+
+allow hal_vibrator_default vib_strength_sysfs:dir rw_dir_perms;
+allow hal_vibrator_default vib_strength_sysfs:file rw_file_perms;
--
2.25.1

View File

@ -0,0 +1,115 @@
From 271f7db60868e2e96fbe5be09b81b943d8fbc91d Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 27 Jun 2021 05:21:38 +0000
Subject: [PATCH 3/3] Only use meizu-vibrator on Meizu 18
- Convert manifest to VINTF fragment
- If not the target device, bind to dummy manifest on boot
Change-Id: I97fc52a98a77aa72bbd5601f36abc0cf18efbaea
---
framework_manifest.xml | 10 ----------
hal/meizu-vibrator/Android.bp | 1 +
.../android.hardware.vibrator@1.3-service.meizu.xml | 11 +++++++++++
hal/meizu-vibrator/manifest_dummy.xml | 3 +++
rw-system.sh | 10 ++++++++--
5 files changed, 23 insertions(+), 12 deletions(-)
create mode 100644 hal/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
create mode 100644 hal/meizu-vibrator/manifest_dummy.xml
diff --git a/framework_manifest.xml b/framework_manifest.xml
index 1b45b4a..cb37b49 100644
--- a/framework_manifest.xml
+++ b/framework_manifest.xml
@@ -19,15 +19,5 @@
<instance>default</instance>
</interface>
</hal>
-
- <hal>
- <name>android.hardware.vibrator</name>
- <transport>hwbinder</transport>
- <version>1.3</version>
- <interface>
- <name>IVibrator</name>
- <instance>default</instance>
- </interface>
- </hal>
</manifest>
diff --git a/hal/meizu-vibrator/Android.bp b/hal/meizu-vibrator/Android.bp
index 4e3c1b9..276728c 100644
--- a/hal/meizu-vibrator/Android.bp
+++ b/hal/meizu-vibrator/Android.bp
@@ -15,6 +15,7 @@
cc_binary {
name: "android.hardware.vibrator@1.3-service.meizu",
relative_install_path: "hw",
+ vintf_fragments: ["android.hardware.vibrator@1.3-service.meizu.xml", "manifest_dummy.xml"],
init_rc: ["android.hardware.vibrator@1.3-service.meizu.rc"],
srcs: ["service.cpp", "Vibrator.cpp"],
cflags: ["-Wall", "-Werror"],
diff --git a/hal/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml b/hal/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
new file mode 100644
index 0000000..d1b836e
--- /dev/null
+++ b/hal/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
@@ -0,0 +1,11 @@
+<manifest version="1.0" type="framework">
+ <hal format="hidl">
+ <name>android.hardware.vibrator</name>
+ <transport>hwbinder</transport>
+ <version>1.3</version>
+ <interface>
+ <name>IVibrator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/hal/meizu-vibrator/manifest_dummy.xml b/hal/meizu-vibrator/manifest_dummy.xml
new file mode 100644
index 0000000..b34a10b
--- /dev/null
+++ b/hal/meizu-vibrator/manifest_dummy.xml
@@ -0,0 +1,3 @@
+<!-- Dummy manifest XML -->
+<manifest version="1.0" type="framework">
+</manifest>
diff --git a/rw-system.sh b/rw-system.sh
index 38271b4..dcb007e 100644
--- a/rw-system.sh
+++ b/rw-system.sh
@@ -314,6 +314,12 @@ if [ "$foundFingerprint" = false ];then
mount -o bind system/phh/empty /system/etc/permissions/android.hardware.fingerprint.xml
fi
+if ! getprop ro.vendor.build.fingerprint | grep -qE 'meizu_18'; then
+ mount -o bind system/phh/empty /system/bin/hw/android.hardware.vibrator@1.3-service.meizu
+ mount -o bind system/phh/empty /system/etc/init/android.hardware.vibrator@1.3-service.meizu.rc
+ mount -o bind system/etc/vintf/manifest/manifest_dummy.xml /system/etc/vintf/manifest/android.hardware.vibrator@1.3-service.meizu.xml
+fi
+
if ! grep android.hardware.bluetooth /vendor/manifest.xml && ! grep android.hardware.bluetooth /vendor/etc/vintf/manifest.xml; then
mount -o bind system/phh/empty /system/etc/permissions/android.hardware.bluetooth.xml
mount -o bind system/phh/empty /system/etc/permissions/android.hardware.bluetooth_le.xml
@@ -385,7 +391,7 @@ if getprop ro.build.overlay.deviceid |grep -q -e CPH1859 -e CPH1861 -e RMX1811 -
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
-if getprop ro.build.overlay.deviceid |grep -iq -e RMX2020 -e RMX2027 -e RMX2040 -e RMX2193 -e RMX2191;then
+if getprop ro.build.overlay.deviceid |grep -iq -e RMX2020 -e RMX2027 -e RMX2040 -e RMX2193 -e RMX2191;then
setprop persist.sys.qcom-brightness 2047
setprop persist.sys.overlay.devinputjack true
setprop persist.sys.phh.fingerprint.nocleanup true
@@ -873,7 +879,7 @@ if getprop ro.build.overlay.deviceid |grep -qiE -e '^RMX' -e '^CPH';then
setprop persist.sys.phh.fod.bbk true
fi
-if getprop ro.build.overlay.deviceid |grep -iq -e RMX1941 -e RMX1945 -e RMX1943 -e RMX1942;then
+if getprop ro.build.overlay.deviceid |grep -iq -e RMX1941 -e RMX1945 -e RMX1943 -e RMX1942;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
setprop persist.sys.phh.mainkeys 0
fi
--
2.25.1

View File

@ -0,0 +1,36 @@
From e3c7e720c893a6ecef90b4b950787ed820792581 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 12 Sep 2019 12:54:23 +0200
Subject: [PATCH 1/2] Use vndk_lite ld.config only on same-version vendor
When running Q over P lite, there is currently absolutely no chance the
device boots, because it will be using Q vndk.
Thus using ld.config.28.txt when running Q over P lite gives a little more
chance for the device to boot, than when using vndk_lite ld.config.
Also, once this patch is applied, the required effort to boot
Q over P lite is exclusively in vndk, which is manageable.
Change-Id: I55257cd7c738b1d20582e198e1d5621e1c87a03e
---
linker/linker.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/linker/linker.cpp b/linker/linker.cpp
index f24167722..a82d7c430 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3372,7 +3372,10 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
}
static std::string get_ld_config_file_vndk_path() {
- if (android::base::GetBoolProperty("ro.vndk.lite", false)) {
+ bool same_version_system_vendor = false;
+ if(std::to_string(__ANDROID_API__) == Config::get_vndk_version_string('.'))
+ same_version_system_vendor = true;
+ if (android::base::GetBoolProperty("ro.vndk.lite", false) && same_version_system_vendor) {
return kLdConfigVndkLiteFilePath;
}
--
2.17.1

View File

@ -0,0 +1,39 @@
From 709393961b2c65d2e9c50fdb5c2db3370811da5c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 26 Oct 2020 23:23:24 +0100
Subject: [PATCH 3/3] Ignore vndk lite when looking for ld.config
Change-Id: I6927ba11dcb8435fab1866985c177a1852488414
---
linker/linker.cpp | 8 --------
1 file changed, 8 deletions(-)
diff --git a/linker/linker.cpp b/linker/linker.cpp
index ae2c00c21..ea504c91e 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -93,7 +93,6 @@ static uint64_t g_module_unload_counter = 0;
static const char* const kLdConfigArchFilePath = "/system/etc/ld.config." ABI_STRING ".txt";
static const char* const kLdConfigFilePath = "/system/etc/ld.config.txt";
-static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt";
static const char* const kLdGeneratedConfigFilePath = "/linkerconfig/ld.config.txt";
@@ -3372,13 +3371,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
}
static std::string get_ld_config_file_vndk_path() {
- bool same_version_system_vendor = false;
- if(std::to_string(__ANDROID_API__) == Config::get_vndk_version_string('.'))
- same_version_system_vendor = true;
- if (android::base::GetBoolProperty("ro.vndk.lite", false) && same_version_system_vendor) {
- return kLdConfigVndkLiteFilePath;
- }
-
std::string ld_config_file_vndk = kLdConfigFilePath;
size_t insert_pos = ld_config_file_vndk.find_last_of('.');
if (insert_pos == std::string::npos) {
--
2.17.1

View File

@ -0,0 +1,26 @@
From a1336cadfe7ff1afa46e87ba11849ebef622183e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 12 Sep 2019 20:31:07 +0200
Subject: [PATCH] Don't reboot if we couldn't get bootctrl
Change-Id: Id1793660bd1c97ab369607f58a772ca3512ec1af
---
update_verifier/update_verifier.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
index a042f900..ea3645af 100644
--- a/update_verifier/update_verifier.cpp
+++ b/update_verifier/update_verifier.cpp
@@ -310,7 +310,7 @@ int update_verifier(int argc, char** argv) {
sp<IBootControl> module = IBootControl::getService();
if (module == nullptr) {
LOG(ERROR) << "Error getting bootctrl module.";
- return reboot_device();
+ return 0;
}
uint32_t current_slot = module->getCurrentSlot();
--
2.17.1

View File

@ -0,0 +1,27 @@
From ddbe45ddd09f30beab8980d14c506f48ca1f8399 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 2 Mar 2018 22:49:55 +0100
Subject: [PATCH 01/10] Enable multipl_decls by default. This is needed because
8.0 init doesn't add -m
Change-Id: I43dc661d519f7b8576d72a828d8cbd444592bf5e
---
secilc/secilc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/secilc/secilc.c b/secilc/secilc.c
index 186c5a73..b422175e 100644
--- a/secilc/secilc.c
+++ b/secilc/secilc.c
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
int target = SEPOL_TARGET_SELINUX;
int mls = -1;
int disable_dontaudit = 0;
- int multiple_decls = 0;
+ int multiple_decls = 1;
int disable_neverallow = 0;
int preserve_tunables = 0;
int handle_unknown = -1;
--
2.17.1

View File

@ -0,0 +1,26 @@
From ff296de7912209e6fa20e1b28db93c395cc0bb75 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 9 Apr 2018 00:19:49 +0200
Subject: [PATCH 02/10] Increase default log_level to get actual selinux error
in kmsg
---
secilc/secilc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/secilc/secilc.c b/secilc/secilc.c
index b422175e..1e550ab4 100644
--- a/secilc/secilc.c
+++ b/secilc/secilc.c
@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
int opt_index = 0;
char *fc_buf = NULL;
size_t fc_size;
- enum cil_log_level log_level = CIL_ERR;
+ enum cil_log_level log_level = CIL_WARN;
static struct option long_opts[] = {
{"help", no_argument, 0, 'h'},
{"verbose", no_argument, 0, 'v'},
--
2.17.1

View File

@ -0,0 +1,40 @@
From ecb4746fb8ba4e97cc53e6290dfa7a75495d19a8 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 3 Dec 2018 20:54:54 +0100
Subject: [PATCH 03/10] ::Kirin:: Workaround some conflicting Kirin tether
SELinux context
Some Kirin devices declared some android.hardware.tetheroffload HALs,
but they didn't use AOSP contexts.
This leads to libselinux aborting when loading hwservice_contexts.
Workaround it the ugly way, by making them match.
This most likely kills tetheroffload for those devices.
---
libselinux/src/label_backends_android.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
index eaca5947..ab92985b 100644
--- a/libselinux/src/label_backends_android.c
+++ b/libselinux/src/label_backends_android.c
@@ -62,6 +62,16 @@ static int nodups_specs(struct saved_data *data)
curr_spec->property_key)) {
if (strcmp(spec_arr[jj].lr.ctx_raw,
curr_spec->lr.ctx_raw)) {
+ if(strcmp(spec_arr[jj].lr.ctx_raw, "u:object_r:hal_ipacm_hwservice:s0") == 0) {
+ free(spec_arr[jj].lr.ctx_raw);
+ spec_arr[jj].lr.ctx_raw = strdup("u:object_r:hal_tetheroffload_hwservice:s0");
+ continue;
+ }
+ if(strcmp(curr_spec->lr.ctx_raw, "u:object_r:hal_ipacm_hwservice:s0") == 0) {
+ free(curr_spec->lr.ctx_raw);
+ curr_spec->lr.ctx_raw = strdup("u:object_r:hal_tetheroffload_hwservice:s0");
+ continue;
+ }
rc = -1;
errno = EINVAL;
selinux_log
--
2.17.1

View File

@ -0,0 +1,43 @@
From f014cf6460159f820fc0d72c6d0bece2851f9873 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 6 Sep 2019 15:07:25 +0200
Subject: [PATCH 04/10] Allow /devices/virtual/block/ genfscon conflict (seen
on Xiaomi Mi 9)
Change-Id: I06e4e9d5b82d61a8aeab595b47e2589249675895
---
libsepol/cil/src/cil_post.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
index a0cadfde..68c0318e 100644
--- a/libsepol/cil/src/cil_post.c
+++ b/libsepol/cil/src/cil_post.c
@@ -477,7 +477,23 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
{
struct cil_genfscon *a_genfscon = *(struct cil_genfscon**)a;
struct cil_genfscon *b_genfscon = *(struct cil_genfscon**)b;
- return context_compare(a_genfscon->context, b_genfscon->context);
+ int rc = context_compare(a_genfscon->context, b_genfscon->context);
+ if(rc) {
+ fprintf(stderr, "hello %s\n", a_genfscon->fs_str);
+ int bypass = 0;
+ /*
+ * This conflict has been seen on Xiaomi Mi 9:
+ * - AOSP Q says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_devices_block ((s0) (s0))))
+ * - stock rom says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_ufs_target ((s0) (s0))))
+ */
+ if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
+ bypass = 1;
+ if(bypass == 1) {
+ fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
+ return 0;
+ }
+ }
+ return rc;
}
int cil_post_netifcon_context_compare(const void *a, const void *b)
--
2.17.1

View File

@ -0,0 +1,44 @@
From 37d5e860031c84803c2533d940847dc214cb2597 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 12 Sep 2019 20:34:28 +0200
Subject: [PATCH 05/10] Most horrific: Remove ramdisk's zygote init scripts
This is needed because:
- only secilc is run soon enough in /system to
remove it
- placing an init.zygote in system won't have init replace it, it's the
first that appears that wins
Change-Id: I8be31ceb9ef2124d04994d9fb08fc8012a2f819e
---
secilc/secilc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/secilc/secilc.c b/secilc/secilc.c
index 1e550ab4..375320e6 100644
--- a/secilc/secilc.c
+++ b/secilc/secilc.c
@@ -34,6 +34,8 @@
#include <getopt.h>
#include <sys/stat.h>
+#include <unistd.h>
+
#ifdef ANDROID
#include <cil/cil.h>
#else
@@ -124,6 +126,11 @@ int main(int argc, char *argv[])
};
int i;
+ unlink("/init.zygote32.rc");
+ unlink("/init.zygote64_32.rc");
+ unlink("/init.zygote64.rc");
+ unlink("/init.zygote32_64.rc");
+
while (1) {
opt_char = getopt_long(argc, argv, "o:f:U:hvt:M:PDmNOc:GX:n", long_opts, &opt_index);
if (opt_char == -1) {
--
2.17.1

View File

@ -0,0 +1,44 @@
From 04fdf9096557accdea52b8b66665717f6c8a454a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 12 Sep 2019 20:37:04 +0200
Subject: [PATCH 06/10] if service is "rcs", accept conflict. Seen on Moto E5
Change-Id: I0cc2d0fad83f403f2b5d7458039b1564ce5ed9dd
---
libselinux/src/label_backends_android.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
index ab92985b..ca16327c 100644
--- a/libselinux/src/label_backends_android.c
+++ b/libselinux/src/label_backends_android.c
@@ -72,14 +72,24 @@ static int nodups_specs(struct saved_data *data)
curr_spec->lr.ctx_raw = strdup("u:object_r:hal_tetheroffload_hwservice:s0");
continue;
}
- rc = -1;
- errno = EINVAL;
selinux_log
(SELINUX_ERROR,
"Multiple different specifications for %s (%s and %s).\n",
curr_spec->property_key,
spec_arr[jj].lr.ctx_raw,
curr_spec->lr.ctx_raw);
+ int ignore = 0;
+ /*
+ * This issue has been found on Moto E5
+ * E SELinux : Multiple different specifications for rcs (u:object_r:radio_service:s0 and u:object_r:mot_rcs_service:s0).
+ */
+ if(!strcmp(curr_spec->property_key, "rcs"))
+ ignore = 1;
+
+ if(!ignore) {
+ rc = -1;
+ errno = EINVAL;
+ }
} else {
selinux_log
(SELINUX_WARNING,
--
2.17.1

View File

@ -0,0 +1,84 @@
From ef94ddbd76328611893ace7870c0d3137fd26cdd Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 25 Oct 2019 13:29:20 +0200
Subject: [PATCH 07/10] Fix boot on Moto devices using unknown class
vendor sepolicy never contains new class or classorder, and are not
allowed to.
Though this is not tested, and it turns out Moto did it anyway.
This raises an issue, because class need to be ordered, and thus the cil
contains the ordering. This ordering needs to be merged.
Android 10 added new classes, so the ordering can no longer be merged,
and secilc fails on those devices, preventing boot.
Considering vendor are not supposed to declare new class (and thus
declare classorder), this fix ignores class-es/classorder in vendor
SELinux policy.
Since the vendor selinux policy has allows rules based on this context,
those allows will fail since the class doesn't exist.
Workaround this by ignoring rules with the problematic class
( keystore_moto_key )
Lucky us, this new class `keystore_moto_key` is used by Moto for
framework to framework (more accurately priv app to keymaster), since
our own framework doesn't use this class, simply ignoring it fixes the
issue.
Change-Id: I66339857634ebfdba359f12a99dfd0bff709d80b
---
libsepol/cil/src/cil_build_ast.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
index 307b1ee3..02cdcc65 100644
--- a/libsepol/cil/src/cil_build_ast.c
+++ b/libsepol/cil/src/cil_build_ast.c
@@ -386,6 +386,14 @@ int cil_gen_class(struct cil_db *db, struct cil_tree_node *parse_current, struct
struct cil_tree_node *perms = NULL;
int rc = SEPOL_ERR;
+ {
+ const char* path = cil_tree_get_cil_path(parse_current);
+ if(strstr(path, "vendor")) {
+ cil_clear_node(ast_node);
+ return SEPOL_OK;
+ }
+ }
+
rc = __cil_verify_syntax(parse_current, syntax, syntax_len);
if (rc != SEPOL_OK) {
goto exit;
@@ -452,6 +460,14 @@ int cil_gen_classorder(struct cil_db *db, struct cil_tree_node *parse_current, s
struct cil_list_item *head = NULL;
int rc = SEPOL_ERR;
+ {
+ const char* path = cil_tree_get_cil_path(parse_current);
+ if(strstr(path, "vendor")) {
+ cil_clear_node(ast_node);
+ return SEPOL_OK;
+ }
+ }
+
if (db == NULL || parse_current == NULL || ast_node == NULL) {
goto exit;
}
@@ -2050,6 +2066,14 @@ int cil_gen_avrule(struct cil_tree_node *parse_current, struct cil_tree_node *as
rule->src_str = parse_current->next->data;
rule->tgt_str = parse_current->next->next->data;
+ {
+ const char *classname = parse_current->next->next->next->cl_head->data;
+ if(strcmp(classname, "keystore_moto_key") == 0) {
+ cil_clear_node(ast_node);
+ return SEPOL_OK;
+ }
+ }
+
rc = cil_fill_classperms_list(parse_current->next->next->next, &rule->perms.classperms);
if (rc != SEPOL_OK) {
goto exit;
--
2.17.1

View File

@ -0,0 +1,27 @@
From 3d356da4654b5ae9eb2207f824555f0219687763 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 24 May 2020 17:22:22 +0200
Subject: [PATCH 08/10] Allow mismatches of exfat genfscon
---
libsepol/cil/src/cil_post.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
index 68c0318e..75e5128c 100644
--- a/libsepol/cil/src/cil_post.c
+++ b/libsepol/cil/src/cil_post.c
@@ -488,6 +488,10 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
*/
if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
bypass = 1;
+ if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) {
+ if(strcmp(a_genfscon->path_str, "/") == 0)
+ bypass = 1;
+ }
if(bypass == 1) {
fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
return 0;
--
2.17.1

View File

@ -0,0 +1,45 @@
From f3d5e2eb212ebd4189428d6adb915880573962f9 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 9 Sep 2020 22:36:42 +0200
Subject: [PATCH 09/10] Revert "libsepol: Make an unknown permission an error
in CIL"
This reverts commit dc4e54126bf25dea4d51820922ccd1959be68fbc.
This is required because some targets calls undefined permissions:
- Realme X2 Pro calls sigcont
- Honor 7X calls perf_event
---
libsepol/cil/src/cil_resolve_ast.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
index 87575860..e72abdeb 100644
--- a/libsepol/cil/src/cil_resolve_ast.c
+++ b/libsepol/cil/src/cil_resolve_ast.c
@@ -131,14 +131,18 @@ static int __cil_resolve_perms(symtab_t *class_symtab, symtab_t *common_symtab,
}
}
if (rc != SEPOL_OK) {
+ struct cil_list *empty_list;
if (class_flavor == CIL_MAP_CLASS) {
cil_log(CIL_ERR, "Failed to resolve permission %s for map class\n", (char*)curr->data);
- } else {
- cil_log(CIL_ERR, "Failed to resolve permission %s\n", (char*)curr->data);
+ goto exit;
}
- goto exit;
+ cil_log(CIL_WARN, "Failed to resolve permission %s\n", (char*)curr->data);
+ /* Use an empty list to represent unknown perm */
+ cil_list_init(&empty_list, perm_strs->flavor);
+ cil_list_append(*perm_datums, CIL_LIST, empty_list);
+ } else {
+ cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
}
- cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
} else {
cil_list_append(*perm_datums, curr->flavor, curr->data);
}
--
2.17.1

View File

@ -0,0 +1,83 @@
From 00f7989d79ad8e219dae29de8e8f20e4dbab008a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 27 Sep 2020 20:20:35 +0200
Subject: [PATCH 10/10] [HACK] For System-as-System devices, init won't call us
with /system_ext sepolicy
So add system_ext sepolicy ourselves
---
secilc/secilc.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/secilc/secilc.c b/secilc/secilc.c
index 375320e6..162b87fb 100644
--- a/secilc/secilc.c
+++ b/secilc/secilc.c
@@ -233,6 +233,7 @@ int main(int argc, char *argv[])
usage(argv[0]);
}
}
+
if (optind >= argc) {
fprintf(stderr, "No cil files specified\n");
usage(argv[0]);
@@ -240,6 +241,11 @@ int main(int argc, char *argv[])
cil_set_log_level(log_level);
+ int needSystemExt = 1;
+ for (i = optind; i < argc; i++) {
+ if(strstr(argv[i], "system_ext")) needSystemExt = 0;
+ }
+
cil_db_init(&db);
cil_set_disable_dontaudit(db, disable_dontaudit);
cil_set_multiple_decls(db, multiple_decls);
@@ -261,6 +267,44 @@ int main(int argc, char *argv[])
}
for (i = optind; i < argc; i++) {
+ fprintf(stderr, "Hello, parsing %s\n", argv[i]);
+ if(needSystemExt && strstr(argv[i], "/etc/selinux/")) {
+ fprintf(stderr, "Hello, I'm adding system_ext to the mix!\n");
+ char *path = "/system/system_ext/etc/selinux/system_ext_sepolicy.cil";
+ file = fopen(path, "r");
+ if (!file) {
+ fprintf(stderr, "Could not open file: %s\n", path);
+ rc = SEPOL_ERR;
+ goto exit;
+ }
+ rc = stat(path, &filedata);
+ if (rc == -1) {
+ fprintf(stderr, "Could not stat file: %s\n", path);
+ rc = SEPOL_ERR;
+ goto exit;
+ }
+ file_size = filedata.st_size;
+
+ buffer = malloc(file_size);
+ rc = fread(buffer, file_size, 1, file);
+ if (rc != 1) {
+ fprintf(stderr, "Failure reading file: %s\n", path);
+ rc = SEPOL_ERR;
+ goto exit;
+ }
+ fclose(file);
+ file = NULL;
+
+ rc = cil_add_file(db, path, buffer, file_size);
+ if (rc != SEPOL_OK) {
+ fprintf(stderr, "Failure adding %s\n", path);
+ goto exit;
+ }
+
+ free(buffer);
+ buffer = NULL;
+
+ }
file = fopen(argv[i], "r");
if (!file) {
fprintf(stderr, "Could not open file: %s\n", argv[i]);
--
2.17.1

View File

@ -0,0 +1,182 @@
From 9f851c801719b45c79cd911d67ceb7e8f4cf63ab Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 31 Mar 2021 23:32:37 +0200
Subject: [PATCH] Workaround device/phh/treble conflict with SELinux policy
device/phh/treble defines the following three types (hostapd,
sysfs_usb_supply, rpmb_device)
However, Qualcomm Samsung Android 11 devices export those symbols as
typealias.
Type and typealias are fundamentally not mergeable.
Luckily, Samsung doesn't do anything with those typealias, so we can
simply ignore them.
Change-Id: I98db7e6eb55854887f90d0fd0f313fb0a19a488f
---
libsepol/cil/src/cil_binary.c | 8 ++++++--
libsepol/cil/src/cil_build_ast.c | 31 ++++++++++++++++++------------
libsepol/cil/src/cil_resolve_ast.c | 15 +++++++++++++--
3 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c
index 03d53e1f..160fd0e0 100644
--- a/libsepol/cil/src/cil_binary.c
+++ b/libsepol/cil/src/cil_binary.c
@@ -515,13 +515,17 @@ int cil_typealias_to_policydb(policydb_t *pdb, struct cil_alias *cil_alias)
type_datum_init(sepol_alias);
rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_alias->actual), &sepol_type);
- if (rc != SEPOL_OK) goto exit;
+ if (rc != SEPOL_OK) {
+ cil_log(CIL_ERR, "Failed at %s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__);
+ goto exit;
+ }
sepol_alias->flavor = TYPE_TYPE;
key = cil_strdup(cil_alias->datum.fqn);
rc = symtab_insert(pdb, SYM_TYPES, key, sepol_alias, SCOPE_DECL, 0, NULL);
if (rc != SEPOL_OK) {
+ cil_log(CIL_ERR, "Failed at %s:%s:%d:%d\n", __FILE__, __FUNCTION__, __LINE__, rc);
goto exit;
}
sepol_alias->s.value = sepol_type->s.value;
@@ -3776,7 +3780,7 @@ int __cil_node_to_policydb(struct cil_tree_node *node, void *extra_args)
exit:
if (rc != SEPOL_OK) {
- cil_tree_log(node, CIL_ERR, "Binary policy creation failed");
+ cil_tree_log(node, CIL_ERR, "Binary policy creation failed, for pass = %d, flavor = %d", pass, node->flavor);
}
return rc;
}
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
index 02cdcc65..2ba08bc6 100644
--- a/libsepol/cil/src/cil_build_ast.c
+++ b/libsepol/cil/src/cil_build_ast.c
@@ -1,16 +1,16 @@
/*
* Copyright 2011 Tresys Technology, LLC. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY TRESYS TECHNOLOGY, LLC ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
@@ -21,7 +21,7 @@
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those
* of the authors and should not be interpreted as representing official policies,
* either expressed or implied, of Tresys Technology, LLC.
@@ -64,7 +64,7 @@ int cil_fill_list(struct cil_tree_node *current, enum cil_flavor flavor, struct
CIL_SYN_END
};
int syntax_len = sizeof(syntax)/sizeof(*syntax);
-
+
rc = __cil_verify_syntax(current, syntax, syntax_len);
if (rc != SEPOL_OK) {
goto exit;
@@ -108,7 +108,7 @@ int cil_gen_node(struct cil_db *db, struct cil_tree_node *ast_node, struct cil_s
{
int rc = SEPOL_ERR;
symtab_t *symtab = NULL;
- struct cil_symtab_datum *prev;
+ struct cil_symtab_datum *prev = NULL;
rc = __cil_verify_name((const char*)key);
if (rc != SEPOL_OK) {
@@ -133,13 +133,20 @@ int cil_gen_node(struct cil_db *db, struct cil_tree_node *ast_node, struct cil_s
/* multiple_decls not ok, ret error */
cil_log(CIL_ERR, "Re-declaration of %s %s\n",
cil_node_to_string(ast_node), key);
- if (cil_symtab_get_datum(symtab, key, &datum) == SEPOL_OK) {
+ if (cil_symtab_get_datum(symtab, key, &prev) == SEPOL_OK) {
if (sflavor == CIL_SYM_BLOCKS) {
- struct cil_tree_node *node = datum->nodes->head->data;
+ struct cil_tree_node *node = prev->nodes->head->data;
cil_tree_log(node, CIL_ERR, "Previous declaration");
}
}
- goto exit;
+ if(
+ strcmp(key, "sysfs_usb_supply") == 0 ||
+ strcmp(key, "hostapd") == 0 ||
+ strcmp(key, "rpmb_device") == 0) {
+ cil_log(CIL_ERR, "Ignoring...");
+ } else {
+ goto exit;
+ }
}
/* multiple_decls is enabled and works for this datum type, add node */
cil_list_append(prev->nodes, CIL_NODE, ast_node);
@@ -572,7 +579,7 @@ int cil_gen_perm_nodes(struct cil_db *db, struct cil_tree_node *current_perm, st
while(current_perm != NULL) {
if (current_perm->cl_head != NULL) {
-
+
rc = SEPOL_ERR;
goto exit;
}
@@ -5717,7 +5724,7 @@ int cil_fill_ipaddr(struct cil_tree_node *addr_node, struct cil_ipaddr *addr)
return SEPOL_OK;
exit:
- cil_log(CIL_ERR, "Bad ip address or netmask\n");
+ cil_log(CIL_ERR, "Bad ip address or netmask\n");
return rc;
}
diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
index e72abdeb..db3f24f4 100644
--- a/libsepol/cil/src/cil_resolve_ast.c
+++ b/libsepol/cil/src/cil_resolve_ast.c
@@ -512,7 +512,13 @@ int cil_resolve_aliasactual(struct cil_tree_node *current, void *extra_args, enu
}
if (NODE(alias_datum)->flavor != alias_flavor) {
cil_log(CIL_ERR, "%s is not an alias\n",alias_datum->name);
- rc = SEPOL_ERR;
+ if(
+ strcmp(alias_datum->name, "hostapd") == 0 ||
+ strcmp(alias_datum->name, "sysfs_usb_supply") == 0 ||
+ strcmp(alias_datum->name, "rpmb_device") == 0)
+ rc = 0;
+ else
+ rc = SEPOL_ERR;
goto exit;
}
@@ -553,7 +559,12 @@ int cil_resolve_alias_to_actual(struct cil_tree_node *current, enum cil_flavor f
int limit = 2;
if (alias->actual == NULL) {
- cil_tree_log(current, CIL_ERR, "Alias declared but not used");
+ cil_tree_log(current, CIL_ERR, "Alias %s declared but not used", a1->datum.name);
+ if(
+ strcmp(a1->datum.name, "hostapd") == 0 ||
+ strcmp(a1->datum.name, "sysfs_usb_supply") == 0 ||
+ strcmp(a1->datum.name, "rpmb_device") == 0)
+ return SEPOL_OK;
return SEPOL_ERR;
}
--
2.25.1

View File

@ -0,0 +1,54 @@
From 163f3f2b4a89df73d3ffede558d26bb0df966bbe Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Tue, 22 Sep 2020 10:38:04 +0200
Subject: [PATCH] GrGLCaps: allow ignoring vendor-supplied texture swizzle flag
* This is broken on MTK 8.1 vendor
Change-Id: I1ccae06f643f01e4ea6539e1d4e3c7df8d6e30ae
---
Android.bp | 1 +
src/gpu/gl/GrGLCaps.cpp | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/Android.bp b/Android.bp
index 122324c6ef..5ec949966a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -3,6 +3,7 @@
cc_library_static {
name: "libskia",
host_supported: true,
+ shared_libs: [ "libbase" ],
cflags: [
"-U_FORTIFY_SOURCE",
"-DATRACE_TAG=ATRACE_TAG_VIEW",
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 6a1bf56474..df007ba70c 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -22,6 +22,11 @@
#include "src/gpu/gl/GrGLTexture.h"
#include "src/utils/SkJSONWriter.h"
+#if defined(SK_BUILD_FOR_ANDROID)
+#include "android-base/properties.h"
+using android::base::GetBoolProperty;
+#endif
+
GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
const GrGLContextInfo& ctxInfo,
const GrGLInterface* glInterface) : INHERITED(contextOptions) {
@@ -273,6 +278,9 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
this->fShaderCaps->fTextureSwizzleAppliedInShader = false;
}
} // no WebGL support
+ if(GetBoolProperty("ro.skia.ignore_swizzle", false)) {
+ this->fShaderCaps->fTextureSwizzleAppliedInShader = true;
+ }
if (GR_IS_GR_GL(standard)) {
fMipMapLevelAndLodControlSupport = true;
--
2.17.1

View File

@ -0,0 +1,31 @@
From f85268cf7b0e928d741d316b59b3b31773fae7c8 Mon Sep 17 00:00:00 2001
From: Alexander Pohl <pohl199885@gmail.com>
Date: Fri, 15 Jun 2018 19:58:07 +0200
Subject: [PATCH 01/14] Fix WiFi-Display on Huawei devices (EMUI 8.0)
Huaweis media stack doesn't handle intra-refresh-mode, so skip the error instead.
Thanks to Chris Vandomelen for pointing that out.
---
media/libstagefright/ACodec.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 63ab6548b4..e25f8f6558 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -4432,9 +4432,8 @@ status_t ACodec::setupAVCEncoderParameters(const sp<AMessage> &msg) {
if (msg->findInt32("intra-refresh-mode", &intraRefreshMode)) {
err = setCyclicIntraMacroblockRefresh(msg, intraRefreshMode);
if (err != OK) {
- ALOGE("Setting intra macroblock refresh mode (%d) failed: 0x%x",
- err, intraRefreshMode);
- return err;
+ ALOGE("setupAVCEncoderParameters(): set intra-refresh-mode failed, ignoring..");
+ //return err;
}
}
--
2.17.1

View File

@ -0,0 +1,36 @@
From 4ab15a33857452d990581a3d0073e35215e1c542 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 19 Aug 2018 22:59:06 +0200
Subject: [PATCH 02/14] ::Kirin:: Remove lock to prevent self-lock
With Huawei Camera HAL, we get the following call order:
cameraserver CameraService::enumerateProviders (*)
=> HAL ICameraProvider::getVendorTags
=> HAL ICameraProviderCallback::cameraDeviceStatusChange
=> cameraserver CameraService::addState
=> cameraserver CameraService::updateCameraNumAndIds (*)
The two functions marked with (*) take mServiceLock
Hence the safe-lock
Change-Id: I464255b5a3af8d75d72b1772ab55aa655f395a60
---
services/camera/libcameraservice/CameraService.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index af1e01d8e1..05252d6308 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -301,7 +301,7 @@ status_t CameraService::getSystemCameraKind(const String8& cameraId, SystemCamer
}
void CameraService::updateCameraNumAndIds() {
- Mutex::Autolock l(mServiceLock);
+ //Mutex::Autolock l(mServiceLock);
std::pair<int, int> systemAndNonSystemCameras = mCameraProviderManager->getCameraCount();
// Excludes hidden secure cameras
mNumberOfCameras =
--
2.17.1

View File

@ -0,0 +1,26 @@
From 1083cc0b59ed11aa69af22103ebaf74ae11f272c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 19 Aug 2018 23:05:26 +0200
Subject: [PATCH 03/14] We might not have a mFlashlight at this state, but
that's ok
---
services/camera/libcameraservice/CameraService.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 05252d6308..e1d23073f4 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -337,7 +337,7 @@ void CameraService::addStates(const String8 id) {
conflicting, deviceKind));
}
- if (mFlashlight->hasFlashUnit(id)) {
+ if (mFlashlight != nullptr && mFlashlight->hasFlashUnit(id)) {
Mutex::Autolock al(mTorchStatusMutex);
mTorchStatusMap.add(id, TorchModeStatus::AVAILABLE_OFF);
--
2.17.1

View File

@ -0,0 +1,62 @@
From 1c0e912c7bdef868de97dc07dd5227d298cd66a9 Mon Sep 17 00:00:00 2001
From: Artem Borisov <dedsa2002@gmail.com>
Date: Tue, 25 Sep 2018 12:39:22 +0300
Subject: [PATCH 04/14] CameraService: Support calling addStates in
enumerateProviders
Some pre-P camera HALs trigger onDeviceStatusChange callback during HAL init.
This is horribly wrong and causes a race condition between enumerateProviders
and onDeviceStatusChange. While it wasn't really harmful in O, in P call sequence
was changed and now this race condition leads to two problems: null pointer dereference
in addStates because mFlashlight is not initialized at a proper timing; mServiceLock
deadlock because updateCameraNumAndIds and enumerateProviders are called at the same time.
Moving addStates back to enumerateProviders makes the sequence more similar to O, and doesn't
let these two issues to happen.
Enable TARGET_CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE when it is necessary.
@Dil3mm4 edit: Instead of TARGET_CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE let's use a system property to make it more generic and suitable for GSI use.
Change-Id: Ife25b9753fdb679ab0c77f385e1b8527551a4711
---
.../camera/libcameraservice/CameraService.cpp | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index e1d23073f4..83dea10f3a 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -221,6 +221,20 @@ status_t CameraService::enumerateProviders() {
for (auto& cameraId : deviceIds) {
String8 id8 = String8(cameraId.c_str());
+ if (property_get_bool("persist.sys.camera.huawei", false)) {
+ bool cameraFound = false;
+ {
+ Mutex::Autolock lock(mCameraStatesLock);
+ auto iter = mCameraStates.find(id8);
+ if (iter != mCameraStates.end()) {
+ cameraFound = true;
+ }
+ }
+ if (!cameraFound) {
+ addStates(id8);
+ }
+ }
+
if (getCameraState(id8) == nullptr) {
onDeviceStatusChanged(id8, CameraDeviceStatus::PRESENT);
}
@@ -375,8 +389,10 @@ void CameraService::onDeviceStatusChanged(const String8& id,
ALOGI("%s: Unknown camera ID %s, a new camera is added",
__FUNCTION__, id.string());
+ if (!property_get_bool("persist.sys.camera.huawei", false)) {
// First add as absent to make sure clients are notified below
addStates(id);
+ }
updateStatus(newStatus, id);
} else {
--
2.17.1

View File

@ -0,0 +1,131 @@
From 3afbad626827104662f61ab04ba3fbe6af32f73f Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 5 Aug 2019 18:09:50 +0200
Subject: [PATCH 05/14] Fix BT in-call on CAF devices
See https://github.com/phhusson/treble_experimentations/issues/374
In Qualcomm's BSP audio_policy_configuration.xml, one route is missing,
from primary output and telephony to BT SCO.
Add it if we detect telephony and bt sco, but no such route.
Change-Id: Ifea0f88276ec9a0811f3cb1973c4b06f2c82077b
---
.../managerdefinitions/src/Serializer.cpp | 93 +++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index 883e713326..d85dbdf113 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -596,6 +596,98 @@ Return<RouteTraits::Element> RouteTraits::deserialize(const xmlNode *cur, PtrSer
return route;
}
+static void fixupQualcommBtScoRoute(RouteTraits::Collection& routes, DevicePortTraits::Collection& devicePorts, HwModule* ctx) {
+ // On many Qualcomm devices, there is a BT SCO Headset Mic => primary input mix
+ // But Telephony Rx => BT SCO Headset route is missing
+ // When we detect such case, add the missing route
+
+ // If we have:
+ // <route type="mix" sink="Telephony Tx" sources="voice_tx"/>
+ // <route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic"/>
+ // <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink" />
+ // And no <route type="mix" sink="BT SCO Headset" />
+
+ // Add:
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
+ bool foundBtScoHeadsetDevice = false;
+ for(const auto& device: devicePorts) {
+ if(device->getTagName() == "BT SCO Headset") {
+ foundBtScoHeadsetDevice = true;
+ break;
+ }
+ }
+ if(!foundBtScoHeadsetDevice) {
+ ALOGE("No BT SCO Headset device found, don't patch policy");
+ return;
+ }
+
+ bool foundTelephony = false;
+ bool foundBtScoInput = false;
+ bool foundScoHeadsetRoute = false;
+ for(const auto& route: routes) {
+ ALOGE("Looking at route %d\n", route->getType());
+ if(route->getType() != AUDIO_ROUTE_MIX)
+ continue;
+ auto sink = route->getSink();
+ ALOGE("... With sink %s\n", sink->getTagName().c_str());
+ if(sink->getTagName() == "Telephony Tx") {
+ foundTelephony = true;
+ continue;
+ }
+ if(sink->getTagName() == "BT SCO Headset") {
+ foundScoHeadsetRoute = true;
+ break;
+ }
+ for(const auto& source: route->getSources()) {
+ ALOGE("... With source %s\n", source->getTagName().c_str());
+ if(source->getTagName() == "BT SCO Headset Mic") {
+ foundBtScoInput = true;
+ break;
+ }
+ }
+ }
+ //The route we want to add is already there
+ ALOGE("Done looking for existing routes");
+ if(foundScoHeadsetRoute)
+ return;
+
+ ALOGE("No existing route found... %d %d", foundTelephony ? 1 : 0, foundBtScoInput ? 1 : 0);
+ //We couldn't find the routes we assume are required for the function we want to add
+ if(!foundTelephony || !foundBtScoInput)
+ return;
+ ALOGE("Adding our own.");
+
+ // Add:
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
+ AudioRoute *newRoute = new AudioRoute(AUDIO_ROUTE_MIX);
+
+ auto sink = ctx->findPortByTagName("BT SCO Headset");
+ ALOGE("Got sink %p\n", sink.get());
+ newRoute->setSink(sink);
+
+ Vector<sp<PolicyAudioPort>> sources;
+ for(const auto& sourceName: {
+ "primary output",
+ "deep_buffer",
+ "compressed_offload",
+ "Telephony Rx"
+ }) {
+ auto source = ctx->findPortByTagName(sourceName);
+ ALOGE("Got source %p\n", source.get());
+ if (source.get() != nullptr) {
+ sources.add(source);
+ source->addRoute(newRoute);
+ }
+ }
+
+ newRoute->setSources(sources);
+
+ sink->addRoute(newRoute);
+
+ auto ret = routes.add(newRoute);
+ ALOGE("route add returned %zd", ret);
+}
+
Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrSerializingCtx ctx)
{
std::string name = getXmlAttribute(cur, Attributes::name);
@@ -635,6 +727,7 @@ Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrS
if (status != NO_ERROR) {
return Status::fromStatusT(status);
}
+ fixupQualcommBtScoRoute(routes, devicePorts, module.get());
module->setRoutes(routes);
for (const xmlNode *children = cur->xmlChildrenNode; children != NULL;
--
2.17.1

View File

@ -0,0 +1,94 @@
From 4f7930e14f979ec5be530bd630ca9bb664050420 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 1 Oct 2019 13:35:49 +0200
Subject: [PATCH 06/14] Add (partial, cam id is hardcoded) support for Asus ZF6
motor camera
Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
---
.../camera/libcameraservice/CameraService.cpp | 26 +++++++++++++++++++
.../camera/libcameraservice/CameraService.h | 3 +++
2 files changed, 29 insertions(+)
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 83dea10f3a..37ea512bdd 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -25,6 +25,7 @@
#include <ctime>
#include <string>
#include <sys/types.h>
+#include <sys/wait.h>
#include <inttypes.h>
#include <pthread.h>
@@ -139,6 +140,7 @@ Mutex CameraService::sProxyMutex;
sp<hardware::ICameraServiceProxy> CameraService::sCameraServiceProxy;
CameraService::CameraService() :
+ mPhysicalFrontCamStatus(false),
mEventLog(DEFAULT_EVENT_LOG_LENGTH),
mNumberOfCameras(0),
mNumberOfCamerasWithoutSystemCamera(0),
@@ -1785,6 +1787,7 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
mServiceLock.lock();
} else {
// Otherwise, add client to active clients list
+ physicalFrontCam(cameraId == "1");
finishConnectLocked(client, partial);
}
} // lock is destroyed, allow further connect calls
@@ -1866,6 +1869,27 @@ status_t CameraService::addOfflineClient(String8 cameraId, sp<BasicClient> offli
return OK;
}
+void CameraService::physicalFrontCam(bool on) {
+ if(on == mPhysicalFrontCamStatus) return;
+ mPhysicalFrontCamStatus = on;
+
+ if(access("/dev/asusMotoDrv", F_OK) == 0) {
+ int pid = fork();
+ if(pid == 0) {
+ const char* cmd[] = {
+ "/system/bin/asus-motor",
+ "0",
+ NULL
+ };
+ cmd[1] = on ? "0" : "1";
+ execve("/system/bin/asus-motor", (char**)cmd, environ);
+ _exit(1);
+ } else {
+ waitpid(pid, NULL, 0);
+ }
+ }
+}
+
Status CameraService::setTorchMode(const String16& cameraId, bool enabled,
const sp<IBinder>& clientBinder) {
Mutex::Autolock lock(mServiceLock);
@@ -2840,6 +2864,8 @@ binder::Status CameraService::BasicClient::disconnect() {
}
mDisconnected = true;
+ sCameraService->physicalFrontCam(false);
+
sCameraService->removeByClient(this);
sCameraService->logDisconnected(mCameraIdStr, mClientPid, String8(mClientPackageName));
sCameraService->mCameraProviderManager->removeRef(CameraProviderManager::DeviceMode::CAMERA,
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 4321201100..85b1706996 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -202,6 +202,9 @@ public:
// Register an offline client for a given active camera id
status_t addOfflineClient(String8 cameraId, sp<BasicClient> offlineClient);
+ bool mPhysicalFrontCamStatus;
+ void physicalFrontCam(bool on);
+
/////////////////////////////////////////////////////////////////////
// Client functionality
--
2.17.1

View File

@ -0,0 +1,59 @@
From 93d21e226a4cac72ebc73f8fcec3001160d8570f Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 23 Jan 2020 11:13:43 +0800
Subject: [PATCH 07/14] audiopolicy: try again with trimmed audio port name if
not found
* In Spreadtrum BSP, some audio routes may contain ports with extra
spaces at the beginning and the end, causing audiopolicy to refuse to
load and leading to broken audio.
* Fix this by retrying with trimmed port name when not found. Do not
use trimmed name all the time because a white space is a valid
character in port name, and we cannot be sure nobody is using it for
legitimite purposes.
Change-Id: I993708b28e8404bc8c483d71a850ac69382231bd
---
.../managerdefinitions/src/Serializer.cpp | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index d85dbdf113..e25dda07c7 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -539,6 +539,17 @@ Return<DevicePortTraits::Element> DevicePortTraits::deserialize(const xmlNode *c
return deviceDesc;
}
+char* trim(char * s) {
+ int l = strlen(s);
+
+ if (l > 0) {
+ while (isspace(s[l - 1])) --l;
+ while (*s && isspace(*s)) ++s, --l;
+ }
+
+ return strndup(s, l);
+}
+
Return<RouteTraits::Element> RouteTraits::deserialize(const xmlNode *cur, PtrSerializingCtx ctx)
{
std::string type = getXmlAttribute(cur, Attributes::type);
@@ -579,8 +590,11 @@ Return<RouteTraits::Element> RouteTraits::deserialize(const xmlNode *cur, PtrSer
if (strlen(devTag) != 0) {
sp<PolicyAudioPort> source = ctx->findPortByTagName(devTag);
if (source == NULL) {
- ALOGE("%s: no source found with name=%s", __func__, devTag);
- return Status::fromStatusT(BAD_VALUE);
+ source = ctx->findPortByTagName(trim(devTag));
+ if (source == NULL) {
+ ALOGE("%s: no source found with name=%s", __func__, devTag);
+ return Status::fromStatusT(BAD_VALUE);
+ }
}
sources.add(source);
}
--
2.17.1

View File

@ -0,0 +1,46 @@
From 2c80a9c1453230a62f538fc128f286005d91b802 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 13 Apr 2020 21:01:16 +0200
Subject: [PATCH 08/14] There are three SCO devices. Fallback from one to the
others if needed
Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2
---
.../managerdefinitions/src/HwModule.cpp | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
index d31e4437e1..b2ca5e85de 100644
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
@@ -292,6 +292,27 @@ sp <HwModule> HwModuleCollection::getModuleForDeviceType(audio_devices_t type,
}
}
}
+ //We didn't find one? Ok but all SCOs are equivalent surely?
+ if(type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO ||
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET ||
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
+ ALOGE("Fallback SCO");
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO) {
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO, encodedFormat);
+ ALOGE("Fallback SCO simple? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) {
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, encodedFormat);
+ ALOGE("Fallback SCO headset? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT, encodedFormat);
+ ALOGE("Fallback SCO carkit? %s", (ret != nullptr) ? "yes" : "no");
+ if(ret != nullptr) return ret;
+ }
+ }
return nullptr;
}
--
2.17.1

View File

@ -0,0 +1,82 @@
From ab92e063952b11ee1090cbf9c0ba0935325a54af Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 14 May 2020 19:54:55 +0200
Subject: [PATCH] Add persist.sys.phh.samsung.camera_ids property to access
hidden Samsung cameras
Change-Id: I2c7bf535272acc28ed2277e96c78ddd28a0b4593
---
services/camera/libcameraservice/Android.bp | 3 ++-
.../common/CameraProviderManager.cpp | 14 ++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
index 53fc1be7eb..99ca362bf3 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
@@ -131,7 +131,8 @@ cc_library_shared {
"android.hardware.camera.device@3.3",
"android.hardware.camera.device@3.4",
"android.hardware.camera.device@3.5",
- "android.hardware.camera.device@3.6"
+ "android.hardware.camera.device@3.6",
+ "vendor.samsung.hardware.camera.provider@3.0",
],
static_libs: [
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
index 876d70d7cf..0bff3606df 100644
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
@@ -21,6 +21,7 @@
#include "CameraProviderManager.h"
#include <android/hardware/camera/device/3.5/ICameraDevice.h>
+#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
#include <algorithm>
#include <chrono>
@@ -1330,6 +1331,7 @@ status_t CameraProviderManager::ProviderInfo::initialize(
mMinorVersion = 6;
}
}
+
// We need to check again since cast2_6.isOk() succeeds even if the provider
// version isn't actually 2.6.
if (interface2_6 == nullptr){
@@ -1358,6 +1360,9 @@ status_t CameraProviderManager::ProviderInfo::initialize(
return mapToStatusT(status);
}
+ auto samsungCast = vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider::castFrom(interface);
+ auto samsungProvider = samsungCast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider>>(samsungCast) : nullptr;
+
hardware::Return<bool> linked = interface->linkToDeath(this, /*cookie*/ mId);
if (!linked.isOk()) {
ALOGE("%s: Transaction error in linking to camera provider '%s' death: %s",
@@ -1388,7 +1393,7 @@ status_t CameraProviderManager::ProviderInfo::initialize(
// Get initial list of camera devices, if any
std::vector<std::string> devices;
- hardware::Return<void> ret = interface->getCameraIdList([&status, this, &devices](
+ auto cb = [&status, this, &devices](
Status idStatus,
const hardware::hidl_vec<hardware::hidl_string>& cameraDeviceNames) {
status = idStatus;
@@ -1405,7 +1410,12 @@ status_t CameraProviderManager::ProviderInfo::initialize(
mProviderPublicCameraIds.push_back(id);
}
}
- } });
+ } };
+ hardware::Return<void> ret;
+ if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
+ ret = samsungProvider->sehGetCameraIdList(cb);
+ else
+ ret = interface->getCameraIdList(cb);
if (!ret.isOk()) {
ALOGE("%s: Transaction error in getting camera ID list from provider '%s': %s",
__FUNCTION__, mProviderName.c_str(), linked.description().c_str());
--
2.25.1

View File

@ -0,0 +1,45 @@
From 6dff7fa42818b525faa0a80d161ad54055ebc38e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 19 May 2020 14:01:14 +0200
Subject: [PATCH 11/14] Add a property to force camera timestamp source
Some devices wrongly report their timesource
Camera's timesource can either be CLOCK_MONOTONIC, or CLOCK_BOOTTIME
The former doesn't increment in sleep, while the later does.
There is a camera HAL property for that, though some devices don't
report it properly.
This issue happens on Xiaomi Redmi 7A, it needs to force the value to 1
Add a property persist.sys.phh.camera.force_timestampsource to force
timestamp source.
---
.../libcameraservice/device3/Camera3Device.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index 4a509aa745..cdf9fc783e 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -316,8 +316,16 @@ status_t Camera3Device::initializeCommonLocked() {
// Measure the clock domain offset between camera and video/hw_composer
camera_metadata_entry timestampSource =
mDeviceInfo.find(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE);
- if (timestampSource.count > 0 && timestampSource.data.u8[0] ==
- ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME) {
+ int timestampSourceValue = 0;
+ if ((timestampSource.count > 0 && timestampSource.data.u8[0] ==
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME)) {
+ timestampSourceValue = 1;
+ }
+ int forceTimestampSource = property_get_int32("persist.sys.phh.camera.force_timestampsource", -1);
+ //Don't override if it's -1, default value
+ if(forceTimestampSource == 0) timestampSourceValue = 0;
+ if(forceTimestampSource == 1) timestampSourceValue = 1;
+ if (timestampSourceValue == 1) {
mTimestampOffset = getMonoToBoottimeOffset();
}
--
2.17.1

View File

@ -0,0 +1,79 @@
From 7f14fcbf4bcf6d8f8c4b89f6ac4b91bc4961ed6f Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 24 Apr 2018 00:14:28 +0200
Subject: [PATCH 12/14] FIH devices: Fix "Earpiece" audio output
On some FIH devices (confirmed on Razer, and probably on Aquos SS2),
Earpiece is not listed in attachedDevices, and devicePort's profile
mentions it is AUDIO_CHANNEL_IN_MONO, instead of AUDIO_CHANNEL_OUT_MONO.
Detect such cases (output device, but got only AUDIO_CHANNEL_IN_MONO),
and fix both channelMasks and attachedDevices
Change-Id: I4a88ba6d34d0fcd346eeea2ca903772f0271040a
---
.../managerdefinitions/src/Serializer.cpp | 27 ++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index e25dda07c7..a8eb142c81 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -396,15 +396,24 @@ Return<AudioGainTraits::Element> AudioGainTraits::deserialize(const xmlNode *cur
}
}
+static bool fixedEarpieceChannels = false;
Return<AudioProfileTraits::Element> AudioProfileTraits::deserialize(const xmlNode *cur,
- PtrSerializingCtx /*serializingContext*/)
+ PtrSerializingCtx serializingContext)
{
+ bool isOutput = serializingContext != nullptr;
std::string samplingRates = getXmlAttribute(cur, Attributes::samplingRates);
std::string format = getXmlAttribute(cur, Attributes::format);
std::string channels = getXmlAttribute(cur, Attributes::channelMasks);
+ ChannelTraits::Collection channelsMask = channelMasksFromString(channels, ",");
+
+ //Some Foxconn devices have wrong earpiece channel mask, leading to no channel mask
+ if(channelsMask.size() == 1 && *channelsMask.begin() == AUDIO_CHANNEL_IN_MONO && isOutput) {
+ fixedEarpieceChannels = true;
+ channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
+ }
Element profile = new AudioProfile(formatFromString(format, gDynamicFormat),
- channelMasksFromString(channels, ","),
+ channelsMask,
samplingRatesFromString(samplingRates, ","));
profile->setDynamicFormat(profile->getFormat() == gDynamicFormat);
@@ -517,7 +526,11 @@ Return<DevicePortTraits::Element> DevicePortTraits::deserialize(const xmlNode *c
Element deviceDesc = new DeviceDescriptor(type, name, address, encodedFormats);
AudioProfileTraits::Collection profiles;
- status_t status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
+ status_t status;
+ if(audio_is_output_devices(type))
+ status = deserializeCollection<AudioProfileTraits>(cur, &profiles, (PtrSerializingCtx)1);
+ else
+ status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
if (status != NO_ERROR) {
return Status::fromStatusT(status);
}
@@ -782,6 +795,14 @@ Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrS
}
}
}
+
+ if(fixedEarpieceChannels) {
+ sp<DeviceDescriptor> device =
+ module->getDeclaredDevices().getDeviceFromTagName("Earpiece");
+ if(device != 0)
+ ctx->addDevice(device);
+ fixedEarpieceChannels = false;
+ }
return module;
}
--
2.17.1

View File

@ -0,0 +1,32 @@
From 4b6dc11462996df5987ac339bf2fb750f500a067 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 12 Sep 2020 12:32:50 +0200
Subject: [PATCH 13/14] [audiopolicy] No longer make re-assigning legacy audio
groups fatal. Mi9 declares AUDIO_STREAM_PATCH and AUDIO_STREAM_REROUTING
which is defined by framework too
Change-Id: I794fe22d63a8af705be4f5f09b9879ecaab3eae5
---
services/audiopolicy/engine/common/src/EngineBase.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/services/audiopolicy/engine/common/src/EngineBase.cpp b/services/audiopolicy/engine/common/src/EngineBase.cpp
index 1bc7fe3dcc..fe18d0d794 100644
--- a/services/audiopolicy/engine/common/src/EngineBase.cpp
+++ b/services/audiopolicy/engine/common/src/EngineBase.cpp
@@ -206,9 +206,9 @@ engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig()
}
if (group.stream != AUDIO_STREAM_DEFAULT) {
// A legacy stream can be assigned once to a volume group
- LOG_ALWAYS_FATAL_IF(checkStreamForGroups(group.stream, mVolumeGroups),
- "stream %s already assigned to a volume group, "
- "review the configuration", toString(group.stream).c_str());
+ if(checkStreamForGroups(group.stream, mVolumeGroups)) {
+ ALOGE("stream %s already assigned to a volume group, review the configuration", toString(group.stream).c_str());
+ }
volumeGroup->addSupportedStream(group.stream);
}
addSupportedAttributesToGroup(group, volumeGroup, strategy);
--
2.17.1

View File

@ -0,0 +1,341 @@
From d24b9bfa7113578d6a9e7a98a01e0ef6dfb970ea Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 25 May 2020 21:26:54 +0200
Subject: [PATCH 14/14] Add persist.sys.phh.disable_a2dp_offload property to
force a2dp offload
Change-Id: Id474540c33c594cc4010a1a398d82bff8aadaeea
---
media/libstagefright/ACodec.cpp | 20 +-
.../managerdefinitions/src/Serializer.cpp | 181 +++++++++++++++++-
.../audiopolicy/enginedefault/src/Engine.cpp | 2 +-
.../managerdefault/AudioPolicyManager.cpp | 3 +
4 files changed, 199 insertions(+), 7 deletions(-)
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index e25f8f6558..7ff3c8f61b 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1166,6 +1166,9 @@ status_t ACodec::configureOutputBuffersFromNativeWindow(
return err;
}
+ ALOGE("Window undequeued buffers is %d\n", *minUndequeuedBuffers);
+ ALOGE("Consumerrequested %d\n", def.nBufferCountMin);
+
// FIXME: assume that surface is controlled by app (native window
// returns the number for the case when surface is not controlled by app)
// FIXME2: This means that minUndeqeueudBufs can be 1 larger than reported
@@ -1178,22 +1181,29 @@ status_t ACodec::configureOutputBuffersFromNativeWindow(
// 2. try to allocate two (2) additional buffers to reduce starvation from
// the consumer
// plus an extra buffer to account for incorrect minUndequeuedBufs
- for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) {
- OMX_U32 newBufferCount =
- def.nBufferCountMin + *minUndequeuedBuffers + extraBuffers;
+ for (int extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) {
+ int a = def.nBufferCountMin;
+ int b = *minUndequeuedBuffers;
+ int c = extraBuffers;
+ int newBufferCount = a+b+c;
def.nBufferCountActual = newBufferCount;
err = mOMXNode->setParameter(
OMX_IndexParamPortDefinition, &def, sizeof(def));
if (err == OK) {
- *minUndequeuedBuffers += extraBuffers;
+ ALOGE("Managed to allocate %d buffers (%d extra)\n", newBufferCount, extraBuffers);
+ if(extraBuffers > 0) {
+ *minUndequeuedBuffers += extraBuffers;
+ } else {
+ *minUndequeuedBuffers -= -extraBuffers;
+ }
break;
}
ALOGW("[%s] setting nBufferCountActual to %u failed: %d",
mComponentName.c_str(), newBufferCount, err);
/* exit condition */
- if (extraBuffers == 0) {
+ if (extraBuffers == -2 || newBufferCount == 1) {
return err;
}
}
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index a8eb142c81..73e4a3e096 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -29,6 +29,7 @@
#include <utils/StrongPointer.h>
#include <utils/Errors.h>
#include <utils/RefBase.h>
+#include <cutils/properties.h>
#include "Serializer.h"
#include "TypeConverter.h"
@@ -36,6 +37,8 @@ namespace android {
namespace {
+static bool forceDisableA2dpOffload = false;
+
// TODO(mnaganov): Consider finding an alternative for using HIDL code.
using hardware::Return;
using hardware::Status;
@@ -318,7 +321,7 @@ status_t deserializeCollection(const xmlNode *cur,
return status;
}
} else {
- return BAD_VALUE;
+ ALOGE("Ignoring...");
}
}
}
@@ -734,12 +737,34 @@ Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrS
Element module = new HwModule(name.c_str(), versionMajor, versionMinor);
+ bool isA2dpModule = strcmp(name.c_str(), "a2dp") == 0;
+ bool isPrimaryModule = strcmp(name.c_str(), "primary") == 0;
+
// Deserialize childrens: Audio Mix Port, Audio Device Ports (Source/Sink), Audio Routes
MixPortTraits::Collection mixPorts;
status_t status = deserializeCollection<MixPortTraits>(cur, &mixPorts, NULL);
if (status != NO_ERROR) {
return Status::fromStatusT(status);
}
+ if(forceDisableA2dpOffload && isA2dpModule) {
+ for(const auto& mixPort: mixPorts) {
+ ALOGE("Disable a2dp offload...? %s", mixPort->getTagName().c_str());
+ //"a2dp" sw module already has a2dp out
+ if(mixPort->getTagName() == "a2dp output") {
+ forceDisableA2dpOffload = false;
+ break;
+ }
+ }
+ }
+ if(forceDisableA2dpOffload && isA2dpModule) {
+ //Add
+ //<mixPort name="a2dp output" role="source"/>
+ auto mixPort = new IOProfile("a2dp output", AUDIO_PORT_ROLE_SOURCE);
+ AudioProfileTraits::Collection profiles;
+ profiles.add(AudioProfile::createFullDynamic());
+ mixPort->setAudioProfiles(profiles);
+ mixPorts.push_back(mixPort);
+ }
module->setProfiles(mixPorts);
DevicePortTraits::Collection devicePorts;
@@ -747,6 +772,90 @@ Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrS
if (status != NO_ERROR) {
return Status::fromStatusT(status);
}
+ Vector<std::string> a2dpOuts;
+ a2dpOuts.push_back("BT A2DP Out");
+ a2dpOuts.push_back("BT A2DP Headphones");
+ a2dpOuts.push_back("BT A2DP Speaker");
+ if(forceDisableA2dpOffload) {
+ if(isA2dpModule) {
+ //<devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink" address="lhdc_a2dp">
+ // <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ // samplingRates="44100,48000,96000"
+ // channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ //</devicePort>
+ if(true) {
+ FormatVector formats;
+ //auto devicePortOut = new DeviceDescriptor(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, formats, "BT A2DP Out");
+ auto devicePortOut = new DeviceDescriptor(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, "BT A2DP Out");
+ AudioProfileTraits::Collection profiles;
+ ChannelTraits::Collection channels;
+ channels.insert(AUDIO_CHANNEL_OUT_STEREO);
+ SampleRateSet sampleRates;
+ sampleRates.insert(44100);
+ sampleRates.insert(48000);
+ sampleRates.insert(96000);
+ auto profile = new AudioProfile(AUDIO_FORMAT_PCM_16_BIT, channels, sampleRates);
+ profiles.add(profile);
+ devicePortOut->setAudioProfiles(profiles);
+ devicePortOut->setAddress("lhdc_a2dp");
+ devicePorts.add(devicePortOut);
+ }
+ //<devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink" address="lhdc_a2dp">
+ // <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ // samplingRates="44100,48000,96000"
+ // channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ //</devicePort>
+ if(true) {
+ FormatVector formats;
+ auto devicePortOut = new DeviceDescriptor(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES, "BT A2DP Headphones");
+ AudioProfileTraits::Collection profiles;
+ ChannelTraits::Collection channels;
+ channels.insert(AUDIO_CHANNEL_OUT_STEREO);
+ SampleRateSet sampleRates;
+ sampleRates.insert(44100);
+ sampleRates.insert(48000);
+ sampleRates.insert(96000);
+ auto profile = new AudioProfile(AUDIO_FORMAT_PCM_16_BIT, channels, sampleRates);
+ profiles.add(profile);
+ devicePortOut->setAudioProfiles(profiles);
+ devicePortOut->setAddress("lhdc_a2dp");
+ devicePorts.add(devicePortOut);
+ }
+ //<devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink" address="lhdc_a2dp">
+ // <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ // samplingRates="44100,48000,96000"
+ // channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+ //</devicePort>
+ if(true) {
+ FormatVector formats;
+ auto devicePortOut = new DeviceDescriptor(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER, "BT A2DP Speaker");
+ AudioProfileTraits::Collection profiles;
+ ChannelTraits::Collection channels;
+ channels.insert(AUDIO_CHANNEL_OUT_STEREO);
+ SampleRateSet sampleRates;
+ sampleRates.insert(44100);
+ sampleRates.insert(48000);
+ sampleRates.insert(96000);
+ auto profile = new AudioProfile(AUDIO_FORMAT_PCM_16_BIT, channels, sampleRates);
+ profiles.add(profile);
+ devicePortOut->setAudioProfiles(profiles);
+ devicePortOut->setAddress("lhdc_a2dp");
+ devicePorts.add(devicePortOut);
+
+ }
+ } else if(isPrimaryModule) {
+ for(const auto& out: a2dpOuts) {
+ auto iterA = std::find_if(devicePorts.begin(), devicePorts.end(), [out](const auto port) {
+ if(port->getTagName() == out) return true;
+ return false;
+ });
+ if(iterA != devicePorts.end()) {
+ ALOGE("Erasing device port %s", (*iterA)->getTagName().c_str());
+ devicePorts.erase(iterA);
+ }
+ }
+ }
+ }
module->setDeclaredDevices(devicePorts);
RouteTraits::Collection routes;
@@ -754,7 +863,76 @@ Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrS
if (status != NO_ERROR) {
return Status::fromStatusT(status);
}
+ if(forceDisableA2dpOffload) {
+ if(strcmp(name.c_str(), "primary") == 0) {
+ for(const auto& out: a2dpOuts) {
+ auto iterA = std::find_if(routes.begin(), routes.end(), [out](const auto route) {
+ if(route->getType() != AUDIO_ROUTE_MIX)
+ return false;
+ auto sink = route->getSink();
+ if(sink->getTagName() == out) {
+ return true;
+ }
+ return false;
+ });
+ if(iterA != routes.end()) {
+ auto sink = (*iterA)->getSink()->getTagName();
+ ALOGE("Erasing route %s", sink.c_str());
+ routes.erase(iterA);
+ }
+ }
+ } else if(isA2dpModule) {
+ //<route type="mix" sink="BT A2DP Out"
+ // sources="a2dp output"/>
+ if(true) {
+ auto newRoute = new AudioRoute(AUDIO_ROUTE_MIX);
+ auto sink = module->findPortByTagName("BT A2DP Out");
+ auto source = module->findPortByTagName("a2dp output");
+ newRoute->setSink(sink);
+ Vector<sp<PolicyAudioPort>> sources;
+ sources.add(source);
+
+ sink->addRoute(newRoute);
+ source->addRoute(newRoute);
+ newRoute->setSources(sources);
+
+ routes.add(newRoute);
+ }
+ //<route type="mix" sink="BT A2DP Headphones"
+ // sources="a2dp output"/>
+ if(true) {
+ auto newRoute = new AudioRoute(AUDIO_ROUTE_MIX);
+ auto sink = module->findPortByTagName("BT A2DP Headphones");
+ auto source = module->findPortByTagName("a2dp output");
+ newRoute->setSink(sink);
+ Vector<sp<PolicyAudioPort>> sources;
+ sources.add(source);
+
+ sink->addRoute(newRoute);
+ source->addRoute(newRoute);
+ newRoute->setSources(sources);
+ routes.add(newRoute);
+ }
+ //<route type="mix" sink="BT A2DP Speaker"
+ // sources="a2dp output"/>
+ if(true) {
+ auto newRoute = new AudioRoute(AUDIO_ROUTE_MIX);
+ auto sink = module->findPortByTagName("BT A2DP Speaker");
+ auto source = module->findPortByTagName("a2dp output");
+ newRoute->setSink(sink);
+ Vector<sp<PolicyAudioPort>> sources;
+ sources.add(source);
+
+ sink->addRoute(newRoute);
+ source->addRoute(newRoute);
+ newRoute->setSources(sources);
+ routes.add(newRoute);
+ }
+ }
+ }
+ ALOGE("Good morning");
fixupQualcommBtScoRoute(routes, devicePorts, module.get());
+ ALOGE("Good morning2");
module->setRoutes(routes);
for (const xmlNode *children = cur->xmlChildrenNode; children != NULL;
@@ -932,6 +1110,7 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
status_t deserializeAudioPolicyFile(const char *fileName, AudioPolicyConfig *config)
{
PolicySerializer serializer;
+ forceDisableA2dpOffload = property_get_bool("persist.sys.phh.disable_a2dp_offload", false);
return serializer.deserialize(fileName, config);
}
diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp
index b14d2bbb0b..16a7a4bbac 100755
--- a/services/audiopolicy/enginedefault/src/Engine.cpp
+++ b/services/audiopolicy/enginedefault/src/Engine.cpp
@@ -52,7 +52,7 @@ static const std::vector<legacy_strategy_map>& getLegacyStrategy() {
{ "STRATEGY_ENFORCED_AUDIBLE", STRATEGY_ENFORCED_AUDIBLE },
{ "STRATEGY_TRANSMITTED_THROUGH_SPEAKER", STRATEGY_TRANSMITTED_THROUGH_SPEAKER },
{ "STRATEGY_ACCESSIBILITY", STRATEGY_ACCESSIBILITY },
- { "STRATEGY_REROUTING", STRATEGY_REROUTING },
+ //{ "STRATEGY_REROUTING", STRATEGY_REROUTING },
{ "STRATEGY_PATCH", STRATEGY_REROUTING }, // boiler to manage stream patch volume
{ "STRATEGY_CALL_ASSISTANT", STRATEGY_CALL_ASSISTANT },
};
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index c5c13e9a5a..1c5ed86b86 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -93,6 +93,8 @@ bool operator!= (const SortedVector<T> &left, const SortedVector<T> &right)
return !(left == right);
}
+static bool forceDisableA2dpOffload = false;
+
// ----------------------------------------------------------------------------
// AudioPolicyInterface implementation
// ----------------------------------------------------------------------------
@@ -4458,6 +4460,7 @@ static status_t deserializeAudioPolicyXmlConfig(AudioPolicyConfig &config) {
} else if (property_get_bool("persist.bluetooth.bluetooth_audio_hal.disabled", false)) {
fileNames.push_back(AUDIO_POLICY_BLUETOOTH_LEGACY_HAL_XML_CONFIG_FILE_NAME);
}
+ forceDisableA2dpOffload = property_get_bool("persist.sys.phh.disable_a2dp_offload", false);
fileNames.push_back(AUDIO_POLICY_XML_CONFIG_FILE_NAME);
for (const char* fileName : fileNames) {
--
2.17.1

View File

@ -0,0 +1,40 @@
From 3c374cb65bd0e28c73fbd452e8201487dd1acb94 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 3 Dec 2019 14:04:17 +0100
Subject: [PATCH 15/15] Fix for some Huawei camera
---
services/camera/libcameraservice/CameraService.cpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 5d062a5fb3..97e9825c51 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -16,7 +16,7 @@
#define LOG_TAG "CameraService"
#define ATRACE_TAG ATRACE_TAG_CAMERA
-//#define LOG_NDEBUG 0
+#define LOG_NDEBUG 0
#include <algorithm>
#include <climits>
@@ -235,10 +235,11 @@ status_t CameraService::enumerateProviders() {
if (!cameraFound) {
addStates(id8);
}
- }
-
- if (getCameraState(id8) == nullptr) {
onDeviceStatusChanged(id8, CameraDeviceStatus::PRESENT);
+ } else {
+ if (getCameraState(id8) == nullptr) {
+ onDeviceStatusChanged(id8, CameraDeviceStatus::PRESENT);
+ }
}
}
--
2.25.1

View File

@ -0,0 +1,30 @@
From 6a6c54584fae07783b493a56afd047984f589ed0 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 21 Dec 2020 20:19:11 +0100
Subject: [PATCH 16/16] Make camera IDs filter-out optional
Nowadays most people have Camera 2 apps, and would like to have all
cameras, rather than limit which cameras are available.
Add a property for that.
---
.../camera/libcameraservice/common/CameraProviderManager.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
index 0bff3606df..3e6ad1ef52 100644
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
@@ -183,7 +183,9 @@ std::vector<std::string> CameraProviderManager::getAPI1CompatibleCameraDeviceIds
// API1 app doesn't handle logical and physical camera devices well. So
// for each camera facing, only take the first id advertised by HAL in
// all [logical, physical1, physical2, ...] id combos, and filter out the rest.
- filterLogicalCameraIdsLocked(providerDeviceIds);
+ if(!property_get_bool("persist.sys.phh.include_all_cameras", false)) {
+ filterLogicalCameraIdsLocked(providerDeviceIds);
+ }
collectDeviceIdsLocked(providerDeviceIds, publicDeviceIds, systemDeviceIds);
}
auto sortFunc =
--
2.25.1

View File

@ -0,0 +1,174 @@
From a141c7102252377bc882b982b36980edb60f931e Mon Sep 17 00:00:00 2001
From: Wonsik Kim <wonsik@google.com>
Date: Tue, 5 Jan 2021 18:58:15 -0800
Subject: [PATCH 19/30] CCodec: store flushed config as work items
Store flushed config as work items and queue them to the component
directly, instead of going through MediaCodecBuffer.
Bug: 176501678
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Test: atest CtsMediaTestCases:AdaptivePlaybackTest
Merged-In: I19991101c388eca49226ad2abc37df9cea22dbb8
Change-Id: I19991101c388eca49226ad2abc37df9cea22dbb8
(cherry picked from commit 5ebfcb24855e526ec040b9f41d216f7604b8981a)
---
media/codec2/sfplugin/CCodecBufferChannel.cpp | 119 ++++++++----------
media/codec2/sfplugin/CCodecBufferChannel.h | 2 +-
2 files changed, 53 insertions(+), 68 deletions(-)
diff --git a/media/codec2/sfplugin/CCodecBufferChannel.cpp b/media/codec2/sfplugin/CCodecBufferChannel.cpp
index 1654b11c31..b8ca41b9a8 100644
--- a/media/codec2/sfplugin/CCodecBufferChannel.cpp
+++ b/media/codec2/sfplugin/CCodecBufferChannel.cpp
@@ -1300,54 +1300,30 @@ status_t CCodecBufferChannel::requestInitialInputBuffers() {
return a.capacity < b.capacity;
});
- {
- Mutexed<std::list<sp<ABuffer>>>::Locked configs(mFlushedConfigs);
- if (!configs->empty()) {
- while (!configs->empty()) {
- sp<ABuffer> config = configs->front();
- configs->pop_front();
- // Find the smallest input buffer that can fit the config.
- auto i = std::find_if(
- clientInputBuffers.begin(),
- clientInputBuffers.end(),
- [cfgSize = config->size()](const ClientInputBuffer& b) {
- return b.capacity >= cfgSize;
- });
- if (i == clientInputBuffers.end()) {
- ALOGW("[%s] no input buffer large enough for the config "
- "(%zu bytes)",
- mName, config->size());
- return NO_MEMORY;
- }
- sp<MediaCodecBuffer> buffer = i->buffer;
- memcpy(buffer->base(), config->data(), config->size());
- buffer->setRange(0, config->size());
- buffer->meta()->clear();
- buffer->meta()->setInt64("timeUs", 0);
- buffer->meta()->setInt32("csd", 1);
- if (queueInputBufferInternal(buffer) != OK) {
- ALOGW("[%s] Error while queueing a flushed config",
- mName);
- return UNKNOWN_ERROR;
- }
- clientInputBuffers.erase(i);
- }
- } else if (oStreamFormat.value == C2BufferData::LINEAR &&
- (!prepend || prepend.value == PREPEND_HEADER_TO_NONE)) {
- sp<MediaCodecBuffer> buffer = clientInputBuffers.front().buffer;
- // WORKAROUND: Some apps expect CSD available without queueing
- // any input. Queue an empty buffer to get the CSD.
- buffer->setRange(0, 0);
- buffer->meta()->clear();
- buffer->meta()->setInt64("timeUs", 0);
- if (queueInputBufferInternal(buffer) != OK) {
- ALOGW("[%s] Error while queueing an empty buffer to get CSD",
- mName);
- return UNKNOWN_ERROR;
- }
- clientInputBuffers.pop_front();
+ std::list<std::unique_ptr<C2Work>> flushedConfigs;
+ mFlushedConfigs.lock()->swap(flushedConfigs);
+ if (!flushedConfigs.empty()) {
+ err = mComponent->queue(&flushedConfigs);
+ if (err != C2_OK) {
+ ALOGW("[%s] Error while queueing a flushed config", mName);
+ return UNKNOWN_ERROR;
}
}
+ if (oStreamFormat.value == C2BufferData::LINEAR &&
+ (!prepend || prepend.value == PREPEND_HEADER_TO_NONE)) {
+ sp<MediaCodecBuffer> buffer = clientInputBuffers.front().buffer;
+ // WORKAROUND: Some apps expect CSD available without queueing
+ // any input. Queue an empty buffer to get the CSD.
+ buffer->setRange(0, 0);
+ buffer->meta()->clear();
+ buffer->meta()->setInt64("timeUs", 0);
+ if (queueInputBufferInternal(buffer) != OK) {
+ ALOGW("[%s] Error while queueing an empty buffer to get CSD",
+ mName);
+ return UNKNOWN_ERROR;
+ }
+ clientInputBuffers.pop_front();
+ }
for (const ClientInputBuffer& clientInputBuffer: clientInputBuffers) {
mCallback->onInputBufferAvailable(
@@ -1396,27 +1372,36 @@ void CCodecBufferChannel::release() {
void CCodecBufferChannel::flush(const std::list<std::unique_ptr<C2Work>> &flushedWork) {
ALOGV("[%s] flush", mName);
- {
- Mutexed<std::list<sp<ABuffer>>>::Locked configs(mFlushedConfigs);
- for (const std::unique_ptr<C2Work> &work : flushedWork) {
- if (!(work->input.flags & C2FrameData::FLAG_CODEC_CONFIG)) {
- continue;
- }
- if (work->input.buffers.empty()
- || work->input.buffers.front()->data().linearBlocks().empty()) {
- ALOGD("[%s] no linear codec config data found", mName);
- continue;
- }
- C2ReadView view =
- work->input.buffers.front()->data().linearBlocks().front().map().get();
- if (view.error() != C2_OK) {
- ALOGD("[%s] failed to map flushed codec config data: %d", mName, view.error());
- continue;
- }
- configs->push_back(ABuffer::CreateAsCopy(view.data(), view.capacity()));
- ALOGV("[%s] stashed flushed codec config data (size=%u)", mName, view.capacity());
- }
- }
+ std::list<std::unique_ptr<C2Work>> configs;
+ for (const std::unique_ptr<C2Work> &work : flushedWork) {
+ if (!(work->input.flags & C2FrameData::FLAG_CODEC_CONFIG)) {
+ continue;
+ }
+ if (work->input.buffers.empty()
+ || work->input.buffers.front() == nullptr
+ || work->input.buffers.front()->data().linearBlocks().empty()) {
+ ALOGD("[%s] no linear codec config data found", mName);
+ continue;
+ }
+ std::unique_ptr<C2Work> copy(new C2Work);
+ copy->input.flags = C2FrameData::flags_t(work->input.flags | C2FrameData::FLAG_DROP_FRAME);
+ copy->input.ordinal = work->input.ordinal;
+ copy->input.buffers.insert(
+ copy->input.buffers.begin(),
+ work->input.buffers.begin(),
+ work->input.buffers.end());
+ for (const std::unique_ptr<C2Param> &param : work->input.configUpdate) {
+ copy->input.configUpdate.push_back(C2Param::Copy(*param));
+ }
+ copy->input.infoBuffers.insert(
+ copy->input.infoBuffers.begin(),
+ work->input.infoBuffers.begin(),
+ work->input.infoBuffers.end());
+ copy->worklets.emplace_back(new C2Worklet);
+ configs.push_back(std::move(copy));
+ ALOGV("[%s] stashed flushed codec config data", mName);
+ }
+ mFlushedConfigs.lock()->swap(configs);
{
Mutexed<Input>::Locked input(mInput);
input->buffers->flush();
diff --git a/media/codec2/sfplugin/CCodecBufferChannel.h b/media/codec2/sfplugin/CCodecBufferChannel.h
index 046c5c3c49..e2c9aaa287 100644
--- a/media/codec2/sfplugin/CCodecBufferChannel.h
+++ b/media/codec2/sfplugin/CCodecBufferChannel.h
@@ -277,7 +277,7 @@ private:
uint32_t outputDelay;
};
Mutexed<Output> mOutput;
- Mutexed<std::list<sp<ABuffer>>> mFlushedConfigs;
+ Mutexed<std::list<std::unique_ptr<C2Work>>> mFlushedConfigs;
std::atomic_uint64_t mFrameIndex;
std::atomic_uint64_t mFirstValidFrameIndex;
--
2.25.1

View File

@ -0,0 +1,121 @@
From bfa866666f0fb3e95755e5fb5d22a89c1fdd6767 Mon Sep 17 00:00:00 2001
From: David Stevens <stevensd@google.com>
Date: Tue, 20 Oct 2020 15:00:41 +0900
Subject: [PATCH 20/30] BufferPool: limit number of idle buffers in caches
Some systems have limits on the total number of graphics buffers that
can be allocated, not just the total size. When dealing with
particularly small buffers, the caches could end up retaining 1000s of
buffers. This change adds an additional eviction trigger based on the
number of idle cached buffers.
Bug: 170702290
Bug: 171553040
Test: android.video.cts.VideoEncoderDecoderTest on ARCVM
Change-Id: If3f4433ba1794ccb624b864a56619c8613a315f2
(cherry picked from commit 0f50e523ef1404f9afbaa7b919e2801e5d94012a)
Merged-In: If3f4433ba1794ccb624b864a56619c8613a315f2
---
media/bufferpool/2.0/AccessorImpl.cpp | 13 +++++++++----
media/bufferpool/2.0/AccessorImpl.h | 6 ++++++
media/bufferpool/2.0/BufferPoolClient.cpp | 12 ++++++++++--
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/media/bufferpool/2.0/AccessorImpl.cpp b/media/bufferpool/2.0/AccessorImpl.cpp
index 6111feafb9..1d2562e41d 100644
--- a/media/bufferpool/2.0/AccessorImpl.cpp
+++ b/media/bufferpool/2.0/AccessorImpl.cpp
@@ -39,6 +39,8 @@ namespace {
static constexpr size_t kMinAllocBytesForEviction = 1024*1024*15;
static constexpr size_t kMinBufferCountForEviction = 25;
+ static constexpr size_t kMaxUnusedBufferCount = 64;
+ static constexpr size_t kUnusedBufferCountTarget = kMaxUnusedBufferCount - 16;
static constexpr nsecs_t kEvictGranularityNs = 1000000000; // 1 sec
static constexpr nsecs_t kEvictDurationNs = 5000000000; // 5 secs
@@ -724,9 +726,11 @@ ResultStatus Accessor::Impl::BufferPool::addNewBuffer(
}
void Accessor::Impl::BufferPool::cleanUp(bool clearCache) {
- if (clearCache || mTimestampUs > mLastCleanUpUs + kCleanUpDurationUs) {
+ if (clearCache || mTimestampUs > mLastCleanUpUs + kCleanUpDurationUs ||
+ mStats.buffersNotInUse() > kMaxUnusedBufferCount) {
mLastCleanUpUs = mTimestampUs;
- if (mTimestampUs > mLastLogUs + kLogDurationUs) {
+ if (mTimestampUs > mLastLogUs + kLogDurationUs ||
+ mStats.buffersNotInUse() > kMaxUnusedBufferCount) {
mLastLogUs = mTimestampUs;
ALOGD("bufferpool2 %p : %zu(%zu size) total buffers - "
"%zu(%zu size) used buffers - %zu/%zu (recycle/alloc) - "
@@ -737,8 +741,9 @@ void Accessor::Impl::BufferPool::cleanUp(bool clearCache) {
mStats.mTotalFetches, mStats.mTotalTransfers);
}
for (auto freeIt = mFreeBuffers.begin(); freeIt != mFreeBuffers.end();) {
- if (!clearCache && (mStats.mSizeCached < kMinAllocBytesForEviction
- || mBuffers.size() < kMinBufferCountForEviction)) {
+ if (!clearCache && mStats.buffersNotInUse() <= kUnusedBufferCountTarget &&
+ (mStats.mSizeCached < kMinAllocBytesForEviction ||
+ mBuffers.size() < kMinBufferCountForEviction)) {
break;
}
auto it = mBuffers.find(*freeIt);
diff --git a/media/bufferpool/2.0/AccessorImpl.h b/media/bufferpool/2.0/AccessorImpl.h
index cd1b4d08c1..3d39941337 100644
--- a/media/bufferpool/2.0/AccessorImpl.h
+++ b/media/bufferpool/2.0/AccessorImpl.h
@@ -193,6 +193,12 @@ private:
: mSizeCached(0), mBuffersCached(0), mSizeInUse(0), mBuffersInUse(0),
mTotalAllocations(0), mTotalRecycles(0), mTotalTransfers(0), mTotalFetches(0) {}
+ /// # of currently unused buffers
+ size_t buffersNotInUse() const {
+ ALOG_ASSERT(mBuffersCached >= mBuffersInUse);
+ return mBuffersCached - mBuffersInUse;
+ }
+
/// A new buffer is allocated on an allocation request.
void onBufferAllocated(size_t allocSize) {
mSizeCached += allocSize;
diff --git a/media/bufferpool/2.0/BufferPoolClient.cpp b/media/bufferpool/2.0/BufferPoolClient.cpp
index 342fef6b9d..9308b8159b 100644
--- a/media/bufferpool/2.0/BufferPoolClient.cpp
+++ b/media/bufferpool/2.0/BufferPoolClient.cpp
@@ -32,6 +32,8 @@ namespace implementation {
static constexpr int64_t kReceiveTimeoutUs = 1000000; // 100ms
static constexpr int kPostMaxRetry = 3;
static constexpr int kCacheTtlUs = 1000000; // TODO: tune
+static constexpr size_t kMaxCachedBufferCount = 64;
+static constexpr size_t kCachedBufferCountTarget = kMaxCachedBufferCount - 16;
class BufferPoolClient::Impl
: public std::enable_shared_from_this<BufferPoolClient::Impl> {
@@ -136,6 +138,10 @@ private:
--mActive;
mLastChangeUs = getTimestampNow();
}
+
+ int cachedBufferCount() const {
+ return mBuffers.size() - mActive;
+ }
} mCache;
// FMQ - release notifier
@@ -668,10 +674,12 @@ bool BufferPoolClient::Impl::syncReleased(uint32_t messageId) {
// should have mCache.mLock
void BufferPoolClient::Impl::evictCaches(bool clearCache) {
int64_t now = getTimestampNow();
- if (now >= mLastEvictCacheUs + kCacheTtlUs || clearCache) {
+ if (now >= mLastEvictCacheUs + kCacheTtlUs ||
+ clearCache || mCache.cachedBufferCount() > kMaxCachedBufferCount) {
size_t evicted = 0;
for (auto it = mCache.mBuffers.begin(); it != mCache.mBuffers.end();) {
- if (!it->second->hasCache() && (it->second->expire() || clearCache)) {
+ if (!it->second->hasCache() && (it->second->expire() ||
+ clearCache || mCache.cachedBufferCount() > kCachedBufferCountTarget)) {
it = mCache.mBuffers.erase(it);
++evicted;
} else {
--
2.25.1

View File

@ -0,0 +1,66 @@
From ecab6fe48819adeafaceec1a33e7e1d380caec75 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 13 Mar 2021 14:20:03 -0500
Subject: [PATCH 33/38] Support Samsung R multi-cams
---
services/camera/libcameraservice/Android.bp | 1 +
.../libcameraservice/common/CameraProviderManager.cpp | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
index be275e9346..bede98bfdc 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
@@ -129,6 +129,7 @@ cc_library_shared {
"android.hardware.camera.device@3.5",
"android.hardware.camera.device@3.6",
"vendor.samsung.hardware.camera.provider@3.0",
+ "vendor.samsung.hardware.camera.provider@4.0",
],
static_libs: [
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
index 3e6ad1ef52..b7d1a57567 100644
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
@@ -22,6 +22,7 @@
#include <android/hardware/camera/device/3.5/ICameraDevice.h>
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
+#include <vendor/samsung/hardware/camera/provider/4.0/ISehCameraProvider.h>
#include <algorithm>
#include <chrono>
@@ -1363,7 +1364,9 @@ status_t CameraProviderManager::ProviderInfo::initialize(
}
auto samsungCast = vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider::castFrom(interface);
+ auto samsung40Cast = vendor::samsung::hardware::camera::provider::V4_0::ISehCameraProvider::castFrom(interface);
auto samsungProvider = samsungCast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider>>(samsungCast) : nullptr;
+ auto samsung40Provider = samsung40Cast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V4_0::ISehCameraProvider>>(samsung40Cast) : nullptr;
hardware::Return<bool> linked = interface->linkToDeath(this, /*cookie*/ mId);
if (!linked.isOk()) {
@@ -1401,6 +1404,7 @@ status_t CameraProviderManager::ProviderInfo::initialize(
status = idStatus;
if (status == Status::OK) {
for (auto& name : cameraDeviceNames) {
+ ALOGE("Listing camera ID %s", name.c_str());
uint16_t major, minor;
std::string type, id;
status_t res = parseDeviceName(name, &major, &minor, &type, &id);
@@ -1414,7 +1418,9 @@ status_t CameraProviderManager::ProviderInfo::initialize(
}
} };
hardware::Return<void> ret;
- if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
+ if(samsung40Provider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
+ ret = samsung40Provider->sehGetCameraIdList(cb);
+ else if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
ret = samsungProvider->sehGetCameraIdList(cb);
else
ret = interface->getCameraIdList(cb);
--
2.25.1

View File

@ -0,0 +1,30 @@
From 347755b3b0d26b557ac0775433ccdbabe23ac6ed Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 23 Mar 2021 00:16:42 +0100
Subject: [PATCH 34/38] [audiopolicy] Don't crash on unknown audio devices
---
.../common/managerdefinitions/src/Serializer.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index 73e4a3e096..1f200ad850 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -951,7 +951,12 @@ Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrS
sp<DeviceDescriptor> device = module->getDeclaredDevices().
getDeviceFromTagName(std::string(reinterpret_cast<const char*>(
attachedDevice.get())));
- ctx->addDevice(device);
+ if(device != nullptr) {
+ ctx->addDevice(device);
+ } else {
+ ALOGE("NULL DEVICE %s: %s %s=%s", __func__, tag, childAttachedDeviceTag,
+ reinterpret_cast<const char*>(attachedDevice.get()));
+ }
}
}
}
--
2.25.1

View File

@ -0,0 +1,99 @@
From 0b8723c62a0d5b63f8afd46fddc3c38123b49d04 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Sun, 28 Mar 2021 16:17:36 +0800
Subject: [PATCH 35/38] AudioPolicyManager: retry with SW bridge if hardware
audio patch fails
* On two of my MT6771 Q vendor devices, in-call audio is broken due to
the audio HAL claiming to support HW audio patch between the Rx / Tx
devices but failing when called with `createAudioPatch`.
> 03-28 11:56:42.300 1345 1345 W AudioALSAHardware: sinks[0].type ==
AUDIO_PORT_TYPE_DEVICE
> 03-28 11:56:42.300 1345 1345 W AudioALSAHardware: [createAudioPatch]
[5082]
> 03-28 11:56:42.300 1345 1345 E AudioALSAHardware: Fail status -38
> 03-28 11:56:42.300 1345 1345 W DeviceHAL: Error from HAL Device in
function create_audio_patch: Function not implemented
> 03-28 11:56:42.301 1358 1374 W APM_AudioPolicyManager:
createAudioPatchInternal patch panel could not connect device patch,
error -38
> 03-28 11:56:42.301 1358 1374 W APM_AudioPolicyManager:
createTelephonyPatch() error -38 creating RX audio patch
* This was not broken on Q because
`AudioPolicyManager::updateCallRouting` bypasses `createAudioPatch` by
directly calling the legacy `setOutputDevice` when `supportsPatch` is
true, i.e. `createAudioPatch` was *only* used for SW bridge for
in-call audio before R.
* As a workaround, re-try by forcing the creation of a SW bridge after
`createAudioPatch` fails. We could also restore the old behavior of
`updateCallRouting`, but that would probably break in-call audio on
newer HALs that may or may not work properly with `setOutputDevice`.
---
.../managerdefault/AudioPolicyManager.cpp | 13 ++++++++++---
.../audiopolicy/managerdefault/AudioPolicyManager.h | 4 +++-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 63dcd538b1..6d2c38811e 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -3490,7 +3490,8 @@ status_t AudioPolicyManager::getAudioPort(struct audio_port *port)
status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *patch,
audio_patch_handle_t *handle,
uid_t uid, uint32_t delayMs,
- const sp<SourceClientDescriptor>& sourceDesc)
+ const sp<SourceClientDescriptor>& sourceDesc,
+ bool forceSwBridge)
{
ALOGV("%s", __func__);
if (handle == NULL || patch == NULL) {
@@ -3694,7 +3695,8 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
// - audio HAL version is >= 3.0 but no route has been declared between devices
// - called from startAudioSource (aka sourceDesc != nullptr) and source device does
// not have a gain controller
- if (!srcDevice->hasSameHwModuleAs(sinkDevice) ||
+ // - a previous attempt at using HW bridge failed (forceSwBridge)
+ if (forceSwBridge || !srcDevice->hasSameHwModuleAs(sinkDevice) ||
(srcDevice->getModuleVersionMajor() < 3) ||
!srcDevice->getModule()->supportsPatch(srcDevice, sinkDevice) ||
(sourceDesc != nullptr &&
@@ -3759,7 +3761,12 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
__func__, index, handle, patchBuilder.patch(), delayMs, uid, &patchDesc);
if (status != NO_ERROR) {
ALOGW("%s patch panel could not connect device patch, error %d", __func__, status);
- return INVALID_OPERATION;
+ if (forceSwBridge || patch->sinks[0].type != AUDIO_PORT_TYPE_DEVICE) {
+ return INVALID_OPERATION;
+ } else {
+ ALOGW("Retrying with software bridging.");
+ return createAudioPatchInternal(patch, handle, uid, delayMs, sourceDesc, true);
+ }
}
} else {
return BAD_VALUE;
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index b588f898d4..60cbd7175e 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -910,12 +910,14 @@ private:
* @param[in] delayMs if required
* @param[in] sourceDesc [optional] in case of external source, source client to be
* configured by the patch, i.e. assigning an Output (HW or SW)
+ * @param[in] forceSwBridge [optional] force the creation of a SW bridge (internal use only)
* @return NO_ERROR if patch installed correctly, error code otherwise.
*/
status_t createAudioPatchInternal(const struct audio_patch *patch,
audio_patch_handle_t *handle,
uid_t uid, uint32_t delayMs = 0,
- const sp<SourceClientDescriptor>& sourceDesc = nullptr);
+ const sp<SourceClientDescriptor>& sourceDesc = nullptr,
+ bool forceSwBridge = false);
/**
* @brief releaseAudioPatchInternal internal function to remove an audio patch
* @param[in] handle of the patch to be removed
--
2.25.1

View File

@ -0,0 +1,26 @@
From c8a6af6fd0f3134b96fc291910cfc0380bc0dc31 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 28 Mar 2021 14:47:52 +0200
Subject: [PATCH 36/38] Reenable STRATEGY_ROUTING. This is a leftover of tries
of 587b198, wrongly commited in 20f869
---
services/audiopolicy/enginedefault/src/Engine.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp
index 16a7a4bbac..b14d2bbb0b 100755
--- a/services/audiopolicy/enginedefault/src/Engine.cpp
+++ b/services/audiopolicy/enginedefault/src/Engine.cpp
@@ -52,7 +52,7 @@ static const std::vector<legacy_strategy_map>& getLegacyStrategy() {
{ "STRATEGY_ENFORCED_AUDIBLE", STRATEGY_ENFORCED_AUDIBLE },
{ "STRATEGY_TRANSMITTED_THROUGH_SPEAKER", STRATEGY_TRANSMITTED_THROUGH_SPEAKER },
{ "STRATEGY_ACCESSIBILITY", STRATEGY_ACCESSIBILITY },
- //{ "STRATEGY_REROUTING", STRATEGY_REROUTING },
+ { "STRATEGY_REROUTING", STRATEGY_REROUTING },
{ "STRATEGY_PATCH", STRATEGY_REROUTING }, // boiler to manage stream patch volume
{ "STRATEGY_CALL_ASSISTANT", STRATEGY_CALL_ASSISTANT },
};
--
2.25.1

View File

@ -0,0 +1,40 @@
From c3bd3dc63c34de7c688b24999769f7eb504784a3 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 28 Mar 2021 14:48:49 +0200
Subject: [PATCH 37/38] Use a fake volume policy when none has been found
This is useful, because on Samsung devices, the "real"
(=non-gsi-cheating) audio policy doesn't have any volume policy.
This requires actually adding the fake audio policy xml file (done in
device/phh/treble)
---
services/audiopolicy/engine/config/src/EngineConfig.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/services/audiopolicy/engine/config/src/EngineConfig.cpp b/services/audiopolicy/engine/config/src/EngineConfig.cpp
index 4842cb282f..e8d6917754 100644
--- a/services/audiopolicy/engine/config/src/EngineConfig.cpp
+++ b/services/audiopolicy/engine/config/src/EngineConfig.cpp
@@ -717,11 +717,17 @@ android::status_t parseLegacyVolumes(VolumeGroups &volumeGroups) {
snprintf(audioPolicyXmlConfigFile, sizeof(audioPolicyXmlConfigFile),
"%s/%s", path.c_str(), fileName);
ret = parseLegacyVolumeFile(audioPolicyXmlConfigFile, volumeGroups);
- if (ret == NO_ERROR) {
+ ALOGE("Parsing volume for %s gave %zu", audioPolicyXmlConfigFile, volumeGroups.size());
+ if (ret == NO_ERROR && volumeGroups.size() > 0) {
return ret;
}
}
}
+ ret = parseLegacyVolumeFile("/system/etc/fake_audio_policy_volume.xml", volumeGroups);
+ ALOGE("Parsing volume for /system/etc/fake_audio_policy_volume.xml gave %zu", volumeGroups.size());
+ if (ret == NO_ERROR && volumeGroups.size() == 0) {
+ return ret;
+ }
return BAD_VALUE;
}
--
2.25.1

View File

@ -0,0 +1,31 @@
From 23f277e7a6afee9d256582204099c4c645606b98 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 28 Mar 2021 18:54:47 +0200
Subject: [PATCH 38/38] Not all sources in a route are valid. Dont ignore the
whole route because of one broken source
---
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
index 1f200ad850..e57bd24724 100644
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
@@ -609,10 +609,11 @@ Return<RouteTraits::Element> RouteTraits::deserialize(const xmlNode *cur, PtrSer
source = ctx->findPortByTagName(trim(devTag));
if (source == NULL) {
ALOGE("%s: no source found with name=%s", __func__, devTag);
- return Status::fromStatusT(BAD_VALUE);
}
}
- sources.add(source);
+ if(source != nullptr) {
+ sources.add(source);
+ }
}
devTag = strtok(NULL, ",");
}
--
2.25.1

Some files were not shown because too many files have changed in this diff Show More