From ee88258bcf422b86bce9e0bf03c7556c54a3cda2 Mon Sep 17 00:00:00 2001 From: DHD2280 Date: Tue, 30 Apr 2024 01:03:53 +0200 Subject: [PATCH] Misc Fixes --- .github/workflows/crowdin_download.yml | 2 +- ...atteryAiroo.kt => PortraitBatteryAiroo.kt} | 0 .../systemui/lockscreen/LockscreenClock.java | 1 + .../xposed/utils/SystemUtils.java | 21 +++++++++++++++++++ app/src/main/res/xml/launcher_mods.xml | 1 - 5 files changed, 23 insertions(+), 2 deletions(-) rename app/src/main/java/it/dhd/oxygencustomizer/xposed/batterystyles/{PotraitBatteryAiroo.kt => PortraitBatteryAiroo.kt} (100%) diff --git a/.github/workflows/crowdin_download.yml b/.github/workflows/crowdin_download.yml index 13c5263c3..45b38fce3 100644 --- a/.github/workflows/crowdin_download.yml +++ b/.github/workflows/crowdin_download.yml @@ -29,6 +29,6 @@ jobs: localization_branch_name: beta-localization create_pull_request: true env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file diff --git a/app/src/main/java/it/dhd/oxygencustomizer/xposed/batterystyles/PotraitBatteryAiroo.kt b/app/src/main/java/it/dhd/oxygencustomizer/xposed/batterystyles/PortraitBatteryAiroo.kt similarity index 100% rename from app/src/main/java/it/dhd/oxygencustomizer/xposed/batterystyles/PotraitBatteryAiroo.kt rename to app/src/main/java/it/dhd/oxygencustomizer/xposed/batterystyles/PortraitBatteryAiroo.kt diff --git a/app/src/main/java/it/dhd/oxygencustomizer/xposed/hooks/systemui/lockscreen/LockscreenClock.java b/app/src/main/java/it/dhd/oxygencustomizer/xposed/hooks/systemui/lockscreen/LockscreenClock.java index d184edff5..d8acf3b00 100644 --- a/app/src/main/java/it/dhd/oxygencustomizer/xposed/hooks/systemui/lockscreen/LockscreenClock.java +++ b/app/src/main/java/it/dhd/oxygencustomizer/xposed/hooks/systemui/lockscreen/LockscreenClock.java @@ -603,6 +603,7 @@ private void initRamUsage() { ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); mActivityManager.getMemoryInfo(memoryInfo); long usedMemory = memoryInfo.totalMem - memoryInfo.availMem; + if (memoryInfo.totalMem == 0) return; int usedMemoryPercentage = (int) ((usedMemory * 100) / memoryInfo.totalMem); if (mRamUsageArcProgress != null) { diff --git a/app/src/main/java/it/dhd/oxygencustomizer/xposed/utils/SystemUtils.java b/app/src/main/java/it/dhd/oxygencustomizer/xposed/utils/SystemUtils.java index 0387ad697..4218dccaf 100644 --- a/app/src/main/java/it/dhd/oxygencustomizer/xposed/utils/SystemUtils.java +++ b/app/src/main/java/it/dhd/oxygencustomizer/xposed/utils/SystemUtils.java @@ -99,6 +99,14 @@ public static BatteryManager BatteryManager() { : instance.getBatteryManager(); } + @Nullable + @Contract(pure = true) + public static UserManager UserManager() { + return instance == null + ? null + : instance.getUserManager(); + } + private CameraManager getCameraManager() { if(mCameraManager == null) { @@ -228,6 +236,19 @@ private BatteryManager getBatteryManager() { return mBatteryManager; } + private UserManager getUserManager() { + if (mUserManager == null) { + try { + mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); + } catch (Throwable t) { + if (BuildConfig.DEBUG) { + log(t); + } + } + } + return mUserManager; + } + private VibratorManager getVibrationManager() { if(mVibrationManager == null) diff --git a/app/src/main/res/xml/launcher_mods.xml b/app/src/main/res/xml/launcher_mods.xml index d801176e9..b9c1ae647 100644 --- a/app/src/main/res/xml/launcher_mods.xml +++ b/app/src/main/res/xml/launcher_mods.xml @@ -8,7 +8,6 @@ android:key="launcher_intro" app:iconSpaceReserved="false" android:title="@string/launcher_intro_title" - android:layout="@layout/preference_clock_layout" search:ignore="true"/>