PixelParts: Version 2.0
- Move all features to the appropriate locations in Settings rather than having an entire activity/fragment for assorted features. - Set pixel torch as UNAVAILABLE onTorchModeUnavailable. - Display accurate message if get*StringResourceId fails. - Include overlay to disable ROM side cycle_count preference. - Remove Jitter benchmark (we have it ROM side). - Remove Direct HBM. - Remove ShakeUtils and LeonidsLib. - Remove about activity/fragment. - Various misc changes and cleanups. Signed-off-by: AnierinB <anierin@evolution-x.org>
This commit is contained in:
20
Android.bp
20
Android.bp
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (C) 2023 The Evolution X Project
|
||||
// Copyright (C) 2023-2024 The Evolution X Project
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
@@ -8,28 +8,20 @@ android_app {
|
||||
defaults: [
|
||||
"SettingsLibDefaults",
|
||||
],
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt",
|
||||
],
|
||||
|
||||
srcs: ["src/**/*.java"],
|
||||
resource_dirs: ["res"],
|
||||
certificate: "platform",
|
||||
platform_apis: true,
|
||||
system_ext_specific: true,
|
||||
privileged: true,
|
||||
|
||||
static_libs: [
|
||||
"androidx.core_core",
|
||||
"androidx.preference_preference",
|
||||
"particles",
|
||||
],
|
||||
resource_dirs: ["res"],
|
||||
|
||||
optimize: {
|
||||
proguard_flags_files: ["proguard.flags"],
|
||||
},
|
||||
}
|
||||
|
||||
java_import {
|
||||
name: "particles",
|
||||
jars: [
|
||||
"libs/LeonidsLib.jar",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
@@ -8,11 +8,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:sharedUserId="android.uid.system"
|
||||
package="org.evolution.pixelparts"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-permission android:name="android.permission.INJECT_EVENTS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
||||
android:versionCode="2"
|
||||
android:versionName="2.0" >
|
||||
|
||||
<application
|
||||
android:icon="@drawable/ic_launcher_settings"
|
||||
@@ -27,29 +24,6 @@
|
||||
android:authorities="${applicationId}.androidx-startup"
|
||||
tools:replace="android:authorities"/>
|
||||
|
||||
<!-- PixelParts -->
|
||||
<activity
|
||||
android:name=".PixelPartsActivity"
|
||||
android:label="@string/pixel_parts_title"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.android.settings.action.EXTRA_SETTINGS" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="com.android.settings.icon"
|
||||
android:resource="@drawable/ic_pixel_parts" />
|
||||
<meta-data
|
||||
android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.homepage" />
|
||||
<meta-data android:name="com.android.settings.summary"
|
||||
android:resource="@string/pixel_parts_summary" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".PixelParts"
|
||||
android:exported="false" />
|
||||
|
||||
<!-- PixelParts boot completed receiver -->
|
||||
<receiver
|
||||
android:name=".Startup"
|
||||
android:exported="false">
|
||||
@@ -58,87 +32,61 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- HBM service -->
|
||||
<service
|
||||
android:name=".services.HBMService"
|
||||
android:exported="false" />
|
||||
|
||||
<!-- Auto HBM service -->
|
||||
<service
|
||||
android:name=".services.AutoHBMService"
|
||||
android:exported="false" />
|
||||
|
||||
<!-- About activity -->
|
||||
<activity
|
||||
android:name=".about.AboutActivity"
|
||||
android:label="@string/pixel_parts_about_title"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- Auto HBM activity -->
|
||||
<activity
|
||||
android:name=".autohbm.AutoHBMActivity"
|
||||
android:name=".autohbm.AutoHbmActivity"
|
||||
android:label="@string/auto_hbm_title"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.display" />
|
||||
<meta-data
|
||||
android:name="com.android.settings.summary"
|
||||
android:resource="@string/auto_hbm_summary" />
|
||||
</activity>
|
||||
|
||||
<!-- Auto HBM service -->
|
||||
<service
|
||||
android:name=".autohbm.AutoHbmService"
|
||||
android:exported="false" />
|
||||
|
||||
<!-- Auto HBM tile service -->
|
||||
<service
|
||||
android:name=".autohbm.AutoHbmTileService"
|
||||
android:label="@string/auto_hbm_title"
|
||||
android:icon="@drawable/ic_auto_hbm_tile"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.service.quicksettings.TOGGLEABLE_TILE"
|
||||
android:value="true" />
|
||||
</service>
|
||||
|
||||
<!-- Battery info activity -->
|
||||
<activity
|
||||
android:name=".batteryinfo.BatteryInfoActivity"
|
||||
android:label="@string/battery_info_title"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.battery" />
|
||||
<meta-data
|
||||
android:name="com.android.settings.summary"
|
||||
android:resource="@string/battery_info_summary" />
|
||||
</activity>
|
||||
|
||||
<!-- Jitter test activity -->
|
||||
<activity
|
||||
android:name=".uibench.JitterTestActivity"
|
||||
android:label="@string/jitter_test_title"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- Saturation activity -->
|
||||
<activity
|
||||
android:name=".saturation.SaturationActivity"
|
||||
android:label="@string/saturation_title"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- PixelParts tile service -->
|
||||
<service
|
||||
android:name=".services.PixelPartsTileService"
|
||||
android:label="@string/pixel_parts_title"
|
||||
android:icon="@drawable/ic_pixel_parts_tile"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- Battery info tile service -->
|
||||
<service
|
||||
android:name=".services.BatteryInfoTileService"
|
||||
android:name=".batteryinfo.BatteryInfoTileService"
|
||||
android:label="@string/battery_info_title"
|
||||
android:icon="@drawable/ic_battery_info_tile"
|
||||
android:exported="true"
|
||||
@@ -148,9 +96,73 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- Charge control activity -->
|
||||
<activity
|
||||
android:name=".chargecontrol.ChargeControlActivity"
|
||||
android:label="@string/charge_control_title"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.battery" />
|
||||
<meta-data
|
||||
android:name="com.android.settings.summary"
|
||||
android:resource="@string/charge_control_summary" />
|
||||
</activity>
|
||||
|
||||
<!-- Pixel torch activity -->
|
||||
<activity
|
||||
android:name=".pixeltorch.PixelTorchActivity"
|
||||
android:label="@string/pixel_torch_title"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.apps" />
|
||||
<meta-data
|
||||
android:name="com.android.settings.summary"
|
||||
android:resource="@string/pixel_torch_summary" />
|
||||
</activity>
|
||||
|
||||
<!-- Pixel torch tile service -->
|
||||
<service
|
||||
android:name=".pixeltorch.PixelTorchTileService"
|
||||
android:label="@string/pixel_torch_title"
|
||||
android:icon="@drawable/ic_pixel_torch_tile"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.service.quicksettings.TOGGLEABLE_TILE"
|
||||
android:value="true" />
|
||||
</service>
|
||||
|
||||
<!-- Saturation activity -->
|
||||
<activity
|
||||
android:name=".saturation.SaturationActivity"
|
||||
android:label="@string/saturation_title"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.display" />
|
||||
<meta-data
|
||||
android:name="com.android.settings.summary"
|
||||
android:resource="@string/saturation_summary" />
|
||||
</activity>
|
||||
|
||||
<!-- Saturation tile service -->
|
||||
<service
|
||||
android:name=".services.SaturationTileService"
|
||||
android:name=".saturation.SaturationTileService"
|
||||
android:label="@string/saturation_title"
|
||||
android:icon="@drawable/ic_saturation_tile"
|
||||
android:exported="true"
|
||||
@@ -160,65 +172,35 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- PixelTorch tile service -->
|
||||
<service
|
||||
android:name=".services.PixelTorchTileService"
|
||||
android:label="@string/pixeltorch_tile_title"
|
||||
android:icon="@drawable/ic_pixeltorch_tile"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- HBM tile service -->
|
||||
<service
|
||||
android:name=".services.HBMTileService"
|
||||
android:label="@string/hbm_title"
|
||||
android:icon="@drawable/ic_hbm_tile"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- Auto HBM tile service -->
|
||||
<service
|
||||
android:name=".services.AutoHBMTileService"
|
||||
android:label="@string/auto_hbm_title"
|
||||
android:icon="@drawable/ic_hbm_tile"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- USB 2.0 Fastcharge tile service -->
|
||||
<service
|
||||
android:name=".services.USB2FCTileService"
|
||||
android:label="@string/usb2_fast_charge_title"
|
||||
android:icon="@drawable/ic_usb2_fc_tile"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- Search Provider -->
|
||||
<provider
|
||||
android:name=".ConfigPanelSearchIndexablesProvider"
|
||||
android:authorities="org.evolution.pixelparts"
|
||||
android:multiprocess="false"
|
||||
android:grantUriPermissions="true"
|
||||
android:permission="android.permission.READ_SEARCH_INDEXABLES"
|
||||
<!-- Fast charge activity-->
|
||||
<activity
|
||||
android:name=".fastcharge.FastChargeActivity"
|
||||
android:label="@string/fast_charge_title"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.content.action.SEARCH_INDEXABLES_PROVIDER" />
|
||||
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||
</intent-filter>
|
||||
</provider>
|
||||
<meta-data
|
||||
android:name="com.android.settings.category"
|
||||
android:value="com.android.settings.category.ia.battery" />
|
||||
<meta-data
|
||||
android:name="com.android.settings.summary"
|
||||
android:resource="@string/fast_charge_summary" />
|
||||
</activity>
|
||||
|
||||
<!-- Fast charge tile service -->
|
||||
<service
|
||||
android:name=".fastcharge.FastChargeTileService"
|
||||
android:label="@string/fast_charge_title"
|
||||
android:icon="@drawable/ic_fast_charge_tile"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.service.quicksettings.TOGGLEABLE_TILE"
|
||||
android:value="true" />
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
BIN
PixelParts.png
BIN
PixelParts.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB |
33
README.md
33
README.md
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
## About the app
|
||||
|
||||
@@ -8,15 +8,12 @@ PixelParts began as a simple High Brightness Mode (HBM) tool. Since then, it has
|
||||
|
||||
| Category | Feature | Description | QS Tile | Required kernel changes |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| **Battery** | `Battery info` | View various battery information | N/A |N/A |
|
||||
| | `Start/Stop charging` | Start/stop charging at specific percentages | N/A | N/A |
|
||||
| **Display** | `High brightness mode (HBM)` | Enable peak luminance. | Yes | N/A |
|
||||
| | `Automatic HBM` | Enable peak luminance based on sunlight | Yes | N/A |
|
||||
| | `Saturation` | Control the saturation level of the display | N/A | N/A |
|
||||
| **Leds** | `Torch strength` | Adjust the brightness of the PixelParts flashlight QS-Tile | PixelParts Flashlight QS | N/A |
|
||||
| **Ui-Bench** | `Jitter` | Calculate rendering jitter. | N/A | N/A |
|
||||
| **USB** | `USB 2.0 fast charge` | Enable CDP mode for faster charging on USB 2.0 ports. | Yes | [Commit 1/1](https://github.com/Evolution-X-Devices/kernel_google_gs101/commit/dcbfcd76bdc5d72e16f85fd8a48de6afa8804b61) |
|
||||
|
||||
| **Battery** | `Battery information` | View various battery information | Yes |N/A |
|
||||
| | `Charge control` | Start/stop charging at specific percentages | N/A | N/A |
|
||||
| | `Fast charge` | Enable CDP mode for faster charging on USB 2.0 ports. | Yes | [Commit 1/1](https://github.com/Evolution-X-Devices/kernel_google_gs101/commit/dcbfcd76bdc5d72e16f85fd8a48de6afa8804b61) |
|
||||
| **Display** | `Automatic high brightness mode (HBM)` | Enable peak luminance based on sunlight | Yes | N/A |
|
||||
| | `Saturation` | Control the saturation level of the display | Yes | N/A |
|
||||
| **Leds** | `Pixel torch` | Adjust the brightness of the PixelParts flashlight QS-Tile | PixelParts Flashlight QS | N/A |
|
||||
|
||||
## Including PixelParts
|
||||
|
||||
@@ -41,7 +38,7 @@ croot && git clone https://github.com/Evolution-X-Devices/packages_apps_PixelPar
|
||||
include packages/apps/PixelParts/device.mk
|
||||
```
|
||||
|
||||
This line includes the [device.mk](https://github.com/Evolution-X-Devices/packages_apps_PixelParts/blob/tiramisu/device.mk) file from the PixelParts repository, which will add the PixelParts application, its initialization script (init.rc), and the necessary security policies (sepolicies) to your AOSP build during compilation.
|
||||
This line includes the [device.mk](https://github.com/Evolution-X-Devices/packages_apps_PixelParts/blob/udc/device.mk) file from the PixelParts repository, which will add the PixelParts application, its initialization script (init.rc), and the necessary security policies (sepolicies) to your AOSP build during compilation.
|
||||
|
||||
## Testing changes
|
||||
|
||||
@@ -54,19 +51,9 @@ m PixelParts
|
||||
```
|
||||
- This also assumes you are already running an AOSP build including PixelParts as a priv-app in /system_ext.
|
||||
|
||||
## Screenshots
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
## Credits
|
||||
|
||||
| Work | Author |
|
||||
| Work | Author |
|
||||
| ----------------------------------------------------------- | --------------------------------------------------------------------------- |
|
||||
| Base preference fragment & CustomSeekBar preference | [Neobuddy89](https://forum.xda-developers.com/m/neobuddy89.3795148/) |
|
||||
| CustomSeekBar preference | [Neobuddy89](https://forum.xda-developers.com/m/neobuddy89.3795148/) |
|
||||
| Original AutoHBMService | [Hikari no Tenshi](https://forum.xda-developers.com/m/hikari-no-tenshi.4337348/) & [maxwen](https://forum.xda-developers.com/m/maxwen.4683552/) |
|
||||
| ShakeUtils | [AmeChanRain](https://github.com/AmeChanRain) |
|
||||
| First launch warning dialog | [Ramyski](https://forum.xda-developers.com/m/ramyski.8538037/) |
|
||||
| Leonids particle system | [Plattysoft](https://github.com/plattysoft) |
|
||||
| Randomized color particle effect | [LorD ClockaN](https://forum.xda-developers.com/m/lord-clockan.1184673/) |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2023 The Evolution X Project
|
||||
# Copyright (C) 2023-2024 The Evolution X Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
@@ -12,5 +12,8 @@ PRODUCT_PACKAGES += \
|
||||
PRODUCT_PACKAGES += \
|
||||
init.pixelparts.rc
|
||||
|
||||
# PixelParts overlays
|
||||
DEVICE_PACKAGE_OVERLAYS += packages/apps/PixelParts/overlay
|
||||
|
||||
# PixelParts sepolicy
|
||||
BOARD_SEPOLICY_DIRS += packages/apps/PixelParts/sepolicy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (C) 2023 The Evolution X Project
|
||||
// Copyright (C) 2023-2024 The Evolution X Project
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
|
||||
Binary file not shown.
10
overlay/packages/apps/Settings/res/values/config.xml
Normal file
10
overlay/packages/apps/Settings/res/values/config.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources>
|
||||
|
||||
<bool name="config_showBatteryChargeCycles">false</bool>
|
||||
|
||||
</resources>
|
||||
BIN
readme_resources/PixelParts.png
Normal file
BIN
readme_resources/PixelParts.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 MiB |
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2019-2023 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#005eff"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M15,24c-0.2,0 -0.5,-0.1 -0.6,-0.2L4.1,14.7c-0.3,-0.2 -0.4,-0.6 -0.3,-1l0.9,-3.4c0.1,-0.4 0.5,-0.7 0.9,-0.7h10.1c0.3,0 0.6,0.1 0.7,0.4l2.8,3.4c0.2,0.3 0.3,0.7 0.1,1c-0.2,0.3 -0.5,0.5 -0.9,0.5h-5.8l3.8,3.4c0.3,0.2 0.4,0.6 0.3,0.9l-0.9,4c-0.1,0.3 -0.3,0.6 -0.6,0.7C15.2,24 15.1,24 15,24zM5.8,13.7l8.6,7.6l0.4,-1.9l-5.3,-4.7c-0.3,-0.3 -0.4,-0.7 -0.3,-1.1c0.1,-0.4 0.5,-0.6 0.9,-0.6h6.4l-1.2,-1.5H6.4L5.8,13.7z" />
|
||||
<path
|
||||
android:fillColor="#005eff"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M17.6,7.4H8.9c-0.2,0 -0.5,-0.1 -0.7,-0.3L4.6,3.7C4.3,3.4 4.2,3 4.3,2.6C4.5,2.2 4.8,2 5.2,2h13.3c0.3,0 0.6,0.1 0.8,0.4c0.2,0.2 0.2,0.5 0.2,0.8l-0.9,3.4C18.4,7.1 18,7.4 17.6,7.4zM9.3,5.4h7.6l0.4,-1.5H7.6L9.3,5.4z" />
|
||||
</vector>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- drawable/ic_hbm_tile.xml -->
|
||||
<!-- drawable/ic_auto_hbm_tile.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
@@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2019-2023 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<vector xmlns:api24="http://schemas.android.com/apk/res/android"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="1080dp"
|
||||
android:height="240dp"
|
||||
android:viewportWidth="1080"
|
||||
android:viewportHeight="240">
|
||||
<group>
|
||||
<path
|
||||
android:pathData="M314.107 155.75L302.321 106.643H344.357L314.107 155.75Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startY="106"
|
||||
android:endY="154"
|
||||
android:type="linear">
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M414.285 139.25C414.285 153.136 403.028 164.393 389.142 164.393C375.256 164.393 364 153.136 364 139.25C364 125.364 375.256 114.107 389.142 114.107C403.028 114.107 414.285 125.364 414.285 139.25Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startY="120"
|
||||
android:endY="160"
|
||||
android:type="linear">
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M466.928 158.893L474.785 106.643H512.499L499.928 158.893H466.928Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startY="106"
|
||||
android:endY="158"
|
||||
android:type="linear">
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M662.963 139.25C662.963 153.136 651.707 164.393 637.821 164.393C623.935 164.393 612.678 153.136 612.678 139.25C612.678 125.364 623.935 114.107 637.821 114.107C651.707 114.107 662.963 125.364 662.963 139.25Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startY="120"
|
||||
android:endY="160"
|
||||
android:type="linear">
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M732.106 120.393L724.249 172.643H686.535L699.106 120.393H732.106Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startY="124"
|
||||
android:endY="172"
|
||||
android:type="linear">
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
</group>
|
||||
<group>
|
||||
<path
|
||||
android:pathData="M217.896 70.4523C215.794 68.5118 217.167 65 220.028 65H280.87C282.965 65 284.474 67.0115 283.887 69.0229L280.22 81.5928C279.829 82.9337 278.6 83.8556 277.203 83.8556H234.875C233.295 83.8556 231.773 83.2605 230.612 82.1888L217.896 70.4523Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M268.75 151.103C270.08 152.268 270.648 154.079 270.219 155.794L266.36 171.228C265.931 172.945 263.833 173.594 262.509 172.419L211.057 126.765C210.181 125.987 209.81 124.788 210.094 123.651L213.751 109.023C214.101 107.624 215.358 106.643 216.8 106.643H276.321C277.763 106.643 279.02 107.624 279.37 109.023L282.269 120.619C282.888 123.098 281.013 125.5 278.457 125.5H239.489L268.75 151.103Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M354.904 106.643C357.354 106.643 358.862 109.322 357.59 111.417L322.253 169.619C321.113 171.496 319.076 172.643 316.88 172.643H305.856C302.892 172.643 300.331 170.572 299.71 167.674L287.446 110.444C287.027 108.488 288.519 106.643 290.519 106.643H302.939C304.425 106.643 305.708 107.684 306.014 109.138L314.917 151.428L340.717 108.176C341.284 107.225 342.31 106.643 343.416 106.643H354.904Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M368.204 169.057C363.406 166.831 359.4 163.334 356.675 158.994C353.904 154.413 352.509 149.206 352.64 143.932C352.532 137.265 354.291 130.689 357.739 124.869C361.062 119.302 365.927 114.692 371.813 111.533C377.976 108.236 384.958 106.549 392.041 106.647C398.677 106.647 404.456 107.839 409.378 110.224C414.15 112.463 418.132 115.958 420.844 120.288C423.625 124.869 425.031 130.078 424.91 135.356C425.019 142.014 423.283 148.583 419.875 154.412C416.576 159.997 411.705 164.612 405.8 167.748C399.611 171.042 392.606 172.728 385.501 172.634C379.516 172.756 373.586 171.53 368.204 169.057ZM396.573 154.59C399.525 152.755 401.878 150.18 403.365 147.153C405.031 143.716 405.85 139.968 405.761 136.19C405.761 131.821 404.466 128.365 401.876 125.821C399.286 123.278 395.645 122.008 390.954 122.013C387.432 121.959 383.971 122.891 381.009 124.691C378.054 126.525 375.699 129.101 374.208 132.128C372.533 135.561 371.703 139.306 371.781 143.084C371.781 147.458 373.095 150.914 375.721 153.453C378.348 155.991 382.01 157.261 386.707 157.261C390.192 157.307 393.614 156.378 396.541 154.59H396.573Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M440.957 77.8081C441.223 76.3076 442.528 75.2143 444.052 75.2143H457.462C458.929 75.2143 460.039 76.5392 459.783 77.9832L443.449 170.049C443.183 171.549 441.878 172.643 440.354 172.643H426.944C425.477 172.643 424.367 171.318 424.623 169.874L440.957 77.8081Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M524.039 106.643C526.013 106.643 527.499 108.442 527.125 110.381L515.765 169.309C515.48 170.788 514.186 171.857 512.679 171.857H500.078C498.591 171.857 497.475 170.496 497.767 169.038L497.989 167.928C495.811 170.134 493.006 171.145 490.131 171.857C486.372 172.791 481.578 172.643 477.56 172.643C470.48 172.643 464.493 171.059 460.274 167.143C456.055 163.226 453.994 157.735 453.989 150.643C453.987 147.971 454.21 144.614 454.774 142L461.34 109.169C461.634 107.7 462.924 106.643 464.422 106.643H476.921C478.887 106.643 480.371 108.428 480.011 110.361L474.417 140.428C474.417 140.428 473.627 144.329 473.631 145.928C473.631 152.781 477.395 156.13 484.631 156.13C489.373 156.13 492.54 155.028 495.631 152.214C498.723 149.401 501.57 144.484 502.703 138.857L508.493 109.184C508.781 107.708 510.074 106.643 511.577 106.643H524.039Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M555.46 147.608C555.274 148.522 555.193 149.455 555.217 150.387C555.217 154.777 557.512 156.969 562.101 156.964C563.315 156.964 564.115 156.776 564.913 156.399C566.142 155.818 567.542 156.698 567.306 158.036L565.933 165.813C565.691 167.184 565.011 168.45 563.969 169.373C561.506 171.553 559.659 172.643 554.167 172.643C548.046 172.643 544.118 170.909 540.417 167.536C536.716 164.162 536.003 159.58 536.024 153.695C536.052 151.7 536.251 149.711 536.62 147.751L541.989 121.571H532.925C531.927 121.571 531.182 120.653 531.387 119.676L533.606 109.138C533.912 107.684 535.195 106.643 536.681 106.643H544.346L547.019 91.9378C547.291 90.4434 548.593 89.3571 550.111 89.3571H564.463C565.443 89.3571 566.184 90.245 566.009 91.2096L563.203 106.643H576.195C577.193 106.643 577.938 107.561 577.732 108.538L575.514 119.076C575.208 120.53 573.925 121.571 572.438 121.571H560.846L555.46 147.608Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M583.907 109.162C584.204 107.697 585.492 106.643 586.988 106.643H600.392C601.882 106.643 602.998 108.007 602.702 109.468L590.427 170.123C590.13 171.589 588.842 172.643 587.347 172.643H573.942C572.452 172.643 571.336 171.278 571.632 169.818L583.907 109.162Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M586.761 88.5501C587.292 89.7991 588.081 90.9233 589.076 91.8501C590.126 92.8495 591.367 93.6295 592.725 94.1443C594.083 94.659 595.531 94.8981 596.983 94.8473C598.641 94.9127 600.295 94.6504 601.85 94.0757C603.405 93.5009 604.831 92.6251 606.043 91.4989C607.214 90.3651 608.131 88.9984 608.736 87.4882C609.34 85.9779 609.617 84.3579 609.55 82.7337C609.577 81.4107 609.316 80.0974 608.784 78.8846C608.251 77.6719 607.461 76.5884 606.467 75.7091C604.263 73.7582 601.381 72.739 598.434 72.8681C594.726 72.8681 591.727 73.9816 589.437 76.2086C588.308 77.2925 587.419 78.5983 586.826 80.0429C586.233 81.4876 585.949 83.0393 585.993 84.5992C585.968 85.9551 586.23 87.3011 586.761 88.5501Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M616.474 169.057C611.69 166.826 607.697 163.33 604.981 158.994C602.203 154.415 600.801 149.208 600.925 143.933C600.814 137.266 602.569 130.69 606.013 124.87C609.341 119.304 614.205 114.694 620.089 111.534C626.258 108.23 633.25 106.543 640.341 106.647C646.973 106.647 652.75 107.84 657.67 110.225C662.44 112.463 666.42 115.959 669.131 120.288C671.911 124.869 673.316 130.079 673.196 135.357C673.304 142.014 671.569 148.583 668.162 154.412C664.862 159.998 659.99 164.613 654.086 167.748C647.89 171.047 640.876 172.733 633.764 172.635C627.781 172.756 621.854 171.529 616.474 169.057ZM644.831 154.591C647.785 152.756 650.139 150.181 651.628 147.153C653.293 143.716 654.112 139.968 654.023 136.19C654.023 131.821 652.729 128.365 650.14 125.822C647.551 123.278 643.912 122.009 639.222 122.014C635.699 121.96 632.237 122.891 629.274 124.691C626.32 126.524 623.968 129.1 622.484 132.129C620.806 135.56 619.976 139.306 620.058 143.085C620.058 147.458 621.371 150.914 623.996 153.453C626.622 155.991 630.282 157.261 634.977 157.261C638.458 157.306 641.876 156.377 644.799 154.591H644.831Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M739.203 112.928C743.477 116.925 746.274 122.79 746.274 130.214C746.276 132.978 746.055 135.366 745.488 138.071L738.187 170.196C737.862 171.627 736.59 172.643 735.122 172.643H722.662C720.661 172.643 719.169 170.798 719.589 168.841L725.845 139.643C726.181 138.1 726.643 136.507 726.631 134.928C726.631 131.391 725.348 128.143 723.488 126.286C721.629 124.428 719.334 123.923 715.631 123.928C710.791 123.928 706.244 124.951 703.06 127.857C699.875 130.763 697.905 135.397 696.774 141.214L690.994 170.116C690.7 171.585 689.41 172.643 687.912 172.643H676.179C674.219 172.643 672.737 170.869 673.086 168.941L683.736 110.012C684.006 108.517 685.308 107.429 686.828 107.429H699.491C700.948 107.429 702.056 108.736 701.817 110.173L701.488 112.143C703.06 108.668 710.885 105.931 721.917 106.643C729.169 107.065 734.928 108.922 739.203 112.928Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
<path
|
||||
android:pathData="M824.358 101.143L843.75 68.1039C844.879 66.1811 846.942 65 849.171 65H866.607C869.078 65 870.582 67.719 869.27 69.8121L839.287 117.643L869.577 170.29C870.782 172.385 869.27 175 866.852 175H849.357C847.029 175 844.891 173.713 843.802 171.655L824.358 134.928L804.915 171.655C803.825 173.713 801.688 175 799.359 175H781.864C779.446 175 777.934 172.385 779.14 170.29L809.43 117.643L779.446 69.8121C778.134 67.719 779.639 65 782.109 65H799.545C801.774 65 803.837 66.1811 804.966 68.1039L824.358 101.143Z"
|
||||
android:fillColor="?android:attr/colorAccent"/>
|
||||
</group>
|
||||
<path
|
||||
android:pathData="M270.219 155.794C270.648 154.079 270.08 152.268 268.75 151.103L239.489 125.5C235.963 125.502 232.458 126.978 229.973 129.857C227.182 133.089 226.329 137.338 227.308 141.185L262.509 172.419C263.833 173.594 265.931 172.945 266.36 171.228L270.219 155.794Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startX="210"
|
||||
android:startY="142"
|
||||
android:endX="284"
|
||||
android:endY="176"
|
||||
android:type="linear">
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
</vector>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- drawable/ic_usb2_fc_tile -->
|
||||
<!-- drawable/ic_fast_charge_tile -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
@@ -1,10 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24"
|
||||
android:tint="?android:attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z" />
|
||||
</vector>
|
||||
@@ -1,11 +0,0 @@
|
||||
<!-- drawable/ic_pixel_parts.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:pathData="M21.81 12.74l-0.82 -0.63c0 -0.09 0 -0.13 0 -0.22l0.8 -0.63c0.16 -0.12 0.2 -0.34 0.1 -0.51l-0.85 -1.48c-0.07 -0.13 -0.21 -0.2 -0.35 -0.2c-0.05 0 -0.1 0.01 -0.15 0.03l-0.95 0.38c-0.08 -0.05 -0.11 -0.07 -0.19 -0.11l-0.15 -1.01C19.22 8.15 19.05 8 18.85 8h-1.71c-0.2 0 -0.37 0.15 -0.4 0.34L16.6 9.35c-0.03 0.02 -0.07 0.03 -0.1 0.05c-0.03 0.02 -0.06 0.04 -0.09 0.06l-0.95 -0.38c-0.05 -0.02 -0.1 -0.03 -0.15 -0.03c-0.14 0 -0.27 0.07 -0.35 0.2l-0.85 1.48c-0.1 0.17 -0.06 0.39 0.1 0.51l0.8 0.63c0 0.09 0 0.13 0 0.23l-0.8 0.63c-0.16 0.12 -0.2 0.34 -0.1 0.51l0.85 1.48c0.07 0.13 0.21 0.2 0.35 0.2c0.05 0 0.1 -0.01 0.15 -0.03l0.95 -0.37c0.08 0.05 0.12 0.07 0.2 0.11l0.15 1.01c0.03 0.2 0.2 0.34 0.4 0.34h1.71c0.2 0 0.37 -0.15 0.4 -0.34l0.15 -1.01c0.03 -0.02 0.07 -0.03 0.1 -0.05c0.03 -0.02 0.06 -0.04 0.09 -0.06l0.95 0.38c0.05 0.02 0.1 0.03 0.15 0.03c0.14 0 0.27 -0.07 0.35 -0.2l0.85 -1.48C22.01 13.08 21.97 12.86 21.81 12.74zM18 13.5c-0.83 0 -1.5 -0.67 -1.5 -1.5c0 -0.83 0.67 -1.5 1.5 -1.5s1.5 0.67 1.5 1.5C19.5 12.83 18.83 13.5 18 13.5zM17 18H7V6h10v1h2V3c0 -1.1 -0.9 -2 -2 -2H7C5.9 1 5 1.9 5 3v18c0 1.1 0.9 2 2 2h10c1.1 0 2 -0.9 2 -2v-4h-2V18zM7 3h10v1H7V3zM17 21H7v-1h10V21z" />
|
||||
</vector>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- drawable/ic_pixeltorch_tile.xml -->
|
||||
<!-- drawable/ic_pixel_torch_tile.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
@@ -1,10 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24"
|
||||
android:tint="?android:attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M-0.05,16.79L3.19,12.97L-0.05,9.15L1.5,7.86L4.5,11.41L7.5,7.86L9.05,9.15L5.81,12.97L9.05,16.79L7.5,18.07L4.5,14.5L1.5,18.07L-0.05,16.79M24,17A1,1 0 0,1 23,18H20A2,2 0 0,1 18,16V14A2,2 0 0,1 20,12H22V10H18V8H23A1,1 0 0,1 24,9M22,14H20V16H22V14M16,17A1,1 0 0,1 15,18H12A2,2 0 0,1 10,16V10A2,2 0 0,1 12,8H14V5H16V17M14,16V10H12V16H14Z"/>
|
||||
</vector>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2019-2023 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="?android:attr/colorPrimary"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:selectable="false">
|
||||
|
||||
<ImageView
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_evolution_logo"/>
|
||||
</LinearLayout>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2016 The Android Open Source Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView android:id="@+id/jitter_mma"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true" />
|
||||
|
||||
<TextView android:id="@+id/totalish_mma"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true" />
|
||||
|
||||
<TextView android:id="@+id/ui_frametime_mma"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true" />
|
||||
|
||||
<TextView android:id="@+id/rt_frametime_mma"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true" />
|
||||
|
||||
<TextView android:id="@+id/total_mma"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true" />
|
||||
|
||||
<View android:layout_width="match_parent"
|
||||
android:layout_height="0px"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<view class="org.evolution.pixelparts.uibench.JitterTestActivity$PointGraphView"
|
||||
android:id="@+id/graph"
|
||||
android:layout_height="200dp"
|
||||
android:layout_width="match_parent" />
|
||||
</LinearLayout>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018 Havoc-OS
|
||||
2023 The Evolution X Project
|
||||
2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/temperature_unit"
|
||||
@@ -16,8 +17,4 @@
|
||||
android:id="@+id/battery_info_refresh"
|
||||
android:title="@string/battery_info_refresh_title"
|
||||
android:checkable="true" />
|
||||
|
||||
<item
|
||||
android:id="@+id/launch_battery_usage"
|
||||
android:title="@string/launch_battery_usage_title" />
|
||||
</menu>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/pixel_parts_about"
|
||||
android:title="@string/pixel_parts_about_title" />
|
||||
</menu>
|
||||
@@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
2016-2022 crDroid Android Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- PixelParts -->
|
||||
<string name="pixel_parts_title">Ajustes del Pixel</string>
|
||||
<string name="pixel_parts_summary">Configurar ajustes específicos del dispositivo</string>
|
||||
<string name="pixel_parts_warning_title">Advertencia</string>
|
||||
<string name="pixel_parts_warning_text">Muchas de estas características dependen de nodos específicos del kernel para funcionar. Al flashear un kernel personalizado, podrías perder algunas características. ¡Has sido advertido!</string>
|
||||
<string name="pixel_parts_dialog">Ok</string>
|
||||
<string name="kernel_node_access_error">¡El acceso al nodo Kernel falló! Por favor, asegúrese de que la ruta proporcionada al atributo sysfs o procfs es exacta, de que tiene los permisos apropiados, y de que las políticas SELinux están correctamente configuradas.</string>
|
||||
<!-- Battery -->
|
||||
<string name="category_battery">Batería</string>
|
||||
<string name="battery_info_title">Información de la batería</string>
|
||||
<string name="battery_info_summary">Ver información variada de la batería</string>
|
||||
<string name="battery_info_refresh_summary">actualizar información después de (segundos)</string>
|
||||
<string name="category_battery_info">Información disponible</string>
|
||||
<string name="technology_title">Tecnología</string>
|
||||
<string name="status_title">Estado</string>
|
||||
<string name="temperature_title">Temperatura</string>
|
||||
<string name="capacity_title">Capacidad ahora</string>
|
||||
<string name="capacity_level_title">Nivel de capacidad</string>
|
||||
<string name="current_title">Actual</string>
|
||||
<string name="voltage_title">Voltaje</string>
|
||||
<string name="wattage_title">Vatiaje</string>
|
||||
<string name="health_title">Salud de la batería</string>
|
||||
<string name="cycle_count_title">Ciclos de carga</string>
|
||||
<string name="stop_charging_title">Detener la carga al</string>
|
||||
<string name="stop_charging_summary">Evitar que el dispositivo cargue sobre un porcentaje específico</string>
|
||||
<string name="start_charging_title">Comenzar la carga en porcentaje específico</string>
|
||||
<string name="start_charging_summary">Reanudar la carga en un porcentaje específico</string>
|
||||
<string name="stop_below_start_error">¡Ajuste final debe estar por encima del ajuste de inicio!</string>
|
||||
<string name="start_above_stop_error">¡Ajuste de inicio debe estar por debajo del ajuste final!</string>
|
||||
<!-- Camera -->
|
||||
<string name="category_camera">Cámara</string>
|
||||
<string name="flashlight_tile_title">Linterna</string>
|
||||
<string name="torch_strength_title">Intensidad de la linterna</string>
|
||||
<string name="torch_strength_summary">Ajustar el brillo de la linterna del ícono de PixelParts en los ajustes rápido</string>
|
||||
<!-- CPU -->
|
||||
<string name="category_cpu">CPU</string>
|
||||
<string name="power_efficient_workqueue_title">Cola de trabajo de bajo consumo energético</string>
|
||||
<string name="power_efficient_workqueue_summary">Ahorre energía reprogramando tareas a un núcleo que ya está activo</string>
|
||||
<!-- Display -->
|
||||
<string name="category_display">Pantalla</string>
|
||||
<string name="hbm_title">Modo de alto brillo (HBM)</string>
|
||||
<string name="hbm_summary">Habilitar luminancia máxima</string>
|
||||
<string name="auto_hbm_title">Modo de alto brillo automático</string>
|
||||
<string name="auto_hbm_summary">Habilita la iluminación máxima basada en la luz del sol</string>
|
||||
<string name="auto_hbm_threshold_summary">umbral (lux)</string>
|
||||
<string name="hbm_enable_time_summary">activar después de (segundos)</string>
|
||||
<string name="hbm_disable_time_summary">deshabilitar después de (segundos)</string>
|
||||
<string name="hbm_info">El uso prolongado del modo de brillo alto puede dañar la pantalla!</string>
|
||||
<!-- UiBench -->
|
||||
<string name="category_uibench">Test de interfaz de usuario</string>
|
||||
<string name="jitter_test_title">Jitter</string>
|
||||
<string name="jitter_test_summary">Cálculo de renderización de Jitter</string>
|
||||
<!-- USB -->
|
||||
<string name="category_usb">USB</string>
|
||||
<string name="usb2_fast_charge_title">Carga rápida USB 2.0</string>
|
||||
<string name="usb2_fast_charge_summary">Activar el modo CDP para cargar rápidamente en puertos USB 2.0</string>
|
||||
<string name="usb2_fast_charge_info">No todos los puertos USB 2.0 soportan el modo CDP, ¡tenga cuidado!</string>
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value">Valor: <xliff:g id="v">%s</xliff:g></string>
|
||||
<string name="custom_seekbar_default_value">por defecto</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Valor predeterminado: <xliff:g id="v">%s</xliff:g>\nMantén pulsado para establecer</string>
|
||||
<string name="custom_seekbar_default_value_is_set">\"El valor predeterminado está establecido</string>
|
||||
</resources>
|
||||
@@ -1,156 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
2016-2022 crDroid Android Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- PixelParts -->
|
||||
<string name="pixel_parts_title">Customisation Pixel</string>
|
||||
<string name="pixel_parts_summary">Configurer les paramètres spécifiques à l\'appareil</string>
|
||||
<string name="pixel_parts_warning_title">Avertissement</string>
|
||||
<string name="pixel_parts_warning_text">La plupart de ces fonctions dépendent de nœuds spécifiques du noyau pour fonctionner. Lorsque vous flashez un noyau personnalisé, vous risquez de perdre l\'accès à certaines de ces fonctionnalités. Vous êtes prévenu !</string>
|
||||
<string name="pixel_parts_dialog">OK</string>
|
||||
<string name="kernel_node_access_error">L\'accès au nœud du noyau a échoué ! Veuillez vous assurer que le chemin fourni vers l\'attribut sysfs ou procfs est exact, qu\'il dispose des autorisations appropriées et que les politiques SELinux sont correctement configurées.</string>
|
||||
<string name="tile_on">Activé</string>
|
||||
<string name="tile_off">Désactivé</string>
|
||||
<!-- Battery -->
|
||||
<string name="category_battery">Batterie</string>
|
||||
<string name="battery_info_title">Informations sur la batterie</string>
|
||||
<string name="battery_info_summary">Affichage de diverses informations sur la batterie</string>
|
||||
<string name="battery_info_refresh_title">Fréquence d\'actualisation</string>
|
||||
<string name="battery_info_refresh_summary">Définir la fréquence d\'actualisation des informations de la batterie (en secondes)</string>
|
||||
<string name="category_battery_info">Informations disponibles</string>
|
||||
<string name="technology_title">Technologie</string>
|
||||
<string name="technology_info_title">Informations technologiques</string>
|
||||
<string name="technology_info_message"> Li-ion (Lithium-ion):\n\nLargement utilisée dans les smartphones et de nombreux appareils électroniques, les piles Li-ion offrent une densité énergétique élevée, une conception légère, et un taux d\'autodécharge relativement faible.\n\n
|
||||
NiMH (Nickel Metal Hydride) :\n\nOffrant un bon équilibre entre capacité et coût, les piles NiMH sont couramment utilisées dans certains dispositifs.\n\n
|
||||
Li-poly (polymère de Lithium) :\n\nSimilaires aux piles Li-ion, Les piles Li-poly ont un facteur de forme flexible et léger. Ils sont souvent utilisés dans des appareils minces où l\'espace est une préoccupation.\n\n
|
||||
LiFe (Phosphate de Fer de Lithium) :\n\nOffre une durée de vie plus longue, une sécurité accrue, et une meilleure tolérance à la température, les piles LiFe sont couramment utilisées dans des applications priorisant la durabilité et la stabilité.\n\n
|
||||
NiCd (Nickel Cadmium) :\n\nUne technologie plus ancienne avec une densité d\'énergie réduite et une vitesse d\'autodécharge plus élevée, De nos jours, les piles NiCd sont moins courantes en raison de préoccupations environnementales.\n\n
|
||||
LiMn (Lithium Manganèse):\n\nUne variante de piles Li-ion, Les piles LiMn offrent une puissance et une stabilité élevées, ce qui les rend adaptées aux applications nécessitant un haut courant.\n\n
|
||||
Sur smartphones, Les piles Li-ion sont la technologie la plus couramment utilisée en raison de leur équilibre optimal en termes de performance, de capacité et de sécurité.
|
||||
</string>
|
||||
<string name="status_title">Statut</string>
|
||||
<string name="status_info_title">Informations sur le statut</string>
|
||||
<string name="status_info_message"> Inconnu :\n\nLe statut de l\'appareil est actuellement inconnu.\n\n
|
||||
Chargement :\n\nL\'appareil est actuellement en cours de chargement.\n\n
|
||||
Déchargement :\n\nL\'appareil est actuellement en train de décharger sa batterie.\n\n
|
||||
Pas en charge:\n\nL\'appareil est connecté mais ne charge pas activement sa batterie.
|
||||
</string>
|
||||
<string name="status_unknown">Inconnu</string>
|
||||
<string name="status_charging">En charge</string>
|
||||
<string name="status_discharging">En décharge</string>
|
||||
<string name="status_not_charging">Pas en charge</string>
|
||||
<string name="status_full">Chargée</string>
|
||||
<string name="usb_type_title">Type USB</string>
|
||||
<string name="usb_type_info_title">Informations sur les types d\'USB</string>
|
||||
<string name="usb_type_info_message"> Port aval standard (SDP):\n\nC\'est la forme la plus basique de connexion USB. Il peut être utilisé pour le transfert de données et pour l\'alimentation mais il ne dispose pas de fonctionnalités spéciales pour charger les appareils plus rapidement.\n\n
|
||||
Port de charge en aval (CDP):\n\nCe type de connexion USB prend également en charge le transfert de données, mais il peut fournir plus d\'énergie qu\'un port SDP. Cela signifie qu\'il peut charger des appareils plus rapidement tout en permettant le transfert de données. Des CDP ont été introduits dans la spécification de charge de la batterie USB (Révision 1.2), pour répondre au besoin de charger les piles des périphériques portables.\n\n
|
||||
Port de chargement dédié (DCP) :\n\nCe type de connexion USB ne supporte pas du tout le transfert de données. Il est seulement utilisé pour charger des périphériques et peut généralement fournir encore plus de puissance qu\'un port CDP. Le DCP est utilisé quand il y a besoin de plus de puissance pour charger un périphérique, mais aucun transfert de données n\'est nécessaire.
|
||||
</string>
|
||||
<string name="usb_type_unknown_or_not_connected">Non connecté ou inconnu</string>
|
||||
<string name="usb_type_standard_downstream_port">Port Standard en aval (SDP)</string>
|
||||
<string name="usb_type_charging_downstream_port">Port de charge en aval (CDP)</string>
|
||||
<string name="usb_type_dedicated_charging_port">Port de chargement dédié (DCP)</string>
|
||||
<string name="temperature_title">Température</string>
|
||||
<string name="temperature_info_title">Informations sur la température</string>
|
||||
<string name="temperature_info_message">La température désigne le degré de chaleur ou de froid, mesuré en Celsius (°C) ou Fahrenheit (°F). Les températures élevées peuvent affecter les performances et la durée de vie de l’appareil. Les plages de fonctionnement recommandées pour les smartphones sont généralement entre 0°C et 35°C (32°F et 95°F). La surveillance de la température assure que les appareils restent dans la plage de sécurité et évitent la surchauffe et les dommages.</string>
|
||||
<string name="temperature_unit_title">Afficher la température en Fahrenheit</string>
|
||||
<string name="capacity_title">Capacité actuelle</string>
|
||||
<string name="capacity_info_title">Informations sur la capacité</string>
|
||||
<string name="capacity_info_message">La capacité correspond au niveau de charge actuel de la batterie, représenté en pourcentage de sa capacité globale. Il indique le montant actuellement disponible par rapport à la capacité maximale. Surveiller le niveau de capacité en pourcentage permet d\'estimer la puissance restante de la batterie et de planifier la consommation d\'énergie en conséquence.</string>
|
||||
<string name="capacity_level_title">Niveau de capacité</string>
|
||||
<string name="capacity_level_info_title">Informations sur le niveau de capacité</string>
|
||||
<string name="capacity_level_info_message"> Inconnu :\n\nLa capacité de la batterie actuelle est inconnue.\n\n
|
||||
Critique :\n\nLa capacité de la batterie est critiquement faible. La charge immédiate est recommandée.\n\n
|
||||
Faible :\n\nLa capacité de la batterie est faible. Pensez à charger l\'appareil.\n\n
|
||||
Normal:\n\nLa capacité de la batterie est à un niveau normal.\n\n
|
||||
Élevé :\n\nLa capacité de la batterie est relativement élevée. Aucune charge immédiate n\'est requise.\n\n
|
||||
Plein :\n\nLa capacité de la batterie est à pleine capacité. L\'appareil est entièrement chargé.
|
||||
</string>
|
||||
<string name="capacity_level_unknown">Inconnu</string>
|
||||
<string name="capacity_level_critical">Critique</string>
|
||||
<string name="capacity_level_low">Faible</string>
|
||||
<string name="capacity_level_normal">Normale</string>
|
||||
<string name="capacity_level_high">Élevé</string>
|
||||
<string name="capacity_level_full">Pleine</string>
|
||||
<string name="current_title">Actuel</string>
|
||||
<string name="current_info_title">Informations sur le courant</string>
|
||||
<string name="current_info_message">Le courant désigne le flux de charge électrique dans un circuit, mesuré en milliampères (mA). La valeur actuelle indique le montant de la charge en cours de charge ou de sortie par un appareil. Surveiller la valeur du courant permet de suivre le flux de puissance et de gérer efficacement le processus de charge ou de décharge.</string>
|
||||
<string name="voltage_title">Tension</string>
|
||||
<string name="voltage_info_title">Informations sur la tension</string>
|
||||
<string name="voltage_info_message">La tension désigne la différence électrique potentielle dans un circuit, mesuré en volts (V), qui détermine le comportement et la fonctionnalité des appareils électriques. La concordance de la tension requise assure un fonctionnement correct de l\'appareil, tandis que des niveaux de tension incorrects peuvent causer des dommages ou un dysfonctionnement.</string>
|
||||
<string name="wattage_title">Puissance</string>
|
||||
<string name="wattage_info_title">Informations sur la puissance</string>
|
||||
<string name="wattage_info_message">La puissance désigne la quantité d\'énergie électrique consommée ou produite par un appareil. Il est calculé en multipliant la tension par le courant (Puissance = Tension × Courant). Comprendre la puissance aide à déterminer les besoins en puissance, les capacités de l\'appareil et assure un fonctionnement sécuritaire des appareils électriques.</string>
|
||||
<string name="health_title">Santé</string>
|
||||
<string name="health_info_title">Informations sur la santé</string>
|
||||
<string name="health_info_message"> Inconnu :\n\nL\'état de santé de la batterie est actuellement inconnu.\n\n
|
||||
Bon :\n\nLa batterie est en bonne santé et fonctionne correctement.\n\n
|
||||
Surchauffe :\n\nLa batterie subit une surchauffe, ce qui peut affecter ses performances et sa durée de vie.\n\n
|
||||
Morte :\n\nLa batterie est morte et ne fonctionne plus. Le remplacement est nécessaire.\n\n
|
||||
Surtension :\n\nLa batterie est en surtension, qui peuvent présenter un risque pour l\'appareil.\n\n
|
||||
Échec non spécifié:\n\nLa batterie a rencontré une panne non spécifiée, affectant ses performances.\n\n
|
||||
Froide :\n\nLa batterie connaît des conditions de température froide, qui peuvent affecter ses performances et sa capacité.
|
||||
</string>
|
||||
<string name="health_unknown">Inconnu</string>
|
||||
<string name="health_good">Bon</string>
|
||||
<string name="health_overheat">Surchauffe</string>
|
||||
<string name="health_dead">Morte</string>
|
||||
<string name="health_over_voltage">Surtension</string>
|
||||
<string name="health_unspecified_failure">Défaillance non précisée</string>
|
||||
<string name="health_cold">Froide</string>
|
||||
<string name="health_watchdog_timer_expire">La minuterie Watchdog expire</string>
|
||||
<string name="health_safety_timer_expire">La minuterie de sécurité expire</string>
|
||||
<string name="health_over_current">Surintensité</string>
|
||||
<string name="health_calibration_required">Calibrage requis</string>
|
||||
<string name="health_warm">Chaude</string>
|
||||
<string name="health_cool">Froide</string>
|
||||
<string name="health_hot">Chaude</string>
|
||||
<string name="cycle_count_title">Nombre de cycles</string>
|
||||
<string name="cycle_count_info_title">Informations sur le nombre de cycles</string>
|
||||
<string name="cycle_count_info_message">Le nombre de cycles indique le nombre de cycles de charge qu\'une batterie rechargeable a subi. Il indique l\'utilisation et le vieillissement de la batterie. La surveillance du nombre de cycles aide à estimer la durée de vie de la batterie et aide à déterminer si un remplacement est nécessaire.</string>
|
||||
<string name="stop_charging_title">Niveau de charge d\'arrêt</string>
|
||||
<string name="stop_charging_summary">Empêcher l\'appareil de se recharger au-delà d\'un certain pourcentage</string>
|
||||
<string name="start_charging_title">Niveau de charge de départ</string>
|
||||
<string name="start_charging_summary">Reprise de la charge à un pourcentage spécifique</string>
|
||||
<string name="stop_below_start_error">Le niveau d\'arrêt doit être supérieur au niveau de départ !</string>
|
||||
<string name="start_above_stop_error">Le niveau de départ doit être inférieur au niveau d\'arrêt !</string>
|
||||
<!-- Camera -->
|
||||
<string name="category_camera">Appareil photo</string>
|
||||
<string name="pixeltorch_tile_title">Torche Pixel</string>
|
||||
<string name="torch_strength_title">Puissance de la torche</string>
|
||||
<string name="torch_strength_summary">Régler la luminosité de la torche Pixel dans les réglages rapides</string>
|
||||
<!-- CPU -->
|
||||
<string name="category_cpu">CPU</string>
|
||||
<string name="power_efficient_workqueue_title">File de puissance efficace</string>
|
||||
<string name="power_efficient_workqueue_summary">Économiser de l\'énergie en reprogrammant le travail sur un noyau déjà éveillé</string>
|
||||
<!-- Display -->
|
||||
<string name="category_display">Affichage</string>
|
||||
<string name="hbm_title">Mode haute luminosité (HBM)</string>
|
||||
<string name="hbm_summary">Activer la haute luminosité</string>
|
||||
<string name="auto_hbm_title">HBM automatique</string>
|
||||
<string name="auto_hbm_summary">Activer la luminosité maximale en fonction de la lumière du soleil</string>
|
||||
<string name="auto_hbm_threshold_summary">Seuil (lux)</string>
|
||||
<string name="hbm_enable_time_summary">activer après (secondes)</string>
|
||||
<string name="hbm_disable_time_summary">désactivation après (secondes)</string>
|
||||
<string name="hbm_info">L\'utilisation prolongée du mode haute luminosité peut endommager l\'écran !</string>
|
||||
<string name="saturation_title">Saturation</string>
|
||||
<string name="saturation_summary">Contrôler le niveau de saturation de l\'écran</string>
|
||||
<string name="saturation_info">La modification du mode couleur dans les paramètres d\'affichage remplacera le niveau de saturation, ce qui nécessitera sa réapplication.</string>
|
||||
<!-- UiBench -->
|
||||
<string name="category_uibench">UiBench</string>
|
||||
<string name="jitter_test_title">Jitter</string>
|
||||
<string name="jitter_test_summary">Calculer l\'instabilité du rendu</string>
|
||||
<!-- USB -->
|
||||
<string name="category_usb">USB</string>
|
||||
<string name="usb2_fast_charge_title">Charge rapide USB 2.0</string>
|
||||
<string name="usb2_fast_charge_summary">Activer le mode CDP pour la charge rapide sur les ports USB 2.0</string>
|
||||
<string name="usb2_fast_charge_info">Attention : Tous les ports USB 2.0 ne supportent pas le mode CDP. Pour que les changements prennent effet, déconnectez et reconnectez le périphérique après l\'activation ou la désactivation de ce mode.</string>
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value">Valeur : <xliff:g id="v">%s</xliff:g></string>
|
||||
<string name="custom_seekbar_default_value">par défaut</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Valeur par défaut : <xliff:g id="v">%s</xliff:g>\nRester appuyer pour définir</string>
|
||||
<string name="custom_seekbar_default_value_is_set">Valeur par défaut définie</string>
|
||||
</resources>
|
||||
@@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
2016-2022 crDroid Android Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- PixelParts -->
|
||||
<string name="pixel_parts_title">Pixel-részek</string>
|
||||
<string name="pixel_parts_summary">A speciális, készülékfüggő beállítások változtatásai</string>
|
||||
<string name="pixel_parts_warning_title">Figyelmeztetés</string>
|
||||
<string name="pixel_parts_warning_text">Ezen funkciók legtöbbjének a helyes működéséhez meghatározott kernelbázisok szükségesek. Amennyiben Ön egyéni kernelt flessel, azt kockáztatja, hogy elveszíti a hozzáférést bizonyos funkciókhoz. Mi szóltunk előre!</string>
|
||||
<string name="pixel_parts_dialog">OK</string>
|
||||
<string name="kernel_node_access_error">A kernelhez való hozzáférés nem sikerült! Győződjön meg arról, hogy a sysf vagy procfs attribútum megadott elérési útja pontos, megfelelő jogosultságokkal rendelkezik, és a SELinux-szabályok megfelelőek.</string>
|
||||
<!-- Battery -->
|
||||
<string name="category_battery">Akkumulátor</string>
|
||||
<string name="battery_info_title">Akkuinformáció</string>
|
||||
<string name="battery_info_summary">Megtekintheti a különféle akkuinfókat</string>
|
||||
<string name="battery_info_refresh_summary">frissítés ennyi másodperc után</string>
|
||||
<string name="category_battery_info">Elérhető információk</string>
|
||||
<string name="technology_title">Technológia</string>
|
||||
<string name="status_title">Állapot</string>
|
||||
<string name="temperature_title">Hőmérséklet</string>
|
||||
<string name="capacity_title">Jelenlegi kapacitás</string>
|
||||
<string name="capacity_level_title">Kapacitás-szint</string>
|
||||
<string name="current_title">Jelenlegi</string>
|
||||
<string name="voltage_title">Feszültség</string>
|
||||
<string name="wattage_title">Fogyasztás</string>
|
||||
<string name="health_title">Állapot</string>
|
||||
<string name="cycle_count_title">Ciklusszám</string>
|
||||
<string name="stop_charging_title">Töltésmegállítási szint</string>
|
||||
<string name="stop_charging_summary">Nem engedi a készüléket egy adott szintnél tovább tölteni</string>
|
||||
<string name="start_charging_title">Töltésinditási szint</string>
|
||||
<string name="start_charging_summary">Csak akkor tölt, ha a beállított szint alá merül</string>
|
||||
<string name="stop_below_start_error">A megállási szintnek a kezdés szintje felett kell lennie!</string>
|
||||
<string name="start_above_stop_error">A kezdési szintnek a leállítási szint alatt kell lennie!</string>
|
||||
<!-- Camera -->
|
||||
<string name="category_camera">Kamera</string>
|
||||
<string name="flashlight_tile_title">Lámpa</string>
|
||||
<string name="torch_strength_title">A zseblámpa erőssége</string>
|
||||
<string name="torch_strength_summary">Itt állíthatja be a csempék fényerősségét</string>
|
||||
<!-- CPU -->
|
||||
<string name="category_cpu">Processzor</string>
|
||||
<string name="power_efficient_workqueue_title">Energiahatékony feladat-sorrendbeállítás</string>
|
||||
<string name="power_efficient_workqueue_summary">Energiát takarít meg azáltal, hogy átütemezi a munkát egy olyan processzormagra, amely már ébren van</string>
|
||||
<!-- Display -->
|
||||
<string name="category_display">Képernyő</string>
|
||||
<string name="hbm_title">Magas fényerejű mód (HBM)</string>
|
||||
<string name="hbm_summary">Csúcsfényerő-engedélyezés</string>
|
||||
<string name="auto_hbm_title">Automatikus magasfényerő</string>
|
||||
<string name="auto_hbm_summary">A napfényhez igazodik a csúcsfényerő</string>
|
||||
<string name="auto_hbm_threshold_summary">küszöbérték (lux)</string>
|
||||
<string name="hbm_enable_time_summary">Ennyi másodperc múlva bekapcsol</string>
|
||||
<string name="hbm_disable_time_summary">Ennyi másodperc múlva kikapcsol</string>
|
||||
<string name="hbm_info">A \'Magas fényerejű mód\' hosszú idejű használata tönkreteheti a kijelzőjét!</string>
|
||||
<!-- UiBench -->
|
||||
<string name="category_uibench">UiBench</string>
|
||||
<string name="jitter_test_title">Jitter</string>
|
||||
<string name="jitter_test_summary">A renderelési jitter kiszámítása</string>
|
||||
<!-- USB -->
|
||||
<string name="category_usb">USB</string>
|
||||
<string name="usb2_fast_charge_title">USB 2.0 gyorstöltés</string>
|
||||
<string name="usb2_fast_charge_summary">Az USB 2.0 portokon engedélyezi a CDP-módot a gyorstöltéshez</string>
|
||||
<string name="usb2_fast_charge_info">Vigyázva használja! Nem minden USB 2.0 port támogatja a CDP-módot!</string>
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value"><xliff:g id="v">%s</xliff:g> értékű</string>
|
||||
<string name="custom_seekbar_default_value">alapértelmezés szerint</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Alapértelmezetten <xliff:g id="v">%s</xliff:g> értékű\nNyomja meg hosszan a beállításhoz</string>
|
||||
<string name="custom_seekbar_default_value_is_set">Az alapértelmezett érték beállítva</string>
|
||||
</resources>
|
||||
@@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
2016-2022 crDroid Android Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- PixelParts -->
|
||||
<string name="pixel_parts_title">Pixel Parts</string>
|
||||
<string name="pixel_parts_summary">Configurações específicas do dispositivo</string>
|
||||
<string name="pixel_parts_warning_title">Aviso</string>
|
||||
<string name="pixel_parts_warning_text">A maioria destes recursos são atribuídas ao kernel stock. Ao instalar um kernel personalizado, você está sujeito a perder algumas funções. Você foi avisado!</string>
|
||||
<string name="pixel_parts_dialog">OK</string>
|
||||
<string name="kernel_node_access_error">Falha ao acessar os componentes do kernel! Certifique-se de que o caminho fornecido para o atributo sysfs ou procfs seja preciso, que tenha as permissões apropriadas e que as políticas do SELinux estejam configuradas corretamente.</string>
|
||||
<!-- Battery -->
|
||||
<string name="category_battery">Bateria</string>
|
||||
<string name="battery_info_title">Informações da bateria</string>
|
||||
<string name="battery_info_summary">Ver várias informações da bateria</string>
|
||||
<string name="battery_info_refresh_summary">atualizar informação após (segundos)</string>
|
||||
<string name="category_battery_info">Informações disponíveis</string>
|
||||
<string name="technology_title">Tecnologia</string>
|
||||
<string name="status_title">Status</string>
|
||||
<string name="temperature_title">Temperatura</string>
|
||||
<string name="capacity_title">Capacidade atual</string>
|
||||
<string name="capacity_level_title">Nível de capacidade</string>
|
||||
<string name="current_title">Atual</string>
|
||||
<string name="voltage_title">Tensão</string>
|
||||
<string name="wattage_title">Potência</string>
|
||||
<string name="health_title">Saúde</string>
|
||||
<string name="cycle_count_title">Ciclos de carga</string>
|
||||
<string name="stop_charging_title">Nível para interromper o carregamento</string>
|
||||
<string name="stop_charging_summary">Impedir que o dispositivo carregue acima da porcentagem definida</string>
|
||||
<string name="start_charging_title">Nível para retomar o carregamento</string>
|
||||
<string name="start_charging_summary">Retomar a carga na porcentagem definida</string>
|
||||
<string name="stop_below_start_error">O nível para interromper o carregamento deve ser maior que o nível para retomar!</string>
|
||||
<string name="start_above_stop_error">O nível para retomar o carregamento deve ser menor que o nível para interromper!</string>
|
||||
<!-- Camera -->
|
||||
<string name="category_camera">Câmera</string>
|
||||
<string name="flashlight_tile_title">Lanterna</string>
|
||||
<string name="torch_strength_title">Intensidade da lanterna</string>
|
||||
<string name="torch_strength_summary">Ajusta a intensidade da luz pelo bloco da lanterna nas configurações rápidas</string>
|
||||
<!-- CPU -->
|
||||
<string name="category_cpu">CPU</string>
|
||||
<string name="power_efficient_workqueue_title">Eficiência energética na fila de trabalho</string>
|
||||
<string name="power_efficient_workqueue_summary">Economize energia reprogramando o trabalho para um núcleo que já está acordado</string>
|
||||
<!-- Display -->
|
||||
<string name="category_display">Tela</string>
|
||||
<string name="hbm_title">Modo de brilho máximo (HBM)</string>
|
||||
<string name="hbm_summary">Ativar pico de luz</string>
|
||||
<string name="auto_hbm_title">HBM automático</string>
|
||||
<string name="auto_hbm_summary">Ativar o pico de luz quando exposto à luz solar</string>
|
||||
<string name="auto_hbm_threshold_summary">limite (lux)</string>
|
||||
<string name="hbm_enable_time_summary">ativar após (segundos)</string>
|
||||
<string name="hbm_disable_time_summary">desativar após (segundos)</string>
|
||||
<string name="hbm_info">Usar o modo de brilho máximo por muito tempo pode danificar sua tela!</string>
|
||||
<!-- UiBench -->
|
||||
<string name="category_uibench">UiBench</string>
|
||||
<string name="jitter_test_title">Jitter</string>
|
||||
<string name="jitter_test_summary">Calcular jitter de renderização</string>
|
||||
<!-- USB -->
|
||||
<string name="category_usb">USB</string>
|
||||
<string name="usb2_fast_charge_title">Carregamento rápido USB 2.0</string>
|
||||
<string name="usb2_fast_charge_summary">Ative o modo CDP para carregar rapidamente nas portas USB 2.0</string>
|
||||
<string name="usb2_fast_charge_info">Nem todas as portas USB 2.0 suportam o modo CDP, use com cuidado!</string>
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value">Valor: <xliff:g id="v">%s</xliff:g></string>
|
||||
<string name="custom_seekbar_default_value">por padrão</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Valor padrão: <xliff:g id="v">%s</xliff:g>\nPressione e segure para definir</string>
|
||||
<string name="custom_seekbar_default_value_is_set">Valor padrão definido</string>
|
||||
</resources>
|
||||
@@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
2016-2022 crDroid Android Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- PixelParts -->
|
||||
<string name="pixel_parts_title">Pixel Parts</string>
|
||||
<string name="pixel_parts_summary">Настроить специфические параметры устройства</string>
|
||||
<string name="pixel_parts_warning_title">Предупреждение</string>
|
||||
<string name="pixel_parts_warning_text">Большинство этих функций для своей работы зависят от определенных узлов ядра. При прошивке пользовательского ядра вы рискуете потерять доступ к некоторым из этих функций. Вы были предупреждены!</string>
|
||||
<string name="pixel_parts_dialog">ОК</string>
|
||||
<string name="kernel_node_access_error">Не удалось получить доступ к узлу ядра! Убедитесь, что предоставленный путь к атрибуту sysfs или procfs является точным, что он имеет соответствующие разрешения, а политики SELinux правильно настроены.</string>
|
||||
<!-- Battery -->
|
||||
<string name="category_battery">Батарея</string>
|
||||
<string name="battery_info_title">Информация о батарее</string>
|
||||
<string name="battery_info_summary">Просмотр различной информации о батарее</string>
|
||||
<string name="battery_info_refresh_summary">обновлять информацию через (секунд)</string>
|
||||
<string name="category_battery_info">Доступная информация</string>
|
||||
<string name="technology_title">Технология</string>
|
||||
<string name="status_title">Статус</string>
|
||||
<string name="temperature_title">Температура</string>
|
||||
<string name="capacity_title">Емкость сейчас</string>
|
||||
<string name="capacity_level_title">Уровень емкости</string>
|
||||
<string name="current_title">Текущий</string>
|
||||
<string name="voltage_title">Напряжение</string>
|
||||
<string name="wattage_title">Ваттность</string>
|
||||
<string name="health_title">Здоровье</string>
|
||||
<string name="cycle_count_title">Количество циклов</string>
|
||||
<string name="stop_charging_title">Уровень прекращения зарядки</string>
|
||||
<string name="stop_charging_summary">Запрет на зарядку устройства свыше определенного процента</string>
|
||||
<string name="start_charging_title">Уровень начала зарядки</string>
|
||||
<string name="start_charging_summary">Возобновление зарядки при определенном проценте</string>
|
||||
<string name="stop_below_start_error">Уровень остановки должен быть выше уровня старта!</string>
|
||||
<string name="start_above_stop_error">Уровень старта должен быть ниже уровня остановки!</string>
|
||||
<!-- Camera -->
|
||||
<string name="category_camera">Камера</string>
|
||||
<string name="flashlight_tile_title">Фонарик</string>
|
||||
<string name="torch_strength_title">Мощность фонарика</string>
|
||||
<string name="torch_strength_summary">Регулировка яркости фонарика PixelParts QS-Tile</string>
|
||||
<!-- CPU -->
|
||||
<string name="category_cpu">Процессор</string>
|
||||
<string name="power_efficient_workqueue_title">Энергоэффективная рабочая очередь</string>
|
||||
<string name="power_efficient_workqueue_summary">Экономит электроэнергию, перенося работу на ядро, которое уже активно</string>
|
||||
<!-- Display -->
|
||||
<string name="category_display">Экран</string>
|
||||
<string name="hbm_title">Режим повышенной яркости (HBM)</string>
|
||||
<string name="hbm_summary">Включить пиковую яркость</string>
|
||||
<string name="auto_hbm_title">Автоматический HBM</string>
|
||||
<string name="auto_hbm_summary">Включение пиковой яркости на основе солнечного света</string>
|
||||
<string name="auto_hbm_threshold_summary">порог (люкс)</string>
|
||||
<string name="hbm_enable_time_summary">включить через (секунд)</string>
|
||||
<string name="hbm_disable_time_summary">выключить через (секунд)</string>
|
||||
<string name="hbm_info">Длительное использование режима повышенной яркости может привести к повреждению дисплея!</string>
|
||||
<!-- UiBench -->
|
||||
<string name="category_uibench">UiBench</string>
|
||||
<string name="jitter_test_title">Дрожание</string>
|
||||
<string name="jitter_test_summary">Рассчитать визуализацию дрожания</string>
|
||||
<!-- USB -->
|
||||
<string name="category_usb">USB</string>
|
||||
<string name="usb2_fast_charge_title">Быстрая зарядка USB 2.0</string>
|
||||
<string name="usb2_fast_charge_summary">Включить режим CDP для быстрой зарядки на портах USB 2.0</string>
|
||||
<string name="usb2_fast_charge_info">Не все порты USB 2.0 поддерживают режим CDP, используйте с осторожностью!</string>
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value">Значение: <xliff:g id="v">%s</xliff:g></string>
|
||||
<string name="custom_seekbar_default_value">по умолчанию</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Значение по умолчанию: <xliff:g id="v">%s</xliff:g>\nУдерживайте для установки</string>
|
||||
<string name="custom_seekbar_default_value_is_set">Установлено значение по умолчанию</string>
|
||||
</resources>
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
2016-2022 crDroid Android Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- PixelParts -->
|
||||
<string name="pixel_parts_title">Pixel Parts</string>
|
||||
<string name="pixel_parts_summary">Konfigurera enhetsspecifika inställningar</string>
|
||||
<string name="pixel_parts_warning_title">Varning</string>
|
||||
<string name="pixel_parts_warning_text">De flesta av dessa funktionerna kräver specifika kernel noder för att fungera. När du installerar en tredjeparts kernel så riskerar du att ta miste om några av dessa funktionerna. Du har blivit varnad!</string>
|
||||
<string name="kernel_node_access_error">Åtkomst till kernelnoderna misslyckades! Var noga med att rätt sökväg till sysfs eller procfs attributerna är rätt, att de har lämpliga rättigheter och att SELinux är inställt rätt.</string>
|
||||
<!-- Battery -->
|
||||
<string name="battery_info_title">Batteriinformation</string>
|
||||
<string name="battery_info_summary">Visa diverse batteriinformation</string>
|
||||
<string name="battery_info_refresh_summary">Uppdatera infon efter (sekunder)</string>
|
||||
<string name="category_battery_info">Tillgänglig info</string>
|
||||
<string name="technology_title">Teknologi</string>
|
||||
<string name="status_title">Status</string>
|
||||
<string name="temperature_title">Temperatur</string>
|
||||
<string name="capacity_title">Nuvarande kapacitet</string>
|
||||
<string name="capacity_level_title">Kapacitetsnivå</string>
|
||||
<string name="current_title">Ström</string>
|
||||
<string name="voltage_title">Spänning</string>
|
||||
<string name="wattage_title">Watt</string>
|
||||
<string name="health_title">Hälsa</string>
|
||||
<string name="cycle_count_title">Antal cykler</string>
|
||||
<string name="stop_charging_title">Stoppladdningsnivå</string>
|
||||
<string name="stop_charging_summary">Förhindra enheten från att ladda över en viss procent</string>
|
||||
<string name="start_charging_title">Startladdningsnivå</string>
|
||||
<string name="start_charging_summary">Återuppta laddning vid procent</string>
|
||||
<string name="stop_below_start_error">Stoppnivån måste vara över startnivån!</string>
|
||||
<string name="start_above_stop_error">Startnivån måste vara under stoppnivå!</string>
|
||||
<!-- Camera -->
|
||||
<string name="torch_strength_title">Ficklampsstryka</string>
|
||||
<string name="torch_strength_summary">Justera ljusstyrkan för PixelParts ficklampans QS-bricka</string>
|
||||
<!-- CPU -->
|
||||
<string name="category_cpu">CPU</string>
|
||||
<string name="power_efficient_workqueue_title">Krafteffektiv arbetskö</string>
|
||||
<string name="power_efficient_workqueue_summary">Spara kraft genom att flytta arbetet till en kärna som redan är aktiv</string>
|
||||
<!-- Display -->
|
||||
<string name="category_display">Skärm</string>
|
||||
<string name="hbm_title">Högt ljusstyrksläge (HBM)</string>
|
||||
<string name="hbm_summary">Aktiveringsluminans</string>
|
||||
<string name="auto_hbm_title">Automatisk HBM</string>
|
||||
<string name="auto_hbm_summary">Aktivera luminans baserat på solljus</string>
|
||||
<string name="auto_hbm_threshold_summary">tröskel (lux)</string>
|
||||
<string name="hbm_enable_time_summary">aktivera efter (sekunder)</string>
|
||||
<string name="hbm_disable_time_summary">inaktivera efter (sekunder)</string>
|
||||
<string name="hbm_info">Längre tids användning av HBM kan skada din skärm!</string>
|
||||
<!-- UiBench -->
|
||||
<string name="category_uibench">UiBench</string>
|
||||
<string name="jitter_test_title">Jitter</string>
|
||||
<string name="jitter_test_summary">Beräkna renderingsjitter</string>
|
||||
<!-- USB -->
|
||||
<string name="category_usb">USB</string>
|
||||
<string name="usb2_fast_charge_title">USB 2.0 snabbladdning</string>
|
||||
<string name="usb2_fast_charge_summary">Aktivera CDP-läge för snabb laddning på USB 2.0-portar</string>
|
||||
<string name="usb2_fast_charge_info">Inte alla USB 2.0-portar har stöd för CDP-läge, använd varsamt!</string>
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value">Värde: <xliff:g id="v">%s</xliff:g></string>
|
||||
<string name="custom_seekbar_default_value">standard</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Standardvärde: <xliff:g id="v">%s</xliff:g>\nLångtryck för att ställa in</string>
|
||||
<string name="custom_seekbar_default_value_is_set">Standardvärdet är satt</string>
|
||||
</resources>
|
||||
@@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
2016-2022 crDroid Android Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- PixelParts -->
|
||||
<string name="pixel_parts_title">Pixel Araçları</string>
|
||||
<string name="pixel_parts_summary">Cihaza özel seçenekleri ayarlayın</string>
|
||||
<string name="pixel_parts_warning_title">Uyarı</string>
|
||||
<string name="pixel_parts_warning_text">Bu özelliklerin çoğu özel kernel parametreleri gerektirir. Özel bir kernel yüklerseniz bazı özellikleri kaybetme riskiniz olur. Dikkatli olun!</string>
|
||||
<string name="pixel_parts_dialog">Tamam</string>
|
||||
<string name="kernel_node_access_error">Kernel devresine erişim başarısız oldu! Lütfen sysfs veya procfs yolunun doğru olup olmadığını, gerekli izinlere sahip olup olmadığını ve SELinux durumunun doğru ayarlanıp ayarlanmadığını kontrol edin.</string>
|
||||
<!-- Battery -->
|
||||
<string name="category_battery">Pil</string>
|
||||
<string name="battery_info_title">Pil bilgisi</string>
|
||||
<string name="battery_info_summary">Çeşitli pil bilgilerini görüntüleyin</string>
|
||||
<string name="battery_info_refresh_summary">bilgiyi (saniye) sonra yenile</string>
|
||||
<string name="category_battery_info">Mevcut bilgi</string>
|
||||
<string name="technology_title">Teknoloji</string>
|
||||
<string name="status_title">Durum</string>
|
||||
<string name="temperature_title">Sıcaklık</string>
|
||||
<string name="capacity_title">Şu anki kapasite</string>
|
||||
<string name="capacity_level_title">Kapasite seviyesi</string>
|
||||
<string name="current_title">Mevcut</string>
|
||||
<string name="voltage_title">Voltaj</string>
|
||||
<string name="wattage_title">Vat miktarı</string>
|
||||
<string name="health_title">Sağlık</string>
|
||||
<string name="cycle_count_title">Döngü sayısı</string>
|
||||
<string name="stop_charging_title">Şarj etmeyi durdurma seviyesi</string>
|
||||
<string name="stop_charging_summary">Cihazın özel bir yüzdeden fazla şarj olmasını engelle</string>
|
||||
<string name="start_charging_title">Şarj etmeyi başlatma seviyesi</string>
|
||||
<string name="start_charging_summary">Özel bir yüzdeye gelince şarj etmeyi sürdür</string>
|
||||
<string name="stop_below_start_error">Durdurma seviyesi başlatma seviyesinin üstünde olmalıdır!</string>
|
||||
<string name="start_above_stop_error">Başlatma seviyesi durdurma seviyesinin altında olmalıdır!</string>
|
||||
<!-- Camera -->
|
||||
<string name="category_camera">Kamera</string>
|
||||
<string name="flashlight_tile_title">El feneri</string>
|
||||
<string name="torch_strength_title">El feneri gücü</string>
|
||||
<string name="torch_strength_summary">El fenerinin parlaklığını ayarlayın</string>
|
||||
<!-- CPU -->
|
||||
<string name="category_cpu">İşlemci</string>
|
||||
<string name="power_efficient_workqueue_title">Güç verimli iş sırası</string>
|
||||
<string name="power_efficient_workqueue_summary">İş sırasını yeniden planlayarak zaten uyanık olan bir çekirdeğe aktararak güç tasarrufu yapın</string>
|
||||
<!-- Display -->
|
||||
<string name="category_display">Ekran</string>
|
||||
<string name="hbm_title">Yüksek parlaklık modu (YPM)</string>
|
||||
<string name="hbm_summary">En yüksek parlaklığı etkinleştir</string>
|
||||
<string name="auto_hbm_title">Otomatik YPM</string>
|
||||
<string name="auto_hbm_summary">Gün ışığına bağlı olarak yüksek parlaklığı etkinleştir</string>
|
||||
<string name="auto_hbm_threshold_summary">eşik (lux)</string>
|
||||
<string name="hbm_enable_time_summary">(Saniye) sonra etkinleştir</string>
|
||||
<string name="hbm_disable_time_summary">(Saniye) sonra devre dışı bırak</string>
|
||||
<string name="hbm_info">Yüksek parlaklık modunun uzun süre kullanımı ekranınıza zarar verebilir!</string>
|
||||
<!-- UiBench -->
|
||||
<string name="category_uibench">Kullanıcı arabirimi sıralaması</string>
|
||||
<string name="jitter_test_title">Seğirme</string>
|
||||
<string name="jitter_test_summary">Seyirme oluşumunu ölç</string>
|
||||
<!-- USB -->
|
||||
<string name="category_usb">USB</string>
|
||||
<string name="usb2_fast_charge_title">USB 2.0 hızlı şarj</string>
|
||||
<string name="usb2_fast_charge_summary">USB 2.0 portundan hızlı şarjı etkinleştir</string>
|
||||
<string name="usb2_fast_charge_info">Tüm USB 2.0 portları hızlı şarjı desteklemez, dikkatli olun!</string>
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value">Değer: <xliff:g id="v">%s</xliff:g></string>
|
||||
<string name="custom_seekbar_default_value">varsayılan olarak</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Varsayılan değer: <xliff:g id="v">%s</xliff:g>\nAyarlamak için uzun dokunun</string>
|
||||
<string name="custom_seekbar_default_value_is_set">Varsayılan değer ayarlandı</string>
|
||||
</resources>
|
||||
13
res/values/arrays.xml
Normal file
13
res/values/arrays.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<resources>
|
||||
|
||||
<string-array name="unsupported_hbm_devices" translatable="false">
|
||||
<item>tangorpro</item>
|
||||
<item>felix</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
2016-2022 crDroid Android Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
@@ -8,83 +8,33 @@
|
||||
|
||||
<!-- PixelParts -->
|
||||
<string name="pixel_parts_title">Pixel Parts</string>
|
||||
<string name="pixel_parts_summary">Configure device specific settings</string>
|
||||
<string name="pixel_parts_warning_title">Warning</string>
|
||||
<string name="pixel_parts_warning_text">Some of these features rely on specific kernel nodes in order to function. When flashing a custom kernel, you risk the possibility of losing access to some of these features. You have been warned!</string>
|
||||
<string name="pixel_parts_dialog">OK</string>
|
||||
<string name="pixel_parts_about_title">About</string>
|
||||
<string name="pixel_parts_about_summary">PixelParts began as a simple High Brightness Mode (HBM) tool. Since then, it has evolved to include a detailed battery information panel, a display saturation level adjuster, charging limiter and more. The app now offers a wide range of features, transitioning from its original function as an HBM tool to a hub for device tweaks and stats on customs, with a lot more planned going forward</string>
|
||||
<string name="about_category_links">Various links</string>
|
||||
<string name="about_category_credit">Credit</string>
|
||||
<string name="pixel_parts_github_title" translatable="false">GitHub</string>
|
||||
<string name="pixel_parts_github_summary">Check out the GitHub repository</string>
|
||||
<string name="pixel_parts_xda_title" translatable="false">XDA</string>
|
||||
<string name="pixel_parts_xda_summary">Check out the XDA thread</string>
|
||||
<string name="pixel_parts_developer_title">Developer</string>
|
||||
<string name="pixel_parts_developer_summary" translatable="false">Anierin Bliss</string>
|
||||
<string name="kernel_node_access_error">Kernel node access failed! Please ensure the provided path to the sysfs or procfs attribute is accurate, that it has appropriate permissions, and the SELinux policies are properly configured.</string>
|
||||
<string name="kernel_node_returned_value_unknown">No string resource found for the value returned by the node.</string>
|
||||
<string name="tile_on">On</string>
|
||||
<string name="tile_off">Off</string>
|
||||
<string name="tile_camera_in_use">Camera in use</string>
|
||||
|
||||
<!-- Battery -->
|
||||
<string name="category_battery">Battery</string>
|
||||
<string name="battery_info_title">Battery info</string>
|
||||
<string name="battery_info_summary">View various battery information</string>
|
||||
<!-- Battery info -->
|
||||
<string name="battery_info_title">Battery information</string>
|
||||
<string name="battery_info_summary">View various information pertaining to the battery</string>
|
||||
<string name="battery_info_refresh_title">Refresh info every second</string>
|
||||
<string name="launch_battery_usage_title">Launch battery usage summary</string>
|
||||
<string name="category_battery_info">Available info</string>
|
||||
<string name="technology_title">Technology</string>
|
||||
<string name="technology_info_title">Technology information</string>
|
||||
<string name="technology_info_message">
|
||||
Li-ion (Lithium-ion):\n\nWidely used in smartphones and many electronic devices, Li-ion batteries provide high energy density, lightweight design, and relatively low self-discharge rate.\n\n
|
||||
NiMH (Nickel Metal Hydride):\n\nOffering a good balance between capacity and cost, NiMH batteries are commonly used in certain devices.\n\n
|
||||
Li-poly (Lithium Polymer):\n\nSimilar to Li-ion batteries, Li-poly batteries have a flexible and lightweight form factor. They are often used in slim devices where space is a concern.\n\n
|
||||
LiFe (Lithium Iron Phosphate):\n\nProviding a longer lifespan, enhanced safety, and better temperature tolerance, LiFe batteries are commonly used in applications prioritizing durability and stability.\n\n
|
||||
NiCd (Nickel Cadmium):\n\nAn older technology with lower energy density and higher self-discharge rate, NiCd batteries are less common nowadays due to environmental concerns.\n\n
|
||||
LiMn (Lithium Manganese):\n\nA variant of Li-ion batteries, LiMn batteries offer high power output and stability, making them suitable for applications requiring high current.\n\n
|
||||
In smartphones, Li-ion batteries are the most commonly used technology due to their optimal balance of performance, capacity, and safety.
|
||||
</string>
|
||||
<string name="status_title">Status</string>
|
||||
<string name="status_info_title">Status information</string>
|
||||
<string name="status_info_message">
|
||||
Unknown:\n\nThe status of the device is currently unknown.\n\n
|
||||
Charging:\n\nThe device is currently being charged.\n\n
|
||||
Discharging:\n\nThe device is currently discharging its battery.\n\n
|
||||
Not charging:\n\nThe device is connected but not actively charging its battery.
|
||||
</string>
|
||||
<string name="status_unknown">Unknown</string>
|
||||
<string name="status_charging">Charging</string>
|
||||
<string name="status_discharging">Discharging</string>
|
||||
<string name="status_not_charging">Not charging</string>
|
||||
<string name="status_full">Full</string>
|
||||
<string name="usb_type_title">USB type</string>
|
||||
<string name="usb_type_info_title">USB type information</string>
|
||||
<string name="usb_type_info_message">
|
||||
Standard Downstream Port (SDP):\n\nThis is the most basic form of USB connection. It can be used for data transfer and also to supply power, but it doesn\'t have any special features for charging devices more quickly.\n\n
|
||||
Charging Downstream Port (CDP):\n\nThis type of USB connection also supports data transfer, but it can supply more power than an SDP port. This means it can charge devices more quickly while still allowing for data transfer. CDPs were introduced in the USB Battery Charging Specification (Revision 1.2), to address the need of charging batteries of portable devices.\n\n
|
||||
Dedicated Charging Port (DCP):\n\nThis type of USB connection doesn\'t support data transfer at all. It\'s only used for charging devices, and it can usually supply even more power than a CDP port. DCP is used when there is a need for more power to charge a device but no data transfer is needed.
|
||||
</string>
|
||||
<string name="usb_type_unknown_or_not_connected">Not connected or unknown</string>
|
||||
<string name="usb_type_standard_downstream_port">Standard Downstream Port (SDP)</string>
|
||||
<string name="usb_type_charging_downstream_port">Charging Downstream Port (CDP)</string>
|
||||
<string name="usb_type_dedicated_charging_port">Dedicated Charging Port (DCP)</string>
|
||||
<string name="temperature_title">Temperature</string>
|
||||
<string name="temperature_info_title">Temperature information</string>
|
||||
<string name="temperature_info_message">Temperature refers to the degree of hotness or coldness, measured in Celsius (°C) or Fahrenheit (°F). High temperatures can impact device performance and lifespan. Recommended operating ranges for smartphones are typically between 0°C and 35°C (32°F and 95°F). Monitoring temperature ensures devices stay within the safe range, preventing overheating and damage. Maintaining suitable temperatures contributes to optimal performance and longevity.</string>
|
||||
<string name="temperature_unit_title">Use °F for temperature</string>
|
||||
<string name="capacity_title">Capacity now</string>
|
||||
<string name="capacity_info_title">Capacity information</string>
|
||||
<string name="capacity_info_message">Capacity refers to the current charge level of the battery, represented as a percentage of its overall capacity. It indicates how much charge is currently available compared to the maximum capacity. Monitoring the capacity level in percentage helps estimate the remaining battery power and plan power usage accordingly.</string>
|
||||
<string name="capacity_level_title">Capacity level</string>
|
||||
<string name="capacity_level_info_title">Capacity level information</string>
|
||||
<string name="capacity_level_info_message">
|
||||
Unknown:\n\nThe current battery capacity level is unknown.\n\n
|
||||
Critical:\n\nThe battery capacity is critically low. Immediate charging is recommended.\n\n
|
||||
Low:\n\nThe battery capacity is low. Consider charging the device.\n\n
|
||||
Normal:\n\nThe battery capacity is at a normal level.\n\n
|
||||
High:\n\nThe battery capacity is relatively high. No immediate charging is required.\n\n
|
||||
Full:\n\nThe battery capacity is at full capacity. The device is fully charged.
|
||||
</string>
|
||||
<string name="capacity_level_unknown">Unknown</string>
|
||||
<string name="capacity_level_critical">Critical</string>
|
||||
<string name="capacity_level_low">Low</string>
|
||||
@@ -92,25 +42,9 @@
|
||||
<string name="capacity_level_high">High</string>
|
||||
<string name="capacity_level_full">Full</string>
|
||||
<string name="current_title">Current</string>
|
||||
<string name="current_info_title">Current information</string>
|
||||
<string name="current_info_message">Current refers to the flow of electric charge in a circuit, measured in milliamperes (mA). It represents the rate at which electric charge is flowing. The current value indicates the amount of charge being charged or discharged by a device. Monitoring the current value helps track the flow of power and manage the charging or discharging process effectively.</string>
|
||||
<string name="voltage_title">Voltage</string>
|
||||
<string name="voltage_info_title">Voltage information</string>
|
||||
<string name="voltage_info_message">Voltage refers to the electrical potential difference in a circuit, measured in volts (V). It determines the behavior and functionality of electrical devices. Matching the required voltage ensures proper device operation, while incorrect voltage levels can cause damage or malfunction.</string>
|
||||
<string name="wattage_title">Wattage</string>
|
||||
<string name="wattage_info_title">Wattage information</string>
|
||||
<string name="wattage_info_message">Wattage refers to the amount of electrical power consumed or produced by a device. It is calculated by multiplying the voltage by the current (Wattage = Voltage × Current). Understanding wattage helps determine power requirements, device capabilities, and ensures safe operation of electrical devices.</string>
|
||||
<string name="health_title">Health</string>
|
||||
<string name="health_info_title">Health information</string>
|
||||
<string name="health_info_message">
|
||||
Unknown:\n\nThe battery health status is currently unknown.\n\n
|
||||
Good:\n\nThe battery is in good health and functioning properly.\n\n
|
||||
Overheat:\n\nThe battery is experiencing overheat, which may affect its performance and lifespan.\n\n
|
||||
Dead:\n\nThe battery is dead and no longer functional. Replacement is necessary.\n\n
|
||||
Over voltage:\n\nThe battery is experiencing over voltage, which may pose a risk to the device.\n\n
|
||||
Unspecified failure:\n\nThe battery has encountered an unspecified failure, affecting its performance.\n\n
|
||||
Cold:\n\nThe battery is experiencing cold temperature conditions, which may affect its performance and capacity.
|
||||
</string>
|
||||
<string name="health_unknown">Unknown</string>
|
||||
<string name="health_good">Good</string>
|
||||
<string name="health_overheat">Overheat</string>
|
||||
@@ -126,25 +60,26 @@
|
||||
<string name="health_cool">Cool</string>
|
||||
<string name="health_hot">Hot</string>
|
||||
<string name="cycle_count_title">Cycle count</string>
|
||||
<string name="cycle_count_info_title">Cycle count information</string>
|
||||
<string name="cycle_count_info_message">Cycle count refers to the number of charge-discharge cycles a rechargeable battery has undergone. It indicates the usage and aging of the battery. Monitoring the cycle count helps estimate battery lifespan and helps determine if a replacement is needed.</string>
|
||||
|
||||
<!-- Charge control -->
|
||||
<string name="charge_control_title">Charge control</string>
|
||||
<string name="charge_control_summary">Control when the device stops and starts charging</string>
|
||||
<string name="charge_control_main_switch_title">Use Charge control</string>
|
||||
<string name="stop_charging_title">Stop charging level</string>
|
||||
<string name="stop_charging_summary">Prevent the device from charging over a specific percentage</string>
|
||||
<string name="stop_charging_summary">Stop charging when the set percentage is reached</string>
|
||||
<string name="start_charging_title">Start charging level</string>
|
||||
<string name="start_charging_summary">Resume charging at a specific percentage</string>
|
||||
<string name="start_charging_summary">Resume charging when the set percentage is reached</string>
|
||||
<string name="stop_below_start_error">Stop level must be above start level!</string>
|
||||
<string name="start_above_stop_error">Start level must be below stop level!</string>
|
||||
<string name="charge_control_footer_summary">Charge control may interfere with adaptive charging.</string>
|
||||
|
||||
<!-- Leds -->
|
||||
<string name="category_leds">LEDs</string>
|
||||
<string name="pixeltorch_tile_title">Pixel Torch</string>
|
||||
<string name="torch_strength_title">Torch strength</string>
|
||||
<string name="torch_strength_summary">Adjust the brightness of the Pixel Torch QS-Tile</string>
|
||||
<!-- Pixel torch -->
|
||||
<string name="pixel_torch_title">Pixel torch</string>
|
||||
<string name="pixel_torch_summary">Adjust the brightness of the Pixel Torch QS-Tile</string>
|
||||
<string name="pixel_torch_strength_title">Strength</string>
|
||||
<string name="pixel_torch_strength_summary">The brightness level used by Pixel torch</string>
|
||||
|
||||
<!-- Display -->
|
||||
<string name="category_display">Display</string>
|
||||
<string name="hbm_title">High brightness mode (HBM)</string>
|
||||
<string name="hbm_summary">Directly enable high brightness mode</string>
|
||||
<!-- Auto hbm -->
|
||||
<string name="auto_hbm_title">Automatic HBM</string>
|
||||
<string name="auto_hbm_main_switch_title">Use automatic HBM</string>
|
||||
<string name="auto_hbm_summary">Automatically enable high brightness mode based on sunlight intensity (lux)</string>
|
||||
@@ -154,25 +89,21 @@
|
||||
<string name="auto_hbm_enable_time_summary">Duration in seconds that the light threshold must be continuously met to activate HBM</string>
|
||||
<string name="auto_hbm_disable_time_title">Disable time</string>
|
||||
<string name="auto_hbm_disable_time_summary">Duration in seconds for which HBM is deactivated if the light threshold falls below the set level</string>
|
||||
|
||||
<!-- Saturation -->
|
||||
<string name="saturation_title">Saturation</string>
|
||||
<string name="saturation_summary">Control the saturation level of the display</string>
|
||||
<string name="saturation_footer_summary">Changing the color mode in display settings will override the saturation level, requiring it to be reapplied.</string>
|
||||
|
||||
<!-- UiBench -->
|
||||
<string name="category_uibench">UiBench</string>
|
||||
<string name="jitter_test_title">Jitter</string>
|
||||
<string name="jitter_test_summary">Calculate rendering jitter</string>
|
||||
|
||||
<!-- USB -->
|
||||
<string name="category_usb">USB</string>
|
||||
<string name="usb2_fast_charge_title">USB 2.0 fast charge</string>
|
||||
<string name="usb2_fast_charge_summary">Enable CDP mode for fast charging on USB 2.0 ports</string>
|
||||
<string name="usb2_fast_charge_footer_summary">Caution: Not all USB 2.0 ports support CDP mode. For changes to take effect, disconnect and reconnect the device after enabling or disabling this mode.</string>
|
||||
<!-- Fast charge -->
|
||||
<string name="fast_charge_title">Fast charge</string>
|
||||
<string name="fast_charge_summary">Enable CDP mode for fast charging on USB 2.0 ports</string>
|
||||
<string name="fast_charge_main_switch_title">Use Fast charge</string>
|
||||
<string name="fast_charge_footer_summary">Caution: Not all USB 2.0 ports support CDP mode. For changes to take effect, disconnect and reconnect the device after enabling or disabling this mode.</string>
|
||||
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value">Value: <xliff:g id="v">%s</xliff:g></string>
|
||||
<string name="custom_seekbar_default_value">by default</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Default value: <xliff:g id="v">%s</xliff:g>\nLong tap to set</string>
|
||||
<string name="custom_seekbar_default_value_is_set">Default value is set</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/org.evolution.pixelparts">
|
||||
|
||||
<PreferenceScreen
|
||||
android:key="evolution_logo"
|
||||
android:layout="@layout/evolution_logo">
|
||||
</PreferenceScreen>
|
||||
|
||||
<Preference
|
||||
android:key="pixel_parts_about_summary"
|
||||
android:summary="@string/pixel_parts_about_summary"
|
||||
android:selectable="false" />
|
||||
|
||||
<!-- Start of links category -->
|
||||
<PreferenceCategory
|
||||
android:key="about_category_links"
|
||||
android:title="@string/about_category_links">
|
||||
|
||||
<Preference
|
||||
android:key="pixel_parts_github"
|
||||
android:title="@string/pixel_parts_github_title"
|
||||
android:summary="@string/pixel_parts_github_summary"
|
||||
android:icon="@drawable/ic_github">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:data="https://github.com/Evolution-X-Devices/packages_apps_PixelParts" />
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="pixel_parts_xda"
|
||||
android:title="@string/pixel_parts_xda_title"
|
||||
android:summary="@string/pixel_parts_xda_summary"
|
||||
android:icon="@drawable/ic_xda">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:data="https://forum.xda-developers.com/t/app-pixelparts-v1-0-customs.4596043/" />
|
||||
</Preference>
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Start of credit category -->
|
||||
<PreferenceCategory
|
||||
android:key="about_category_credit"
|
||||
android:title="@string/about_category_credit">
|
||||
|
||||
<Preference
|
||||
android:key="pixel_parts_developer"
|
||||
android:title="@string/pixel_parts_developer_title"
|
||||
android:summary="@string/pixel_parts_developer_summary">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:data="https://t.me/Anierin_Bliss" />
|
||||
</Preference>
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
50
res/xml/auto_hbm.xml
Normal file
50
res/xml/auto_hbm.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="auto_hbm_intro"
|
||||
android:title="@string/auto_hbm_summary" />
|
||||
|
||||
<com.android.settingslib.widget.MainSwitchPreference
|
||||
android:key="auto_hbm"
|
||||
android:title="@string/auto_hbm_main_switch_title"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.android.settingslib.widget.UsageProgressBarPreference
|
||||
android:key="current_lux_level"
|
||||
android:selectable="false" />
|
||||
|
||||
<org.evolution.pixelparts.CustomSeekBarPreference
|
||||
android:key="auto_hbm_threshold"
|
||||
android:title="@string/auto_hbm_threshold_title"
|
||||
android:summary="@string/auto_hbm_threshold_summary"
|
||||
android:max="60000"
|
||||
android:min="2000"
|
||||
settings:units=""
|
||||
android:defaultValue="20000" />
|
||||
|
||||
<org.evolution.pixelparts.CustomSeekBarPreference
|
||||
android:key="auto_hbm_enable_time"
|
||||
android:title="@string/auto_hbm_enable_time_title"
|
||||
android:summary="@string/auto_hbm_enable_time_summary"
|
||||
android:max="10"
|
||||
android:min="0"
|
||||
settings:units=""
|
||||
android:defaultValue="0" />
|
||||
|
||||
<org.evolution.pixelparts.CustomSeekBarPreference
|
||||
android:key="auto_hbm_disable_time"
|
||||
android:title="@string/auto_hbm_disable_time_title"
|
||||
android:summary="@string/auto_hbm_disable_time_summary"
|
||||
android:max="10"
|
||||
android:min="0"
|
||||
settings:units=""
|
||||
android:defaultValue="1" />
|
||||
</PreferenceScreen>
|
||||
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/org.evolution.pixelparts">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="auto_hbm_intro"
|
||||
android:title="@string/auto_hbm_summary" />
|
||||
|
||||
<com.android.settingslib.widget.MainSwitchPreference
|
||||
android:key="auto_hbm"
|
||||
android:title="@string/auto_hbm_main_switch_title"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.android.settingslib.widget.UsageProgressBarPreference
|
||||
android:key="current_lux_level"
|
||||
android:selectable="false" />
|
||||
|
||||
<org.evolution.pixelparts.preferences.CustomSeekBarPreference
|
||||
android:key="auto_hbm_threshold"
|
||||
android:title="@string/auto_hbm_threshold_title"
|
||||
android:summary="@string/auto_hbm_threshold_summary"
|
||||
android:persistent="true"
|
||||
android:max="60000"
|
||||
android:min="2000"
|
||||
settings:units=""
|
||||
android:defaultValue="20000" />
|
||||
|
||||
<org.evolution.pixelparts.preferences.CustomSeekBarPreference
|
||||
android:key="auto_hbm_enable_time"
|
||||
android:title="@string/auto_hbm_enable_time_title"
|
||||
android:summary="@string/auto_hbm_enable_time_summary"
|
||||
android:persistent="true"
|
||||
android:max="10"
|
||||
android:min="0"
|
||||
settings:units=""
|
||||
android:defaultValue="0" />
|
||||
|
||||
<org.evolution.pixelparts.preferences.CustomSeekBarPreference
|
||||
android:key="auto_hbm_disable_time"
|
||||
android:title="@string/auto_hbm_disable_time_title"
|
||||
android:summary="@string/auto_hbm_disable_time_summary"
|
||||
android:persistent="true"
|
||||
android:max="10"
|
||||
android:min="0"
|
||||
settings:units=""
|
||||
android:defaultValue="1" />
|
||||
</PreferenceScreen>
|
||||
65
res/xml/battery_info.xml
Normal file
65
res/xml/battery_info.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<Preference
|
||||
android:key="technology"
|
||||
android:title="@string/technology_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="status"
|
||||
android:title="@string/status_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="usb_type"
|
||||
android:title="@string/usb_type_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="temperature"
|
||||
android:title="@string/temperature_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="capacity"
|
||||
android:title="@string/capacity_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="capacity_level"
|
||||
android:title="@string/capacity_level_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="current"
|
||||
android:title="@string/current_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="voltage"
|
||||
android:title="@string/voltage_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="wattage"
|
||||
android:title="@string/wattage_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="health"
|
||||
android:title="@string/health_title"
|
||||
android:selectable="false" />
|
||||
|
||||
<Preference
|
||||
android:key="cycle_count"
|
||||
android:title="@string/cycle_count_title"
|
||||
android:selectable="false" />
|
||||
</PreferenceScreen>
|
||||
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/org.evolution.pixelparts">
|
||||
|
||||
<!-- Start of Battery info -->
|
||||
<PreferenceCategory
|
||||
android:key="battery_information"
|
||||
android:title="@string/category_battery_info">
|
||||
|
||||
<Preference
|
||||
android:key="technology"
|
||||
android:title="@string/technology_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="status"
|
||||
android:title="@string/status_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="usb_type"
|
||||
android:title="@string/usb_type_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="temperature"
|
||||
android:title="@string/temperature_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="capacity"
|
||||
android:title="@string/capacity_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="capacity_level"
|
||||
android:title="@string/capacity_level_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="current"
|
||||
android:title="@string/current_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="voltage"
|
||||
android:title="@string/voltage_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="wattage"
|
||||
android:title="@string/wattage_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="health"
|
||||
android:title="@string/health_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="cycle_count"
|
||||
android:title="@string/cycle_count_title"
|
||||
android:persistent="false" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
42
res/xml/charge_control.xml
Normal file
42
res/xml/charge_control.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="charge_control_intro"
|
||||
android:title="@string/charge_control_summary" />
|
||||
|
||||
<com.android.settingslib.widget.MainSwitchPreference
|
||||
android:key="charge_control"
|
||||
android:title="@string/charge_control_main_switch_title"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<org.evolution.pixelparts.CustomSeekBarPreference
|
||||
android:key="stop_charging"
|
||||
android:title="@string/stop_charging_title"
|
||||
android:persistent="true"
|
||||
android:max="100"
|
||||
android:min="1"
|
||||
settings:units="%"
|
||||
android:defaultValue="100" />
|
||||
|
||||
<org.evolution.pixelparts.CustomSeekBarPreference
|
||||
android:key="start_charging"
|
||||
android:title="@string/start_charging_title"
|
||||
android:persistent="true"
|
||||
android:max="99"
|
||||
android:min="0"
|
||||
settings:units="%"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:key="charge_control_footer"
|
||||
android:title="@string/charge_control_footer_summary"
|
||||
android:selectable="false" />
|
||||
</PreferenceScreen>
|
||||
24
res/xml/fast_charge.xml
Normal file
24
res/xml/fast_charge.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="fast_charge_intro"
|
||||
android:title="@string/fast_charge_summary" />
|
||||
|
||||
<com.android.settingslib.widget.MainSwitchPreference
|
||||
android:key="fast_charge"
|
||||
android:title="@string/fast_charge_main_switch_title"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:key="fast_charge_footer"
|
||||
android:title="@string/fast_charge_footer_summary"
|
||||
android:selectable="false" />
|
||||
</PreferenceScreen>
|
||||
126
res/xml/main.xml
126
res/xml/main.xml
@@ -1,126 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/org.evolution.pixelparts">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="device_intro"/>
|
||||
|
||||
<!-- Start of battery category -->
|
||||
<PreferenceCategory
|
||||
android:key="category_battery"
|
||||
android:title="@string/category_battery">
|
||||
|
||||
<Preference
|
||||
android:key="battery_info"
|
||||
android:title="@string/battery_info_title"
|
||||
android:summary="@string/battery_info_summary"
|
||||
android:persistent="false" >
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="org.evolution.pixelparts"
|
||||
android:targetClass="org.evolution.pixelparts.batteryinfo.BatteryInfoActivity" />
|
||||
</Preference>
|
||||
|
||||
<org.evolution.pixelparts.preferences.CustomSeekBarPreference
|
||||
android:key="stop_charging"
|
||||
android:title="@string/stop_charging_title"
|
||||
android:summary="@string/stop_charging_summary"
|
||||
android:persistent="true"
|
||||
android:max="100"
|
||||
android:min="1"
|
||||
settings:units=""
|
||||
android:defaultValue="100" />
|
||||
|
||||
<org.evolution.pixelparts.preferences.CustomSeekBarPreference
|
||||
android:key="start_charging"
|
||||
android:title="@string/start_charging_title"
|
||||
android:summary="@string/start_charging_summary"
|
||||
android:persistent="true"
|
||||
android:max="99"
|
||||
android:min="0"
|
||||
settings:units=""
|
||||
android:defaultValue="0" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Start of display category -->
|
||||
<PreferenceCategory
|
||||
android:key="category_display"
|
||||
android:title="@string/category_display">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="hbm"
|
||||
android:title="@string/hbm_title"
|
||||
android:summary="@string/hbm_summary" />
|
||||
|
||||
<Preference
|
||||
android:key="auto_hbm_settings"
|
||||
android:title="@string/auto_hbm_title"
|
||||
android:summary="@string/auto_hbm_summary"
|
||||
android:persistent="false" >
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="org.evolution.pixelparts"
|
||||
android:targetClass="org.evolution.pixelparts.autohbm.AutoHBMActivity" />
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="saturation_settings"
|
||||
android:title="@string/saturation_title"
|
||||
android:summary="@string/saturation_summary"
|
||||
android:persistent="false" >
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="org.evolution.pixelparts"
|
||||
android:targetClass="org.evolution.pixelparts.saturation.SaturationActivity" />
|
||||
</Preference>
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Start of leds category -->
|
||||
<PreferenceCategory
|
||||
android:key="category_leds"
|
||||
android:title="@string/category_leds">
|
||||
|
||||
<org.evolution.pixelparts.preferences.CustomSeekBarPreference
|
||||
android:key="torch_strength"
|
||||
android:title="@string/torch_strength_title"
|
||||
android:summary="@string/torch_strength_summary"
|
||||
android:persistent="true"
|
||||
android:max="45"
|
||||
android:min="1"
|
||||
settings:units=""
|
||||
android:defaultValue="45" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Start of uibench category -->
|
||||
<PreferenceCategory
|
||||
android:key="category_uibench"
|
||||
android:title="@string/category_uibench">
|
||||
|
||||
<Preference
|
||||
android:key="jitter"
|
||||
android:title="@string/jitter_test_title"
|
||||
android:summary="@string/jitter_test_summary"
|
||||
android:persistent="false" >
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="org.evolution.pixelparts"
|
||||
android:targetClass="org.evolution.pixelparts.uibench.JitterTestActivity" />
|
||||
</Preference>
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Start of usb category -->
|
||||
<PreferenceCategory
|
||||
android:key="category_usb"
|
||||
android:title="@string/category_usb">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="usb2_fast_charge"
|
||||
android:title="@string/usb2_fast_charge_title"
|
||||
android:summary="@string/usb2_fast_charge_summary" />
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:key="usb2_fast_charge_footer"
|
||||
android:title="@string/usb2_fast_charge_footer_summary"
|
||||
android:selectable="false" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
22
res/xml/pixel_torch.xml
Normal file
22
res/xml/pixel_torch.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="pixel_torch_intro"
|
||||
android:title="@string/pixel_torch_summary" />
|
||||
|
||||
<org.evolution.pixelparts.CustomSeekBarPreference
|
||||
android:key="pixel_torch_strength"
|
||||
android:title="@string/pixel_torch_strength_title"
|
||||
android:summary="@string/pixel_torch_strength_summary"
|
||||
android:max="45"
|
||||
android:min="1"
|
||||
android:defaultValue="45" />
|
||||
</PreferenceScreen>
|
||||
@@ -1,12 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Evolution X Project
|
||||
Copyright (C) 2023-2024 The Evolution X Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/org.evolution.pixelparts">
|
||||
|
||||
<org.evolution.pixelparts.preferences.CustomSeekBarPreference
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<org.evolution.pixelparts.CustomSeekBarPreference
|
||||
android:key="saturation"
|
||||
android:persistent="true"
|
||||
android:max="200"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 503 KiB |
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The CyanogenMod project
|
||||
* 2017 The LineageOS Project
|
||||
* 2023 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.database.MatrixCursor;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.provider.SearchIndexablesProvider;
|
||||
|
||||
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_CLASS_NAME;
|
||||
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_ICON_RESID;
|
||||
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_ACTION;
|
||||
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS;
|
||||
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE;
|
||||
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RANK;
|
||||
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RESID;
|
||||
import static android.provider.SearchIndexablesContract.INDEXABLES_RAW_COLUMNS;
|
||||
import static android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS;
|
||||
import static android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS;
|
||||
|
||||
public class ConfigPanelSearchIndexablesProvider extends SearchIndexablesProvider {
|
||||
private static final String TAG = "ConfigPanelSearchIndexablesProvider";
|
||||
|
||||
public static final int SEARCH_IDX_BUTTON_PANEL = 0;
|
||||
public static final int SEARCH_IDX_GESTURE_PANEL = 1;
|
||||
public static final int SEARCH_IDX_OCLICK_PANEL = 2;
|
||||
|
||||
private static SearchIndexableResource[] INDEXABLE_RES = new SearchIndexableResource[]{
|
||||
new SearchIndexableResource(1, R.xml.main,
|
||||
PixelPartsActivity.class.getName(),
|
||||
R.drawable.ic_pixel_parts),
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor queryXmlResources(String[] projection) {
|
||||
MatrixCursor cursor = new MatrixCursor(INDEXABLES_XML_RES_COLUMNS);
|
||||
return cursor;
|
||||
}
|
||||
|
||||
private static Object[] generateResourceRef(SearchIndexableResource sir) {
|
||||
Object[] ref = new Object[7];
|
||||
ref[COLUMN_INDEX_XML_RES_RANK] = sir.rank;
|
||||
ref[COLUMN_INDEX_XML_RES_RESID] = sir.xmlResId;
|
||||
ref[COLUMN_INDEX_XML_RES_CLASS_NAME] = null;
|
||||
ref[COLUMN_INDEX_XML_RES_ICON_RESID] = sir.iconResId;
|
||||
ref[COLUMN_INDEX_XML_RES_INTENT_ACTION] = "com.android.settings.action.EXTRA_SETTINGS";
|
||||
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE] = "org.evolution.pixelparts;";
|
||||
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className;
|
||||
return ref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor queryRawData(String[] projection) {
|
||||
MatrixCursor cursor = new MatrixCursor(INDEXABLES_RAW_COLUMNS);
|
||||
return cursor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor queryNonIndexableKeys(String[] projection) {
|
||||
MatrixCursor cursor = new MatrixCursor(NON_INDEXABLES_KEYS_COLUMNS);
|
||||
return cursor;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.misc;
|
||||
package org.evolution.pixelparts;
|
||||
|
||||
public class Constants {
|
||||
|
||||
// Device intro preference
|
||||
public static final String KEY_DEVICE_INTRO = "device_intro";
|
||||
|
||||
// Battery info preferences
|
||||
// Battery info
|
||||
public static final String KEY_BATTERY_INFO_REFRESH = "battery_info_refresh";
|
||||
public static final String KEY_TECHNOLOGY = "technology";
|
||||
public static final String KEY_STATUS = "status";
|
||||
@@ -35,7 +32,8 @@ public class Constants {
|
||||
public static final String NODE_HEALTH = "/sys/class/power_supply/battery/health";
|
||||
public static final String NODE_CYCLE_COUNT = "/sys/class/power_supply/battery/cycle_count";
|
||||
|
||||
// Stop/Start charging preferences
|
||||
// Charge control
|
||||
public static final String KEY_CHARGE_CONTROL = "charge_control";
|
||||
public static final String KEY_STOP_CHARGING = "stop_charging";
|
||||
public static final String KEY_START_CHARGING = "start_charging";
|
||||
public static final String NODE_STOP_CHARGING = "/sys/devices/platform/google,charger/charge_stop_level";
|
||||
@@ -43,13 +41,10 @@ public class Constants {
|
||||
public static final String DEFAULT_STOP_CHARGING = "100";
|
||||
public static final String DEFAULT_START_CHARGING = "0";
|
||||
|
||||
// Flashlight
|
||||
public static final String KEY_TORCH_STRENGTH = "torch_strength";
|
||||
public static final String KEY_TORCH_STATE = "torch_state";
|
||||
// Pixel torch
|
||||
public static final String KEY_PIXEL_TORCH_STRENGTH = "pixel_torch_strength";
|
||||
|
||||
// High brightness mode preferences/switches
|
||||
public static final String KEY_HBM = "hbm";
|
||||
public static final String KEY_AUTO_HBM_SETTINGS = "auto_hbm_settings";
|
||||
// AutoHbm
|
||||
public static final String KEY_AUTO_HBM = "auto_hbm";
|
||||
public static final String KEY_AUTO_HBM_THRESHOLD = "auto_hbm_threshold";
|
||||
public static final String KEY_AUTO_HBM_ENABLE_TIME = "auto_hbm_enable_time";
|
||||
@@ -57,10 +52,10 @@ public class Constants {
|
||||
public static final String KEY_CURRENT_LUX_LEVEL = "current_lux_level";
|
||||
public static final String NODE_HBM = "/sys/class/backlight/panel0-backlight/hbm_mode";
|
||||
|
||||
// Saturation preference
|
||||
// Saturation
|
||||
public static final String KEY_SATURATION = "saturation";
|
||||
|
||||
// USB 2.0 fast charge switch
|
||||
public static final String KEY_USB2_FAST_CHARGE = "usb2_fast_charge";
|
||||
public static final String NODE_USB2_FAST_CHARGE = "/sys/kernel/fast_charge/force_fast_charge";
|
||||
// Fast charge
|
||||
public static final String KEY_FAST_CHARGE = "fast_charge";
|
||||
public static final String NODE_FAST_CHARGE = "/sys/kernel/fast_charge/force_fast_charge";
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.preferences;
|
||||
package org.evolution.pixelparts;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
@@ -1,272 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 crDroid Android Project
|
||||
* 2023 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceFragment;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.preference.SwitchPreference;
|
||||
|
||||
import com.android.settingslib.widget.TopIntroPreference;
|
||||
|
||||
import org.evolution.pixelparts.about.AboutActivity;
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import org.evolution.pixelparts.preferences.CustomSeekBarPreference;
|
||||
import org.evolution.pixelparts.R;
|
||||
import org.evolution.pixelparts.services.HBMService;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
import org.evolution.pixelparts.utils.TorchUtils;
|
||||
|
||||
public class PixelParts extends PreferenceFragment
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
private static final String TAG = PixelParts.class.getSimpleName();
|
||||
|
||||
// Device intro preference
|
||||
private TopIntroPreference mIntroPreference;
|
||||
|
||||
// Stop/Start charging preferences
|
||||
private CustomSeekBarPreference mStopChargingPreference;
|
||||
private CustomSeekBarPreference mStartChargingPreference;
|
||||
|
||||
// High brightness mode preferences/switches
|
||||
private Preference mAutoHBMPreference;
|
||||
private SwitchPreference mHBMSwitch;
|
||||
|
||||
// USB 2.0 fast charge switch
|
||||
private SwitchPreference mUSB2FastChargeSwitch;
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.main);
|
||||
SharedPreferences prefs = getActivity().getSharedPreferences("main",
|
||||
Activity.MODE_PRIVATE);
|
||||
if (savedInstanceState == null && !prefs.getBoolean("first_warning_shown", false)) {
|
||||
showWarning();
|
||||
}
|
||||
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
Context context = getContext();
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
// Device intro preference
|
||||
String deviceManufacturer = Build.MANUFACTURER;
|
||||
String deviceModel = Build.MODEL;
|
||||
String deviceName = deviceManufacturer + " " + deviceModel;
|
||||
mIntroPreference = findPreference(Constants.KEY_DEVICE_INTRO);
|
||||
mIntroPreference.setTitle(deviceName);
|
||||
|
||||
// Stop charging preference
|
||||
mStopChargingPreference = (CustomSeekBarPreference) findPreference(Constants.KEY_STOP_CHARGING);
|
||||
if (FileUtils.isFileWritable(Constants.NODE_STOP_CHARGING)) {
|
||||
mStopChargingPreference.setValue(sharedPrefs.getInt(Constants.KEY_STOP_CHARGING,
|
||||
Integer.parseInt(FileUtils.getFileValue(Constants.NODE_STOP_CHARGING, Constants.DEFAULT_STOP_CHARGING))));
|
||||
mStopChargingPreference.setOnPreferenceChangeListener(this);
|
||||
} else {
|
||||
mStopChargingPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mStopChargingPreference.setEnabled(false);
|
||||
}
|
||||
|
||||
// Start charging preference
|
||||
mStartChargingPreference = (CustomSeekBarPreference) findPreference(Constants.KEY_START_CHARGING);
|
||||
if (FileUtils.isFileWritable(Constants.NODE_START_CHARGING)) {
|
||||
mStartChargingPreference.setValue(sharedPrefs.getInt(Constants.KEY_START_CHARGING,
|
||||
Integer.parseInt(FileUtils.getFileValue(Constants.NODE_START_CHARGING, Constants.DEFAULT_START_CHARGING))));
|
||||
mStartChargingPreference.setOnPreferenceChangeListener(this);
|
||||
} else {
|
||||
mStartChargingPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mStartChargingPreference.setEnabled(false);
|
||||
}
|
||||
|
||||
// High brightness mode preferences/switches
|
||||
mHBMSwitch = (SwitchPreference) findPreference(Constants.KEY_HBM);
|
||||
mAutoHBMPreference = (Preference) findPreference(Constants.KEY_AUTO_HBM_SETTINGS);
|
||||
if (FileUtils.isFileWritable(Constants.NODE_HBM)) {
|
||||
mHBMSwitch.setEnabled(true);
|
||||
mAutoHBMPreference.setEnabled(true);
|
||||
mHBMSwitch.setChecked(sharedPrefs.getBoolean(Constants.KEY_HBM, false));
|
||||
mHBMSwitch.setOnPreferenceChangeListener(this);
|
||||
} else {
|
||||
mHBMSwitch.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mAutoHBMPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mHBMSwitch.setEnabled(false);
|
||||
mAutoHBMPreference.setEnabled(false);
|
||||
}
|
||||
|
||||
// LEDs (PixelTorch)
|
||||
PreferenceCategory categoryLEDS = findPreference("category_leds");
|
||||
if (!TorchUtils.hasTorch(getContext())) {
|
||||
getPreferenceScreen().removePreference(categoryLEDS);
|
||||
}
|
||||
|
||||
// USB 2.0 fast charge switch
|
||||
mUSB2FastChargeSwitch = (SwitchPreference) findPreference(Constants.KEY_USB2_FAST_CHARGE);
|
||||
if (FileUtils.isFileWritable(Constants.NODE_USB2_FAST_CHARGE)) {
|
||||
mUSB2FastChargeSwitch.setEnabled(true);
|
||||
mUSB2FastChargeSwitch.setChecked(sharedPrefs.getBoolean(Constants.KEY_USB2_FAST_CHARGE, false));
|
||||
mUSB2FastChargeSwitch.setOnPreferenceChangeListener(this);
|
||||
} else {
|
||||
mUSB2FastChargeSwitch.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mUSB2FastChargeSwitch.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.pixel_parts_menu, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.pixel_parts_about) {
|
||||
Intent intent = new Intent(getActivity(), AboutActivity.class);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} else {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
// Stop charging preference
|
||||
if (preference == mStopChargingPreference) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
int value = Integer.parseInt(newValue.toString());
|
||||
int stopLevel = Integer.parseInt(newValue.toString());
|
||||
int startLevel = sharedPrefs.getInt(Constants.KEY_START_CHARGING, 0);
|
||||
if (startLevel >= stopLevel) {
|
||||
startLevel = stopLevel - 1;
|
||||
sharedPrefs.edit().putInt(Constants.KEY_START_CHARGING, startLevel).commit();
|
||||
FileUtils.writeValue(Constants.NODE_START_CHARGING, String.valueOf(startLevel));
|
||||
mStartChargingPreference.refresh(startLevel);
|
||||
Toast.makeText(getContext(), R.string.stop_below_start_error, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
sharedPrefs.edit().putInt(Constants.KEY_STOP_CHARGING, value).commit();
|
||||
FileUtils.writeValue(Constants.NODE_STOP_CHARGING, String.valueOf(value));
|
||||
return true;
|
||||
// Start charging preference
|
||||
} else if (preference == mStartChargingPreference) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
int value = Integer.parseInt(newValue.toString());
|
||||
int startLevel = Integer.parseInt(newValue.toString());
|
||||
int stopLevel = sharedPrefs.getInt(Constants.KEY_STOP_CHARGING, 100);
|
||||
if (stopLevel <= startLevel) {
|
||||
stopLevel = startLevel + 1;
|
||||
sharedPrefs.edit().putInt(Constants.KEY_STOP_CHARGING, stopLevel).commit();
|
||||
FileUtils.writeValue(Constants.NODE_STOP_CHARGING, String.valueOf(stopLevel));
|
||||
mStopChargingPreference.refresh(stopLevel);
|
||||
Toast.makeText(getContext(), R.string.start_above_stop_error, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
sharedPrefs.edit().putInt(Constants.KEY_START_CHARGING, value).commit();
|
||||
FileUtils.writeValue(Constants.NODE_START_CHARGING, String.valueOf(value));
|
||||
return true;
|
||||
// High brightness mode switch
|
||||
} else if (preference == mHBMSwitch) {
|
||||
boolean enabled = (Boolean) newValue;
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
sharedPrefs.edit().putBoolean(Constants.KEY_HBM, enabled).commit();
|
||||
FileUtils.writeValue(Constants.NODE_HBM, enabled ? "1" : "0");
|
||||
Intent hbmServiceIntent = new Intent(this.getContext(), HBMService.class);
|
||||
if (enabled) {
|
||||
this.getContext().startService(hbmServiceIntent);
|
||||
} else {
|
||||
this.getContext().stopService(hbmServiceIntent);
|
||||
}
|
||||
return true;
|
||||
// USB 2.0 fast charge switch
|
||||
} else if (preference == mUSB2FastChargeSwitch) {
|
||||
boolean enabled = (Boolean) newValue;
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
sharedPrefs.edit().putBoolean(Constants.KEY_USB2_FAST_CHARGE, enabled).commit();
|
||||
FileUtils.writeValue(Constants.NODE_USB2_FAST_CHARGE, enabled ? "1" : "0");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Stop charging preference
|
||||
public static void restoreStopChargingSetting(Context context) {
|
||||
if (FileUtils.isFileWritable(Constants.NODE_STOP_CHARGING)) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
int value = sharedPrefs.getInt(Constants.KEY_STOP_CHARGING,
|
||||
Integer.parseInt(FileUtils.getFileValue(Constants.NODE_STOP_CHARGING, Constants.DEFAULT_STOP_CHARGING)));
|
||||
FileUtils.writeValue(Constants.NODE_STOP_CHARGING, String.valueOf(value));
|
||||
}
|
||||
}
|
||||
|
||||
// Start charging preference
|
||||
public static void restoreStartChargingSetting(Context context) {
|
||||
if (FileUtils.isFileWritable(Constants.NODE_START_CHARGING)) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
int value = sharedPrefs.getInt(Constants.KEY_START_CHARGING,
|
||||
Integer.parseInt(FileUtils.getFileValue(Constants.NODE_START_CHARGING, Constants.DEFAULT_START_CHARGING)));
|
||||
FileUtils.writeValue(Constants.NODE_START_CHARGING, String.valueOf(value));
|
||||
}
|
||||
}
|
||||
|
||||
// High brightness mode switch
|
||||
public static void restoreHBMSetting(Context context) {
|
||||
if (FileUtils.isFileWritable(Constants.NODE_HBM)) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean value = sharedPrefs.getBoolean(Constants.KEY_HBM, false);
|
||||
FileUtils.writeValue(Constants.NODE_HBM, value ? "1" : "0");
|
||||
}
|
||||
}
|
||||
|
||||
// USB 2.0 fast charge switch
|
||||
public static void restoreUSB2FastChargeSetting(Context context) {
|
||||
if (FileUtils.isFileWritable(Constants.NODE_USB2_FAST_CHARGE)) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean value = sharedPrefs.getBoolean(Constants.KEY_USB2_FAST_CHARGE, false);
|
||||
FileUtils.writeValue(Constants.NODE_USB2_FAST_CHARGE, value ? "1" : "0");
|
||||
}
|
||||
}
|
||||
|
||||
// First launch warning dialog
|
||||
public static class WarningDialogFragment extends DialogFragment {
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.pixel_parts_warning_title)
|
||||
.setMessage(R.string.pixel_parts_warning_text)
|
||||
.setNegativeButton(R.string.pixel_parts_dialog, (dialog, which) -> dialog.cancel())
|
||||
.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
getActivity().getSharedPreferences("main", Activity.MODE_PRIVATE)
|
||||
.edit()
|
||||
.putBoolean("first_warning_shown", true)
|
||||
.commit();
|
||||
}
|
||||
}
|
||||
|
||||
private void showWarning() {
|
||||
WarningDialogFragment fragment = new WarningDialogFragment();
|
||||
fragment.show(getFragmentManager(), "warning_dialog");
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.app.Fragment;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import androidx.preference.PreferenceFragment;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
|
||||
import com.android.settingslib.widget.R;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
|
||||
import com.plattysoft.leonids.ParticleSystem;
|
||||
|
||||
import org.evolution.pixelparts.utils.ShakeUtils;
|
||||
|
||||
public class PixelPartsActivity extends CollapsingToolbarBaseActivity
|
||||
implements ShakeUtils.OnShakeListener {
|
||||
|
||||
private static final String TAG = "PixelParts";
|
||||
|
||||
private ShakeUtils mShakeUtils;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getFragmentManager().beginTransaction().replace(R.id.content_frame,
|
||||
new PixelParts(), TAG).commit();
|
||||
|
||||
mShakeUtils = new ShakeUtils(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mShakeUtils.bindShakeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mShakeUtils.unBindShakeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mShakeUtils.unBindShakeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShake(double speed) {
|
||||
Random rand = new Random();
|
||||
int firstRandom = rand.nextInt(91-0);
|
||||
int secondRandom = rand.nextInt(181-90)+90;
|
||||
int thirdRandom = rand.nextInt(181-0);
|
||||
|
||||
Drawable easteregg = getResources().getDrawable(R.drawable.easteregg,null);
|
||||
int randomColor;
|
||||
randomColor = Color.rgb(
|
||||
Color.red(rand.nextInt(0xFFFFFF)),
|
||||
Color.green(rand.nextInt(0xFFFFFF)),
|
||||
Color.blue(rand.nextInt(0xFFFFFF)));
|
||||
easteregg.setTint(randomColor);
|
||||
|
||||
ParticleSystem ps = new ParticleSystem(this, 50, easteregg, 2000);
|
||||
ps.setScaleRange(0.7f,1.3f);
|
||||
ps.setSpeedRange(0.1f,0.25f);
|
||||
ps.setAcceleration(0.0001f,thirdRandom);
|
||||
ps.setRotationSpeedRange(firstRandom,secondRandom);
|
||||
ps.setFadeOut(300);
|
||||
ps.oneShot(this.findViewById(android.R.id.content),50);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 crDroid Android Project
|
||||
* 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -10,33 +9,74 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import org.evolution.pixelparts.saturation.Saturation;
|
||||
import org.evolution.pixelparts.services.PixelTorchTileService;
|
||||
import org.evolution.pixelparts.utils.AutoHBMUtils;
|
||||
import org.evolution.pixelparts.autohbm.AutoHbmActivity;
|
||||
import org.evolution.pixelparts.autohbm.AutoHbmFragment;
|
||||
import org.evolution.pixelparts.autohbm.AutoHbmTileService;
|
||||
import org.evolution.pixelparts.chargecontrol.ChargeControlFragment;
|
||||
import org.evolution.pixelparts.fastcharge.FastChargeActivity;
|
||||
import org.evolution.pixelparts.fastcharge.FastChargeFragment;
|
||||
import org.evolution.pixelparts.fastcharge.FastChargeTileService;
|
||||
import org.evolution.pixelparts.pixeltorch.PixelTorchActivity;
|
||||
import org.evolution.pixelparts.pixeltorch.PixelTorchFragment;
|
||||
import org.evolution.pixelparts.pixeltorch.PixelTorchTileService;
|
||||
import org.evolution.pixelparts.saturation.SaturationFragment;
|
||||
import org.evolution.pixelparts.utils.ComponentUtils;
|
||||
import org.evolution.pixelparts.utils.TorchUtils;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
|
||||
public class Startup extends BroadcastReceiver {
|
||||
|
||||
private static final String TAG = Startup.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
|
||||
// PixelParts
|
||||
PixelParts.restoreStopChargingSetting(context);
|
||||
PixelParts.restoreStartChargingSetting(context);
|
||||
PixelParts.restoreHBMSetting(context);
|
||||
PixelParts.restoreUSB2FastChargeSetting(context);
|
||||
AutoHBMUtils.enableAutoHBM(context);
|
||||
Saturation.restoreSaturationSetting(context);
|
||||
// Auto hbm
|
||||
AutoHbmFragment.toggleAutoHbmService(context);
|
||||
|
||||
// PixelTorchTileService
|
||||
ComponentUtils.setComponentEnabled(
|
||||
ComponentUtils.toggleComponent(
|
||||
context,
|
||||
AutoHbmActivity.class,
|
||||
AutoHbmFragment.isHbmSupported(context)
|
||||
);
|
||||
|
||||
ComponentUtils.toggleComponent(
|
||||
context,
|
||||
AutoHbmTileService.class,
|
||||
AutoHbmFragment.isHbmSupported(context)
|
||||
);
|
||||
|
||||
// Charge control
|
||||
ChargeControlFragment.restoreStartChargingSetting(context);
|
||||
ChargeControlFragment.restoreStopChargingSetting(context);
|
||||
|
||||
// Fast charge
|
||||
FastChargeFragment.restoreFastChargeSetting(context);
|
||||
|
||||
ComponentUtils.toggleComponent(
|
||||
context,
|
||||
FastChargeActivity.class,
|
||||
FileUtils.fileExists(Constants.NODE_FAST_CHARGE)
|
||||
);
|
||||
|
||||
ComponentUtils.toggleComponent(
|
||||
context,
|
||||
FastChargeTileService.class,
|
||||
FileUtils.fileExists(Constants.NODE_FAST_CHARGE)
|
||||
);
|
||||
|
||||
// PixelTorch
|
||||
ComponentUtils.toggleComponent(
|
||||
context,
|
||||
PixelTorchActivity.class,
|
||||
PixelTorchFragment.hasTorch(context)
|
||||
);
|
||||
|
||||
ComponentUtils.toggleComponent(
|
||||
context,
|
||||
PixelTorchTileService.class,
|
||||
TorchUtils.hasTorch(context)
|
||||
PixelTorchFragment.hasTorch(context)
|
||||
);
|
||||
|
||||
// Saturation
|
||||
SaturationFragment.restoreSaturationSetting(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.about;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.preference.PreferenceFragment;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import org.evolution.pixelparts.R;
|
||||
|
||||
public class About extends PreferenceFragment
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
private static final String TAG = About.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.about);
|
||||
SharedPreferences prefs = getActivity().getSharedPreferences("about",
|
||||
Activity.MODE_PRIVATE);
|
||||
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
Context context = getContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -10,15 +10,15 @@ import android.os.Bundle;
|
||||
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
|
||||
import com.android.settingslib.widget.R;
|
||||
|
||||
public class AutoHBMActivity extends CollapsingToolbarBaseActivity {
|
||||
public class AutoHbmActivity extends CollapsingToolbarBaseActivity {
|
||||
|
||||
private static final String TAG = "AutoHBM";
|
||||
private static final String TAG = "AutoHbm";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getFragmentManager().beginTransaction().replace(R.id.content_frame,
|
||||
new AutoHBM(), TAG).commit();
|
||||
new AutoHbmFragment(), TAG).commit();
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.autohbm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.content.SharedPreferences;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.widget.Switch;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
@@ -22,15 +26,13 @@ import com.android.settingslib.widget.MainSwitchPreference;
|
||||
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
||||
import com.android.settingslib.widget.UsageProgressBarPreference;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import org.evolution.pixelparts.preferences.CustomSeekBarPreference;
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.CustomSeekBarPreference;
|
||||
import org.evolution.pixelparts.R;
|
||||
import org.evolution.pixelparts.utils.AutoHBMUtils;
|
||||
|
||||
public class AutoHBM extends PreferenceFragment
|
||||
public class AutoHbmFragment extends PreferenceFragment
|
||||
implements OnMainSwitchChangeListener, SensorEventListener, Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String TAG = AutoHBM.class.getSimpleName();
|
||||
private static final String[] AUTO_HBM_PREFERENCES = {
|
||||
Constants.KEY_AUTO_HBM_THRESHOLD,
|
||||
Constants.KEY_AUTO_HBM_ENABLE_TIME,
|
||||
@@ -38,40 +40,41 @@ public class AutoHBM extends PreferenceFragment
|
||||
Constants.KEY_CURRENT_LUX_LEVEL
|
||||
};
|
||||
|
||||
private CustomSeekBarPreference mAutoHBMThresholdPreference;
|
||||
private MainSwitchPreference mAutoHBMSwitch;
|
||||
private CustomSeekBarPreference mAutoHbmThresholdPreference;
|
||||
private MainSwitchPreference mAutoHbmSwitch;
|
||||
private SensorManager mSensorManager;
|
||||
private SharedPreferences mSharedPrefs;
|
||||
private Sensor mLightSensor;
|
||||
private UsageProgressBarPreference mCurrentLuxLevelPreference;
|
||||
private int mCurrentLux;
|
||||
|
||||
private static boolean mAutoHbmServiceEnabled = false;
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.autohbm);
|
||||
addPreferencesFromResource(R.xml.auto_hbm);
|
||||
|
||||
Context context = getContext();
|
||||
mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
mAutoHBMSwitch = findPreference(Constants.KEY_AUTO_HBM);
|
||||
mAutoHBMSwitch.setChecked(mSharedPrefs.getBoolean(Constants.KEY_AUTO_HBM, false));
|
||||
mAutoHBMSwitch.addOnSwitchChangeListener(this);
|
||||
mAutoHbmSwitch = findPreference(Constants.KEY_AUTO_HBM);
|
||||
mAutoHbmSwitch.setChecked(sharedPrefs.getBoolean(Constants.KEY_AUTO_HBM, false));
|
||||
mAutoHbmSwitch.addOnSwitchChangeListener(this);
|
||||
|
||||
mAutoHBMThresholdPreference = findPreference(Constants.KEY_AUTO_HBM_THRESHOLD);
|
||||
mAutoHBMThresholdPreference.setOnPreferenceChangeListener(this);
|
||||
mAutoHbmThresholdPreference = findPreference(Constants.KEY_AUTO_HBM_THRESHOLD);
|
||||
mAutoHbmThresholdPreference.setOnPreferenceChangeListener(this);
|
||||
|
||||
mCurrentLuxLevelPreference = findPreference(Constants.KEY_CURRENT_LUX_LEVEL);
|
||||
|
||||
mSensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
|
||||
mLightSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
|
||||
|
||||
toggleAutoHBMPreferencesVisibility(mAutoHBMSwitch.isChecked());
|
||||
toggleAutoHbmPreferencesVisibility(mAutoHbmSwitch.isChecked());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (mAutoHBMSwitch.isChecked()) {
|
||||
if (mAutoHbmSwitch.isChecked()) {
|
||||
mSensorManager.registerListener(this, mLightSensor, SensorManager.SENSOR_DELAY_NORMAL);
|
||||
}
|
||||
}
|
||||
@@ -79,16 +82,17 @@ public class AutoHBM extends PreferenceFragment
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if (mAutoHBMSwitch.isChecked()) {
|
||||
if (mAutoHbmSwitch.isChecked()) {
|
||||
mSensorManager.unregisterListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchChanged(Switch switchView, boolean isChecked) {
|
||||
mSharedPrefs.edit().putBoolean(Constants.KEY_AUTO_HBM, isChecked).apply();
|
||||
AutoHBMUtils.enableAutoHBM(getContext());
|
||||
toggleAutoHBMPreferencesVisibility(isChecked);
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
sharedPrefs.edit().putBoolean(Constants.KEY_AUTO_HBM, isChecked).apply();
|
||||
toggleAutoHbmService(getContext());
|
||||
toggleAutoHbmPreferencesVisibility(isChecked);
|
||||
|
||||
if (isChecked) {
|
||||
mSensorManager.registerListener(this, mLightSensor, SensorManager.SENSOR_DELAY_NORMAL);
|
||||
@@ -99,9 +103,9 @@ public class AutoHBM extends PreferenceFragment
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (preference == mAutoHBMThresholdPreference && mCurrentLuxLevelPreference != null) {
|
||||
if (preference == mAutoHbmThresholdPreference && mCurrentLuxLevelPreference != null) {
|
||||
int threshold = (int) newValue;
|
||||
updateCurrentLuxLevelPreference(mCurrentLux, threshold);
|
||||
updateCurrentLuxLevelPreference(mCurrentLux, threshold);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -109,10 +113,11 @@ public class AutoHBM extends PreferenceFragment
|
||||
|
||||
@Override
|
||||
public void onSensorChanged(SensorEvent event) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
if (event.sensor.getType() == Sensor.TYPE_LIGHT && mCurrentLuxLevelPreference != null) {
|
||||
float luxValue = event.values[0];
|
||||
mCurrentLux = (int) luxValue;
|
||||
int threshold = mSharedPrefs.getInt(Constants.KEY_AUTO_HBM_THRESHOLD, 20000);
|
||||
int threshold = sharedPrefs.getInt(Constants.KEY_AUTO_HBM_THRESHOLD, 20000);
|
||||
updateCurrentLuxLevelPreference(mCurrentLux, threshold);
|
||||
}
|
||||
}
|
||||
@@ -135,7 +140,7 @@ public class AutoHBM extends PreferenceFragment
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleAutoHBMPreferencesVisibility(boolean show) {
|
||||
private void toggleAutoHbmPreferencesVisibility(boolean show) {
|
||||
for (String prefKey : AUTO_HBM_PREFERENCES) {
|
||||
Preference pref = findPreference(prefKey);
|
||||
if (pref != null) {
|
||||
@@ -144,7 +149,40 @@ public class AutoHBM extends PreferenceFragment
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isAutoHBMEnabled(Context context) {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(Constants.KEY_AUTO_HBM, false);
|
||||
public static void toggleAutoHbmService(Context context) {
|
||||
if (isHbmSupported(context)) {
|
||||
boolean isAutoHbmEnabled = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.getBoolean(Constants.KEY_AUTO_HBM, false);
|
||||
|
||||
if (isAutoHbmEnabled && !mAutoHbmServiceEnabled) {
|
||||
startAutoHbmService(context);
|
||||
} else if (!isAutoHbmEnabled && mAutoHbmServiceEnabled) {
|
||||
stopAutoHbmService(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void startAutoHbmService(Context context) {
|
||||
context.startServiceAsUser(new Intent(context, AutoHbmService.class),
|
||||
UserHandle.CURRENT);
|
||||
mAutoHbmServiceEnabled = true;
|
||||
}
|
||||
|
||||
private static void stopAutoHbmService(Context context) {
|
||||
mAutoHbmServiceEnabled = false;
|
||||
context.stopServiceAsUser(new Intent(context, AutoHbmService.class),
|
||||
UserHandle.CURRENT);
|
||||
}
|
||||
|
||||
public static boolean isHbmSupported(Context context) {
|
||||
String[] UnsupportedHbmDevicesArray = context.getResources().getStringArray(R.array.unsupported_hbm_devices);
|
||||
String deviceCodename = Build.PRODUCT;
|
||||
|
||||
for (String device : UnsupportedHbmDevicesArray) {
|
||||
if (deviceCodename.equals(device)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.evolution.pixelparts.services;
|
||||
package org.evolution.pixelparts.autohbm;
|
||||
|
||||
import android.app.KeyguardManager;
|
||||
import android.app.Service;
|
||||
@@ -19,12 +19,12 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
|
||||
public class AutoHBMService extends Service {
|
||||
public class AutoHbmService extends Service {
|
||||
|
||||
private static boolean mAutoHBMActive = false;
|
||||
private static boolean mAutoHbmActive = false;
|
||||
private ExecutorService mExecutorService;
|
||||
|
||||
private SensorManager mSensorManager;
|
||||
@@ -43,12 +43,12 @@ public class AutoHBMService extends Service {
|
||||
public void deactivateLightSensorRead() {
|
||||
submit(() -> {
|
||||
mSensorManager.unregisterListener(mSensorEventListener);
|
||||
mAutoHBMActive = false;
|
||||
enableHBM(false);
|
||||
mAutoHbmActive = false;
|
||||
enableHbm(false);
|
||||
});
|
||||
}
|
||||
|
||||
private void enableHBM(boolean enable) {
|
||||
private void enableHbm(boolean enable) {
|
||||
if (enable) {
|
||||
FileUtils.writeValue(Constants.NODE_HBM, "1");
|
||||
} else {
|
||||
@@ -73,8 +73,8 @@ public class AutoHBMService extends Service {
|
||||
(KeyguardManager) getSystemService(getApplicationContext().KEYGUARD_SERVICE);
|
||||
boolean keyguardShowing = km.inKeyguardRestrictedInputMode();
|
||||
int luxThreshold = mSharedPrefs.getInt(Constants.KEY_AUTO_HBM_THRESHOLD, 20000);
|
||||
int timeToEnableHBM = mSharedPrefs.getInt(Constants.KEY_AUTO_HBM_ENABLE_TIME, 0);
|
||||
int timeToDisableHBM = mSharedPrefs.getInt(Constants.KEY_AUTO_HBM_DISABLE_TIME, 1);
|
||||
int timeToEnableHbm = mSharedPrefs.getInt(Constants.KEY_AUTO_HBM_ENABLE_TIME, 0);
|
||||
int timeToDisableHbm = mSharedPrefs.getInt(Constants.KEY_AUTO_HBM_DISABLE_TIME, 1);
|
||||
|
||||
if (lux > luxThreshold) {
|
||||
if (!mCrossedThreshold) {
|
||||
@@ -82,20 +82,20 @@ public class AutoHBMService extends Service {
|
||||
mCrossedThresholdTime = System.currentTimeMillis();
|
||||
} else {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
if (currentTime - mCrossedThresholdTime >= timeToEnableHBM * 1000 && (!mAutoHBMActive || !isCurrentlyEnabled()) && !keyguardShowing) {
|
||||
mAutoHBMActive = true;
|
||||
enableHBM(true);
|
||||
if (currentTime - mCrossedThresholdTime >= timeToEnableHbm * 1000 && (!mAutoHbmActive || !isCurrentlyEnabled()) && !keyguardShowing) {
|
||||
mAutoHbmActive = true;
|
||||
enableHbm(true);
|
||||
mLastTriggerTime = currentTime;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mCrossedThreshold = false;
|
||||
|
||||
if (mAutoHBMActive) {
|
||||
if (mAutoHbmActive) {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
if (currentTime - mLastTriggerTime >= timeToDisableHBM * 1000) {
|
||||
mAutoHBMActive = false;
|
||||
enableHBM(false);
|
||||
if (currentTime - mLastTriggerTime >= timeToDisableHbm * 1000) {
|
||||
mAutoHbmActive = false;
|
||||
enableHbm(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.services;
|
||||
package org.evolution.pixelparts.autohbm;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.R;
|
||||
import org.evolution.pixelparts.utils.AutoHBMUtils;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
|
||||
public class AutoHBMTileService extends TileService {
|
||||
|
||||
private void updateTile(boolean enabled) {
|
||||
final Tile tile = getQsTile();
|
||||
if (FileUtils.isFileWritable(Constants.NODE_HBM)) {
|
||||
tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
String subtitle = enabled ? getString(R.string.tile_on) : getString(R.string.tile_off);
|
||||
tile.setSubtitle(subtitle);
|
||||
tile.updateTile();
|
||||
} else {
|
||||
tile.setState(Tile.STATE_UNAVAILABLE);
|
||||
}
|
||||
tile.updateTile();
|
||||
}
|
||||
public class AutoHbmTileService extends TileService {
|
||||
|
||||
@Override
|
||||
public void onStartListening() {
|
||||
@@ -48,7 +34,15 @@ public class AutoHBMTileService extends TileService {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
final boolean enabled = !(sharedPrefs.getBoolean(Constants.KEY_AUTO_HBM, false));
|
||||
sharedPrefs.edit().putBoolean(Constants.KEY_AUTO_HBM, enabled).commit();
|
||||
AutoHBMUtils.enableAutoHBM(this);
|
||||
AutoHbmFragment.toggleAutoHbmService(this);
|
||||
updateTile(enabled);
|
||||
}
|
||||
|
||||
private void updateTile(boolean enabled) {
|
||||
final Tile tile = getQsTile();
|
||||
tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
String subtitle = enabled ? getString(R.string.tile_on) : getString(R.string.tile_off);
|
||||
tile.setSubtitle(subtitle);
|
||||
tile.updateTile();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,6 @@ public class BatteryInfoActivity extends CollapsingToolbarBaseActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getFragmentManager().beginTransaction().replace(R.id.content_frame,
|
||||
new BatteryInfo(), TAG).commit();
|
||||
new BatteryInfoFragment(), TAG).commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,6 @@ package org.evolution.pixelparts.batteryinfo;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -15,20 +14,18 @@ import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.preference.Preference.OnPreferenceClickListener;
|
||||
|
||||
import androidx.preference.PreferenceFragment;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.SwitchPreference;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.R;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
|
||||
public class BatteryInfo extends PreferenceFragment
|
||||
public class BatteryInfoFragment extends PreferenceFragment
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
private static final String TAG = BatteryInfo.class.getSimpleName();
|
||||
|
||||
private Handler mHandler;
|
||||
private Runnable mUpdateRunnable;
|
||||
@@ -49,9 +46,7 @@ public class BatteryInfo extends PreferenceFragment
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.batteryinfo);
|
||||
SharedPreferences prefs = getActivity().getSharedPreferences("batteryinfo",
|
||||
Activity.MODE_PRIVATE);
|
||||
addPreferencesFromResource(R.xml.battery_info);
|
||||
|
||||
mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
Context context = getContext();
|
||||
@@ -107,7 +102,7 @@ public class BatteryInfo extends PreferenceFragment
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
inflater.inflate(R.menu.batteryinfo_menu, menu);
|
||||
inflater.inflate(R.menu.battery_info_menu, menu);
|
||||
menu.findItem(R.id.temperature_unit).setChecked(mSharedPrefs.getBoolean(Constants.KEY_TEMPERATURE_UNIT, false));
|
||||
menu.findItem(R.id.battery_info_refresh).setChecked(mSharedPrefs.getBoolean(Constants.KEY_BATTERY_INFO_REFRESH, false));
|
||||
}
|
||||
@@ -116,17 +111,12 @@ public class BatteryInfo extends PreferenceFragment
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
boolean isChecked = !item.isChecked();
|
||||
item.setChecked(isChecked);
|
||||
|
||||
if (item.getItemId() == R.id.temperature_unit) {
|
||||
mSharedPrefs.edit().putBoolean(Constants.KEY_TEMPERATURE_UNIT, isChecked).apply();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.battery_info_refresh) {
|
||||
mSharedPrefs.edit().putBoolean(Constants.KEY_BATTERY_INFO_REFRESH, isChecked).apply();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.launch_battery_usage) {
|
||||
Intent intent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} else {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
@@ -137,19 +127,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
if (FileUtils.isFileReadable(Constants.NODE_TECHNOLOGY)) {
|
||||
String fileValue = FileUtils.getFileValue(Constants.NODE_TECHNOLOGY, null);
|
||||
mTechnologyPreference.setSummary(fileValue);
|
||||
|
||||
mTechnologyPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.technology_info_title))
|
||||
.setMessage(getString(R.string.technology_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mTechnologyPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mTechnologyPreference.setEnabled(false);
|
||||
@@ -160,19 +137,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
String fileValue = FileUtils.getFileValue(Constants.NODE_STATUS, null);
|
||||
int statusStringResourceId = getStatusStringResourceId(fileValue);
|
||||
mStatusPreference.setSummary(getString(statusStringResourceId));
|
||||
|
||||
mStatusPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.status_info_title))
|
||||
.setMessage(getString(R.string.status_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mStatusPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mStatusPreference.setEnabled(false);
|
||||
@@ -183,19 +147,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
String fileValue = FileUtils.getFileValue(Constants.NODE_USB_TYPE, null);
|
||||
int usbTypeStringResourceId = getUSBTypeStringResourceId(fileValue);
|
||||
mUSBTypePreference.setSummary(getString(usbTypeStringResourceId));
|
||||
|
||||
mUSBTypePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.usb_type_info_title))
|
||||
.setMessage(getString(R.string.usb_type_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mUSBTypePreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mUSBTypePreference.setEnabled(false);
|
||||
@@ -214,19 +165,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
float roundedTemperatureCelsius = Math.round(temperatureCelsius * 10) / 10.0f;
|
||||
mTemperaturePreference.setSummary(roundedTemperatureCelsius + "°C");
|
||||
}
|
||||
|
||||
mTemperaturePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.temperature_info_title))
|
||||
.setMessage(getString(R.string.temperature_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mTemperaturePreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mTemperaturePreference.setEnabled(false);
|
||||
@@ -236,19 +174,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
if (FileUtils.isFileReadable(Constants.NODE_CAPACITY)) {
|
||||
String fileValue = FileUtils.getFileValue(Constants.NODE_CAPACITY, null);
|
||||
mCapacityPreference.setSummary(fileValue + "%");
|
||||
|
||||
mCapacityPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.capacity_info_title))
|
||||
.setMessage(getString(R.string.capacity_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mCapacityPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mCapacityPreference.setEnabled(false);
|
||||
@@ -259,19 +184,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
String fileValue = FileUtils.getFileValue(Constants.NODE_CAPACITY_LEVEL, null);
|
||||
int capacityLevelStringResourceId = geCapacityLevelStringResourceId(fileValue);
|
||||
mCapacityLevelPreference.setSummary(getString(capacityLevelStringResourceId));
|
||||
|
||||
mCapacityLevelPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.capacity_level_info_title))
|
||||
.setMessage(getString(R.string.capacity_level_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mCapacityLevelPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mCapacityLevelPreference.setEnabled(false);
|
||||
@@ -284,19 +196,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
int absoluteChargingCurrent = Math.abs(chargingCurrent);
|
||||
String formattedChargingCurrent = (absoluteChargingCurrent / 1000) + "mA";
|
||||
mCurrentPreference.setSummary(formattedChargingCurrent);
|
||||
|
||||
mCurrentPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.current_info_title))
|
||||
.setMessage(getString(R.string.current_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mCurrentPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mCurrentPreference.setEnabled(false);
|
||||
@@ -308,19 +207,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
float chargingVoltage = Float.parseFloat(fileValue);
|
||||
String formattedChargingVoltage = String.format("%.1f", (chargingVoltage / 1000000)) + "V";
|
||||
mVoltagePreference.setSummary(formattedChargingVoltage);
|
||||
|
||||
mVoltagePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.voltage_info_title))
|
||||
.setMessage(getString(R.string.voltage_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mVoltagePreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mVoltagePreference.setEnabled(false);
|
||||
@@ -336,19 +222,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
float absoluteWattage = Math.abs(wattage);
|
||||
String formattedWattage = String.format("%.1f", absoluteWattage) + "W";
|
||||
mWattagePreference.setSummary(formattedWattage);
|
||||
|
||||
mWattagePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.wattage_info_title))
|
||||
.setMessage(getString(R.string.wattage_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mWattagePreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mWattagePreference.setEnabled(false);
|
||||
@@ -359,19 +232,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
String fileValue = FileUtils.getFileValue(Constants.NODE_HEALTH, null);
|
||||
int healthStringResourceId = getHealthStringResourceId(fileValue);
|
||||
mHealthPreference.setSummary(getString(healthStringResourceId));
|
||||
|
||||
mHealthPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.health_info_title))
|
||||
.setMessage(getString(R.string.health_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mHealthPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mHealthPreference.setEnabled(false);
|
||||
@@ -381,19 +241,6 @@ public class BatteryInfo extends PreferenceFragment
|
||||
if (FileUtils.isFileReadable(Constants.NODE_CYCLE_COUNT)) {
|
||||
String fileValue = FileUtils.getFileValue(Constants.NODE_CYCLE_COUNT, null);
|
||||
mCycleCountPreference.setSummary(fileValue);
|
||||
|
||||
mCycleCountPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(getString(R.string.cycle_count_title))
|
||||
.setMessage(getString(R.string.cycle_count_info_message))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
mCycleCountPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mCycleCountPreference.setEnabled(false);
|
||||
@@ -414,7 +261,7 @@ public class BatteryInfo extends PreferenceFragment
|
||||
case "Full":
|
||||
return R.string.status_full;
|
||||
default:
|
||||
return R.string.kernel_node_access_error;
|
||||
return R.string.kernel_node_returned_value_unknown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +276,7 @@ public class BatteryInfo extends PreferenceFragment
|
||||
} else if (usbType.contains("[DCP]")) {
|
||||
return R.string.usb_type_dedicated_charging_port;
|
||||
} else {
|
||||
return R.string.kernel_node_access_error;
|
||||
return R.string.kernel_node_returned_value_unknown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +296,7 @@ public class BatteryInfo extends PreferenceFragment
|
||||
case "Full":
|
||||
return R.string.capacity_level_full;
|
||||
default:
|
||||
return R.string.kernel_node_access_error;
|
||||
return R.string.kernel_node_returned_value_unknown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,7 +332,7 @@ public class BatteryInfo extends PreferenceFragment
|
||||
case "Hot":
|
||||
return R.string.health_hot;
|
||||
default:
|
||||
return R.string.kernel_node_access_error;
|
||||
return R.string.kernel_node_returned_value_unknown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.services;
|
||||
package org.evolution.pixelparts.batteryinfo;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
|
||||
import org.evolution.pixelparts.batteryinfo.BatteryInfoActivity;
|
||||
|
||||
public class BatteryInfoTileService extends TileService {
|
||||
|
||||
private void updateTile() {
|
||||
final Tile tile = getQsTile();
|
||||
tile.setState(Tile.STATE_ACTIVE);
|
||||
tile.updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartListening() {
|
||||
super.onStartListening();
|
||||
@@ -39,4 +31,10 @@ public class BatteryInfoTileService extends TileService {
|
||||
);
|
||||
startActivityAndCollapse(pendingIntent);
|
||||
}
|
||||
|
||||
private void updateTile() {
|
||||
final Tile tile = getQsTile();
|
||||
tile.setState(Tile.STATE_ACTIVE);
|
||||
tile.updateTile();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.chargecontrol;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
|
||||
import com.android.settingslib.widget.R;
|
||||
|
||||
public class ChargeControlActivity extends CollapsingToolbarBaseActivity {
|
||||
|
||||
private static final String TAG = "ChargeControl";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getFragmentManager().beginTransaction().replace(R.id.content_frame,
|
||||
new ChargeControlFragment(), TAG).commit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.chargecontrol;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Switch;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragment;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.android.settingslib.widget.MainSwitchPreference;
|
||||
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
||||
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.CustomSeekBarPreference;
|
||||
import org.evolution.pixelparts.R;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
|
||||
public class ChargeControlFragment extends PreferenceFragment
|
||||
implements OnMainSwitchChangeListener, Preference.OnPreferenceChangeListener {
|
||||
|
||||
// Charge control preference
|
||||
private MainSwitchPreference mChargeControlSwitch;
|
||||
|
||||
// Stop/Start preferences
|
||||
private CustomSeekBarPreference mStopChargingPreference;
|
||||
private CustomSeekBarPreference mStartChargingPreference;
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.charge_control);
|
||||
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
// Charge control preference
|
||||
mChargeControlSwitch = findPreference(Constants.KEY_CHARGE_CONTROL);
|
||||
mChargeControlSwitch.setChecked(sharedPrefs.getBoolean(Constants.KEY_CHARGE_CONTROL, false));
|
||||
mChargeControlSwitch.addOnSwitchChangeListener(this);
|
||||
|
||||
// Stop preference
|
||||
mStopChargingPreference = findPreference(Constants.KEY_STOP_CHARGING);
|
||||
if (FileUtils.isFileWritable(Constants.NODE_STOP_CHARGING)) {
|
||||
mStopChargingPreference.setValue(sharedPrefs.getInt(Constants.KEY_STOP_CHARGING,
|
||||
Integer.parseInt(FileUtils.getFileValue(Constants.NODE_STOP_CHARGING, Constants.DEFAULT_STOP_CHARGING))));
|
||||
mStopChargingPreference.setOnPreferenceChangeListener(this);
|
||||
} else {
|
||||
mStopChargingPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mStopChargingPreference.setEnabled(false);
|
||||
}
|
||||
mStopChargingPreference.setVisible(mChargeControlSwitch.isChecked());
|
||||
|
||||
// Start preference
|
||||
mStartChargingPreference = findPreference(Constants.KEY_START_CHARGING);
|
||||
if (FileUtils.isFileWritable(Constants.NODE_START_CHARGING)) {
|
||||
mStartChargingPreference.setValue(sharedPrefs.getInt(Constants.KEY_START_CHARGING,
|
||||
Integer.parseInt(FileUtils.getFileValue(Constants.NODE_START_CHARGING, Constants.DEFAULT_START_CHARGING))));
|
||||
mStartChargingPreference.setOnPreferenceChangeListener(this);
|
||||
} else {
|
||||
mStartChargingPreference.setSummary(getString(R.string.kernel_node_access_error));
|
||||
mStartChargingPreference.setEnabled(false);
|
||||
}
|
||||
mStartChargingPreference.setVisible(mChargeControlSwitch.isChecked());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchChanged(Switch switchView, boolean isChecked) {
|
||||
SharedPreferences.Editor prefChange = PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
|
||||
|
||||
prefChange.putBoolean(Constants.KEY_CHARGE_CONTROL, isChecked).apply();
|
||||
|
||||
mStopChargingPreference.setVisible(isChecked);
|
||||
mStartChargingPreference.setVisible(isChecked);
|
||||
|
||||
if (!isChecked) {
|
||||
// Stop preference
|
||||
int defaultStopCharging = 100;
|
||||
prefChange.putInt(Constants.KEY_STOP_CHARGING, defaultStopCharging).apply();
|
||||
FileUtils.writeValue(Constants.NODE_STOP_CHARGING, Integer.toString(defaultStopCharging));
|
||||
mStopChargingPreference.refresh(defaultStopCharging);
|
||||
|
||||
// Start preference
|
||||
int defaultStartCharging = 0;
|
||||
prefChange.putInt(Constants.KEY_START_CHARGING, defaultStartCharging).apply();
|
||||
FileUtils.writeValue(Constants.NODE_START_CHARGING, Integer.toString(defaultStartCharging));
|
||||
mStartChargingPreference.refresh(defaultStartCharging);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
// Stop preference
|
||||
if (preference == mStopChargingPreference) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
int value = Integer.parseInt(newValue.toString());
|
||||
int stopLevel = Integer.parseInt(newValue.toString());
|
||||
int startLevel = sharedPrefs.getInt(Constants.KEY_START_CHARGING, 0);
|
||||
if (startLevel >= stopLevel) {
|
||||
startLevel = stopLevel - 1;
|
||||
sharedPrefs.edit().putInt(Constants.KEY_START_CHARGING, startLevel).apply();
|
||||
FileUtils.writeValue(Constants.NODE_START_CHARGING, String.valueOf(startLevel));
|
||||
mStartChargingPreference.refresh(startLevel);
|
||||
Toast.makeText(getContext(), R.string.stop_below_start_error, Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
sharedPrefs.edit().putInt(Constants.KEY_STOP_CHARGING, value).apply();
|
||||
FileUtils.writeValue(Constants.NODE_STOP_CHARGING, String.valueOf(value));
|
||||
return true;
|
||||
}
|
||||
// Start preference
|
||||
else if (preference == mStartChargingPreference) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
int value = Integer.parseInt(newValue.toString());
|
||||
int startLevel = Integer.parseInt(newValue.toString());
|
||||
int stopLevel = sharedPrefs.getInt(Constants.KEY_STOP_CHARGING, 100);
|
||||
if (stopLevel <= startLevel) {
|
||||
stopLevel = startLevel + 1;
|
||||
sharedPrefs.edit().putInt(Constants.KEY_STOP_CHARGING, stopLevel).apply();
|
||||
FileUtils.writeValue(Constants.NODE_STOP_CHARGING, String.valueOf(stopLevel));
|
||||
mStopChargingPreference.refresh(stopLevel);
|
||||
Toast.makeText(getContext(), R.string.start_above_stop_error, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
sharedPrefs.edit().putInt(Constants.KEY_START_CHARGING, value).apply();
|
||||
FileUtils.writeValue(Constants.NODE_START_CHARGING, String.valueOf(value));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Stop preference
|
||||
public static void restoreStopChargingSetting(Context context) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean chargeControlEnabled = sharedPrefs.getBoolean(Constants.KEY_CHARGE_CONTROL, true);
|
||||
|
||||
if (chargeControlEnabled && FileUtils.isFileWritable(Constants.NODE_STOP_CHARGING)) {
|
||||
int value = sharedPrefs.getInt(Constants.KEY_STOP_CHARGING,
|
||||
Integer.parseInt(FileUtils.getFileValue(Constants.NODE_STOP_CHARGING, Constants.DEFAULT_STOP_CHARGING)));
|
||||
FileUtils.writeValue(Constants.NODE_STOP_CHARGING, String.valueOf(value));
|
||||
}
|
||||
}
|
||||
|
||||
// Start preference
|
||||
public static void restoreStartChargingSetting(Context context) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean chargeControlEnabled = sharedPrefs.getBoolean(Constants.KEY_CHARGE_CONTROL, true);
|
||||
|
||||
if (chargeControlEnabled && FileUtils.isFileWritable(Constants.NODE_START_CHARGING)) {
|
||||
int value = sharedPrefs.getInt(Constants.KEY_START_CHARGING,
|
||||
Integer.parseInt(FileUtils.getFileValue(Constants.NODE_START_CHARGING, Constants.DEFAULT_START_CHARGING)));
|
||||
FileUtils.writeValue(Constants.NODE_START_CHARGING, String.valueOf(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.about;
|
||||
package org.evolution.pixelparts.fastcharge;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
|
||||
import com.android.settingslib.widget.R;
|
||||
|
||||
public class AboutActivity extends CollapsingToolbarBaseActivity {
|
||||
public class FastChargeActivity extends CollapsingToolbarBaseActivity {
|
||||
|
||||
private static final String TAG = "About";
|
||||
private static final String TAG = "FastCharge";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getFragmentManager().beginTransaction().replace(R.id.content_frame,
|
||||
new About(), TAG).commit();
|
||||
new FastChargeFragment(), TAG).commit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.fastcharge;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Switch;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragment;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.android.settingslib.widget.MainSwitchPreference;
|
||||
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
||||
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.R;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
|
||||
public class FastChargeFragment extends PreferenceFragment
|
||||
implements OnMainSwitchChangeListener {
|
||||
|
||||
private MainSwitchPreference mFastChargeSwitch;
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.fast_charge);
|
||||
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
mFastChargeSwitch = findPreference(Constants.KEY_FAST_CHARGE);
|
||||
mFastChargeSwitch.setChecked(sharedPrefs.getBoolean(Constants.KEY_FAST_CHARGE, false));
|
||||
mFastChargeSwitch.addOnSwitchChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchChanged(Switch switchView, boolean isChecked) {
|
||||
SharedPreferences.Editor prefChange = PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
|
||||
prefChange.putBoolean(Constants.KEY_FAST_CHARGE, isChecked).apply();
|
||||
if (FileUtils.isFileWritable(Constants.NODE_FAST_CHARGE)) {
|
||||
FileUtils.writeValue(Constants.NODE_FAST_CHARGE, isChecked ? "1" : "0");
|
||||
}
|
||||
}
|
||||
|
||||
public static void restoreFastChargeSetting(Context context) {
|
||||
if (FileUtils.isFileWritable(Constants.NODE_FAST_CHARGE)) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean value = sharedPrefs.getBoolean(Constants.KEY_FAST_CHARGE, false);
|
||||
FileUtils.writeValue(Constants.NODE_FAST_CHARGE, value ? "1" : "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.services;
|
||||
package org.evolution.pixelparts.fastcharge;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.R;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
|
||||
public class USB2FCTileService extends TileService {
|
||||
|
||||
private void updateTile(boolean enabled) {
|
||||
final Tile tile = getQsTile();
|
||||
if (FileUtils.isFileWritable(Constants.NODE_USB2_FAST_CHARGE)) {
|
||||
tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
String subtitle = enabled ? getString(R.string.tile_on) : getString(R.string.tile_off);
|
||||
tile.setSubtitle(subtitle);
|
||||
tile.updateTile();
|
||||
} else {
|
||||
tile.setState(Tile.STATE_UNAVAILABLE);
|
||||
}
|
||||
tile.updateTile();
|
||||
}
|
||||
public class FastChargeTileService extends TileService {
|
||||
|
||||
@Override
|
||||
public void onStartListening() {
|
||||
super.onStartListening();
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
updateTile(sharedPrefs.getBoolean(Constants.KEY_USB2_FAST_CHARGE, false));
|
||||
updateTile(sharedPrefs.getBoolean(Constants.KEY_FAST_CHARGE, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,9 +32,17 @@ public class USB2FCTileService extends TileService {
|
||||
public void onClick() {
|
||||
super.onClick();
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
final boolean enabled = !(sharedPrefs.getBoolean(Constants.KEY_USB2_FAST_CHARGE, false));
|
||||
FileUtils.writeValue(Constants.NODE_USB2_FAST_CHARGE, enabled ? "1" : "0");
|
||||
sharedPrefs.edit().putBoolean(Constants.KEY_USB2_FAST_CHARGE, enabled).commit();
|
||||
final boolean enabled = !(sharedPrefs.getBoolean(Constants.KEY_FAST_CHARGE, false));
|
||||
FileUtils.writeValue(Constants.NODE_FAST_CHARGE, enabled ? "1" : "0");
|
||||
sharedPrefs.edit().putBoolean(Constants.KEY_FAST_CHARGE, enabled).commit();
|
||||
updateTile(enabled);
|
||||
}
|
||||
|
||||
private void updateTile(boolean enabled) {
|
||||
final Tile tile = getQsTile();
|
||||
tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
String subtitle = enabled ? getString(R.string.tile_on) : getString(R.string.tile_off);
|
||||
tile.setSubtitle(subtitle);
|
||||
tile.updateTile();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.pixeltorch;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
|
||||
import com.android.settingslib.widget.R;
|
||||
|
||||
public class PixelTorchActivity extends CollapsingToolbarBaseActivity {
|
||||
|
||||
private static final String TAG = "PixelTorch";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getFragmentManager().beginTransaction().replace(R.id.content_frame,
|
||||
new PixelTorchFragment(), TAG).commit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.pixeltorch;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragment;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.evolution.pixelparts.R;
|
||||
|
||||
public class PixelTorchFragment extends PreferenceFragment
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.pixel_torch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean hasTorch(Context context) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
return packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.services;
|
||||
package org.evolution.pixelparts.pixeltorch;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.hardware.camera2.CameraAccessException;
|
||||
import android.hardware.camera2.CameraManager;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.R;
|
||||
|
||||
public class PixelTorchTileService extends TileService {
|
||||
@@ -27,7 +28,6 @@ public class PixelTorchTileService extends TileService {
|
||||
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
cameraManager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
|
||||
registerTorchCallback();
|
||||
updateTile(Tile.STATE_INACTIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,6 +41,23 @@ public class PixelTorchTileService extends TileService {
|
||||
toggleTorch();
|
||||
}
|
||||
|
||||
private void registerTorchCallback() {
|
||||
torchCallback = new CameraManager.TorchCallback() {
|
||||
@Override
|
||||
public void onTorchModeChanged(String cameraId, boolean enabled) {
|
||||
super.onTorchModeChanged(cameraId, enabled);
|
||||
updateTile(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTorchModeUnavailable(String cameraId) {
|
||||
super.onTorchModeUnavailable(cameraId);
|
||||
updateTile(Tile.STATE_UNAVAILABLE);
|
||||
}
|
||||
};
|
||||
cameraManager.registerTorchCallback(torchCallback, null);
|
||||
}
|
||||
|
||||
private void toggleTorch() {
|
||||
try {
|
||||
String outCameraId = cameraManager.getCameraIdList()[0];
|
||||
@@ -66,7 +83,7 @@ public class PixelTorchTileService extends TileService {
|
||||
|
||||
private void turnOnTorch(String outCameraId) {
|
||||
try {
|
||||
int torchStrength = sharedPrefs.getInt(Constants.KEY_TORCH_STRENGTH, 45);
|
||||
int torchStrength = sharedPrefs.getInt(Constants.KEY_PIXEL_TORCH_STRENGTH, 45);
|
||||
if (torchStrength != 0) {
|
||||
cameraManager.turnOnTorchWithStrengthLevel(outCameraId, torchStrength);
|
||||
}
|
||||
@@ -76,25 +93,18 @@ public class PixelTorchTileService extends TileService {
|
||||
updateTile(Tile.STATE_ACTIVE);
|
||||
}
|
||||
|
||||
private void registerTorchCallback() {
|
||||
torchCallback = new CameraManager.TorchCallback() {
|
||||
@Override
|
||||
public void onTorchModeChanged(String cameraId, boolean enabled) {
|
||||
super.onTorchModeChanged(cameraId, enabled);
|
||||
updateTile(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
}
|
||||
};
|
||||
cameraManager.registerTorchCallback(torchCallback, null);
|
||||
}
|
||||
|
||||
private void updateTile(int state) {
|
||||
Tile qsTile = getQsTile();
|
||||
if (qsTile != null) {
|
||||
if (state == Tile.STATE_UNAVAILABLE) {
|
||||
qsTile.setSubtitle(getString(R.string.tile_camera_in_use));
|
||||
} else {
|
||||
String subtitle = state == Tile.STATE_ACTIVE ?
|
||||
getString(R.string.tile_on) :
|
||||
getString(R.string.tile_off);
|
||||
qsTile.setSubtitle(subtitle);
|
||||
}
|
||||
qsTile.setState(state);
|
||||
String subtitle = state == Tile.STATE_ACTIVE ?
|
||||
getString(R.string.tile_on) :
|
||||
getString(R.string.tile_off);
|
||||
qsTile.setSubtitle(subtitle);
|
||||
qsTile.updateTile();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* 2018 Havoc-OS
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -27,8 +27,6 @@ public class SaturationActivity extends CollapsingToolbarBaseActivity {
|
||||
private LinearLayout mSliderDotsPanel;
|
||||
private ImageView[] mDots;
|
||||
|
||||
private Saturation mSaturationFragment;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -36,15 +34,8 @@ public class SaturationActivity extends CollapsingToolbarBaseActivity {
|
||||
|
||||
setupImageSlider();
|
||||
|
||||
Fragment fragment = getFragmentManager().findFragmentById(R.id.saturation);
|
||||
if (fragment == null) {
|
||||
mSaturationFragment = new Saturation();
|
||||
getFragmentManager().beginTransaction()
|
||||
.add(R.id.saturation, mSaturationFragment)
|
||||
.commit();
|
||||
} else {
|
||||
mSaturationFragment = (Saturation) fragment;
|
||||
}
|
||||
getFragmentManager().beginTransaction().replace(R.id.saturation,
|
||||
new SaturationFragment(), TAG).commit();
|
||||
}
|
||||
|
||||
private void setupImageSlider() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -15,13 +15,12 @@ import androidx.preference.PreferenceManager;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import org.evolution.pixelparts.preferences.CustomSeekBarPreference;
|
||||
import org.evolution.pixelparts.Constants;
|
||||
import org.evolution.pixelparts.CustomSeekBarPreference;
|
||||
import org.evolution.pixelparts.R;
|
||||
|
||||
public class Saturation extends PreferenceFragment
|
||||
public class SaturationFragment extends PreferenceFragment
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
private static final String TAG = Saturation.class.getSimpleName();
|
||||
|
||||
// Saturation preference
|
||||
private CustomSeekBarPreference mSaturationPreference;
|
||||
@@ -1,25 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.services;
|
||||
package org.evolution.pixelparts.saturation;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
|
||||
import org.evolution.pixelparts.saturation.SaturationActivity;
|
||||
|
||||
public class SaturationTileService extends TileService {
|
||||
|
||||
private void updateTile() {
|
||||
final Tile tile = getQsTile();
|
||||
tile.setState(Tile.STATE_ACTIVE);
|
||||
tile.updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartListening() {
|
||||
super.onStartListening();
|
||||
@@ -39,4 +31,10 @@ public class SaturationTileService extends TileService {
|
||||
);
|
||||
startActivityAndCollapse(pendingIntent);
|
||||
}
|
||||
|
||||
private void updateTile() {
|
||||
final Tile tile = getQsTile();
|
||||
tile.setState(Tile.STATE_ACTIVE);
|
||||
tile.updateTile();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Havoc-OS
|
||||
* 2023 The Evolution X Project
|
||||
* 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.services;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.IBinder;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
|
||||
public class HBMService extends Service {
|
||||
|
||||
private BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (action.equals(Intent.ACTION_SCREEN_OFF)) {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putBoolean(Constants.KEY_HBM, false);
|
||||
editor.commit();
|
||||
stopSelf();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
|
||||
registerReceiver(mReceiver, intentFilter);
|
||||
return START_REDELIVER_INTENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
unregisterReceiver(mReceiver);
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.services;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.evolution.pixelparts.misc.Constants;
|
||||
import org.evolution.pixelparts.R;
|
||||
import org.evolution.pixelparts.utils.FileUtils;
|
||||
|
||||
public class HBMTileService extends TileService {
|
||||
|
||||
private BroadcastReceiver screenStateReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
sharedPrefs.edit().putBoolean(Constants.KEY_HBM, false).commit();
|
||||
updateTile(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private void updateTile(boolean enabled) {
|
||||
final Tile tile = getQsTile();
|
||||
if (FileUtils.isFileWritable(Constants.NODE_HBM)) {
|
||||
tile.setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
String subtitle = enabled ? getString(R.string.tile_on) : getString(R.string.tile_off);
|
||||
tile.setSubtitle(subtitle);
|
||||
tile.updateTile();
|
||||
} else {
|
||||
tile.setState(Tile.STATE_UNAVAILABLE);
|
||||
}
|
||||
tile.updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
registerReceiver(screenStateReceiver, filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
unregisterReceiver(screenStateReceiver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartListening() {
|
||||
super.onStartListening();
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
updateTile(sharedPrefs.getBoolean(Constants.KEY_HBM, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopListening() {
|
||||
super.onStopListening();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick() {
|
||||
super.onClick();
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
final boolean enabled = !(sharedPrefs.getBoolean(Constants.KEY_HBM, false));
|
||||
FileUtils.writeValue(Constants.NODE_HBM, enabled ? "1" : "0");
|
||||
sharedPrefs.edit().putBoolean(Constants.KEY_HBM, enabled).commit();
|
||||
updateTile(enabled);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.services;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
|
||||
import org.evolution.pixelparts.PixelPartsActivity;
|
||||
|
||||
public class PixelPartsTileService extends TileService {
|
||||
|
||||
private void updateTile() {
|
||||
final Tile tile = getQsTile();
|
||||
tile.setState(Tile.STATE_ACTIVE);
|
||||
tile.updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartListening() {
|
||||
super.onStartListening();
|
||||
updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick() {
|
||||
super.onClick();
|
||||
Intent intent = new Intent(this, PixelPartsActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(
|
||||
this,
|
||||
0,
|
||||
intent,
|
||||
PendingIntent.FLAG_IMMUTABLE
|
||||
);
|
||||
startActivityAndCollapse(pendingIntent);
|
||||
}
|
||||
}
|
||||
@@ -1,357 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.uibench;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Message;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.FrameMetrics;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.Window.OnFrameMetricsAvailableListener;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.evolution.pixelparts.R;
|
||||
|
||||
public class JitterTestActivity extends Activity {
|
||||
private TextView mJitterReport;
|
||||
private TextView mUiFrameTimeReport;
|
||||
private TextView mRenderThreadTimeReport;
|
||||
private TextView mTotalFrameTimeReport;
|
||||
private TextView mMostlyTotalFrameTimeReport;
|
||||
private PointGraphView mGraph;
|
||||
|
||||
private static Handler sMetricsHandler;
|
||||
static {
|
||||
HandlerThread thread = new HandlerThread("frameMetricsListener");
|
||||
thread.start();
|
||||
sMetricsHandler = new Handler(thread.getLooper());
|
||||
}
|
||||
|
||||
private Handler mUpdateHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case R.id.jitter_mma:
|
||||
mJitterReport.setText((CharSequence) msg.obj);
|
||||
break;
|
||||
case R.id.totalish_mma:
|
||||
mMostlyTotalFrameTimeReport.setText((CharSequence) msg.obj);
|
||||
break;
|
||||
case R.id.ui_frametime_mma:
|
||||
mUiFrameTimeReport.setText((CharSequence) msg.obj);
|
||||
break;
|
||||
case R.id.rt_frametime_mma:
|
||||
mRenderThreadTimeReport.setText((CharSequence) msg.obj);
|
||||
break;
|
||||
case R.id.total_mma:
|
||||
mTotalFrameTimeReport.setText((CharSequence) msg.obj);
|
||||
break;
|
||||
case R.id.graph:
|
||||
mGraph.addJitterSample(msg.arg1, msg.arg2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.rendering_jitter);
|
||||
View content = findViewById(android.R.id.content);
|
||||
content.setBackground(new AnimatedBackgroundDrawable());
|
||||
content.setKeepScreenOn(true);
|
||||
mJitterReport = findViewById(R.id.jitter_mma);
|
||||
mMostlyTotalFrameTimeReport = findViewById(R.id.totalish_mma);
|
||||
mUiFrameTimeReport = findViewById(R.id.ui_frametime_mma);
|
||||
mRenderThreadTimeReport = findViewById(R.id.rt_frametime_mma);
|
||||
mTotalFrameTimeReport = findViewById(R.id.total_mma);
|
||||
mGraph = findViewById(R.id.graph);
|
||||
mJitterReport.setText("abcdefghijklmnopqrstuvwxyz");
|
||||
mMostlyTotalFrameTimeReport.setText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
mUiFrameTimeReport.setText("0123456789");
|
||||
mRenderThreadTimeReport.setText(",.!()[]{};");
|
||||
getWindow().addOnFrameMetricsAvailableListener(mMetricsListener, sMetricsHandler);
|
||||
}
|
||||
|
||||
public static final class PointGraphView extends View {
|
||||
private static final float[] JITTER_LINES_MS = {
|
||||
.5f, 1.0f, 1.5f, 2.0f, 3.0f, 4.0f, 5.0f
|
||||
};
|
||||
private static final String[] JITTER_LINES_LABELS = makeLabels(JITTER_LINES_MS);
|
||||
private static final int[] JITTER_LINES_COLORS = new int[] {
|
||||
0xFF00E676, 0xFFFFF176, 0xFFFDD835, 0xFFFBC02D, 0xFFF9A825,
|
||||
0xFFF57F17, 0xFFDD2C00
|
||||
};
|
||||
private Paint mPaint = new Paint();
|
||||
private float[] mJitterYs = new float[JITTER_LINES_MS.length];
|
||||
private float mLabelWidth;
|
||||
private float mLabelHeight;
|
||||
private float mDensity;
|
||||
private float mGraphScale;
|
||||
private float mGraphMaxMs;
|
||||
|
||||
private float[] mJitterPoints;
|
||||
private float[] mJitterAvgPoints;
|
||||
|
||||
public PointGraphView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
setWillNotDraw(false);
|
||||
mDensity = context.getResources().getDisplayMetrics().density;
|
||||
mPaint.setTextSize(dp(10));
|
||||
Rect textBounds = new Rect();
|
||||
mPaint.getTextBounds("8.8", 0, 3, textBounds);
|
||||
mLabelWidth = textBounds.width() + dp(2);
|
||||
mLabelHeight = textBounds.height();
|
||||
}
|
||||
|
||||
public void addJitterSample(int jitterUs, int jitterUsAvg) {
|
||||
for (int i = 1; i < mJitterPoints.length - 2; i += 2) {
|
||||
mJitterPoints[i] = mJitterPoints[i + 2];
|
||||
mJitterAvgPoints[i] = mJitterAvgPoints[i + 2];
|
||||
}
|
||||
mJitterPoints[mJitterPoints.length - 1] =
|
||||
getHeight() - mGraphScale * (jitterUs / 1000.0f);
|
||||
mJitterAvgPoints[mJitterAvgPoints.length - 1] =
|
||||
getHeight() - mGraphScale * (jitterUsAvg / 1000.0f);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
private float dp(float dp) {
|
||||
return mDensity * dp;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
canvas.drawColor(0x90000000);
|
||||
int h = getHeight();
|
||||
int w = getWidth();
|
||||
mPaint.setColor(Color.WHITE);
|
||||
mPaint.setStrokeWidth(dp(1));
|
||||
canvas.drawLine(mLabelWidth, 0, mLabelWidth, h, mPaint);
|
||||
for (int i = 0; i < JITTER_LINES_LABELS.length; i++) {
|
||||
canvas.drawText(JITTER_LINES_LABELS[i],
|
||||
0, (float) Math.floor(mJitterYs[i] + mLabelHeight * .5f), mPaint);
|
||||
}
|
||||
for (int i = 0; i < JITTER_LINES_LABELS.length; i++) {
|
||||
mPaint.setColor(JITTER_LINES_COLORS[i]);
|
||||
canvas.drawLine(mLabelWidth, mJitterYs[i], w, mJitterYs[i], mPaint);
|
||||
}
|
||||
mPaint.setStrokeWidth(dp(2));
|
||||
mPaint.setColor(Color.WHITE);
|
||||
canvas.drawPoints(mJitterPoints, mPaint);
|
||||
mPaint.setColor(0xFF2196F3);
|
||||
canvas.drawPoints(mJitterAvgPoints, mPaint);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
int graphWidth = (int) ((w - mLabelWidth - dp(1)) / mDensity);
|
||||
float[] oldJitterPoints = mJitterPoints;
|
||||
float[] oldJitterAvgPoints = mJitterAvgPoints;
|
||||
mJitterPoints = new float[graphWidth * 2];
|
||||
mJitterAvgPoints = new float[graphWidth * 2];
|
||||
for (int i = 0; i < mJitterPoints.length; i += 2) {
|
||||
mJitterPoints[i] = mLabelWidth + (i / 2 + 1) * mDensity;
|
||||
mJitterAvgPoints[i] = mJitterPoints[i];
|
||||
}
|
||||
if (oldJitterPoints != null) {
|
||||
int newIndexShift = Math.max(mJitterPoints.length - oldJitterPoints.length, 0);
|
||||
int oldIndexShift = oldJitterPoints.length - mJitterPoints.length;
|
||||
for (int i = 1 + newIndexShift; i < mJitterPoints.length; i += 2) {
|
||||
mJitterPoints[i] = oldJitterPoints[i + oldIndexShift];
|
||||
mJitterAvgPoints[i] = oldJitterAvgPoints[i + oldIndexShift];
|
||||
}
|
||||
}
|
||||
mGraphMaxMs = JITTER_LINES_MS[JITTER_LINES_MS.length - 1] + .5f;
|
||||
mGraphScale = (h / mGraphMaxMs);
|
||||
for (int i = 0; i < JITTER_LINES_MS.length; i++) {
|
||||
mJitterYs[i] = (float) Math.floor(h - mGraphScale * JITTER_LINES_MS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private static String[] makeLabels(float[] divisions) {
|
||||
String[] ret = new String[divisions.length];
|
||||
for (int i = 0; i < divisions.length; i++) {
|
||||
ret[i] = Float.toString(divisions[i]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
private final OnFrameMetricsAvailableListener mMetricsListener = new OnFrameMetricsAvailableListener() {
|
||||
private final static double WEIGHT = 40;
|
||||
private long mPreviousFrameTotal;
|
||||
private double mJitterMma;
|
||||
private double mUiFrametimeMma;
|
||||
private double mRtFrametimeMma;
|
||||
private double mTotalFrametimeMma;
|
||||
private double mMostlyTotalFrametimeMma;
|
||||
private boolean mNeedsFirstValues = true;
|
||||
|
||||
@Override
|
||||
public void onFrameMetricsAvailable(Window window, FrameMetrics frameMetrics,
|
||||
int dropCountSinceLastInvocation) {
|
||||
if (frameMetrics.getMetric(FrameMetrics.FIRST_DRAW_FRAME) == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
long uiDuration = frameMetrics.getMetric(FrameMetrics.INPUT_HANDLING_DURATION)
|
||||
+ frameMetrics.getMetric(FrameMetrics.ANIMATION_DURATION)
|
||||
+ frameMetrics.getMetric(FrameMetrics.LAYOUT_MEASURE_DURATION)
|
||||
+ frameMetrics.getMetric(FrameMetrics.DRAW_DURATION);
|
||||
long rtDuration = frameMetrics.getMetric(FrameMetrics.SYNC_DURATION)
|
||||
+ frameMetrics.getMetric(FrameMetrics.COMMAND_ISSUE_DURATION);
|
||||
long totalDuration = frameMetrics.getMetric(FrameMetrics.TOTAL_DURATION);
|
||||
long jitter = Math.abs(totalDuration - mPreviousFrameTotal);
|
||||
if (mNeedsFirstValues) {
|
||||
mJitterMma = 0;
|
||||
mUiFrametimeMma = uiDuration;
|
||||
mRtFrametimeMma = rtDuration;
|
||||
mTotalFrametimeMma = totalDuration;
|
||||
mMostlyTotalFrametimeMma = uiDuration + rtDuration;
|
||||
mNeedsFirstValues = false;
|
||||
} else {
|
||||
mJitterMma = add(mJitterMma, jitter);
|
||||
mUiFrametimeMma = add(mUiFrametimeMma, uiDuration);
|
||||
mRtFrametimeMma = add(mRtFrametimeMma, rtDuration);
|
||||
mTotalFrametimeMma = add(mTotalFrametimeMma, totalDuration);
|
||||
mMostlyTotalFrametimeMma = add(mMostlyTotalFrametimeMma, uiDuration + rtDuration);
|
||||
}
|
||||
mPreviousFrameTotal = totalDuration;
|
||||
mUpdateHandler.obtainMessage(R.id.jitter_mma,
|
||||
String.format("Jitter: %.3fms", toMs(mJitterMma))).sendToTarget();
|
||||
mUpdateHandler.obtainMessage(R.id.totalish_mma,
|
||||
String.format("CPU-total duration: %.3fms", toMs(mMostlyTotalFrametimeMma))).sendToTarget();
|
||||
mUpdateHandler.obtainMessage(R.id.ui_frametime_mma,
|
||||
String.format("UI duration: %.3fms", toMs(mUiFrametimeMma))).sendToTarget();
|
||||
mUpdateHandler.obtainMessage(R.id.rt_frametime_mma,
|
||||
String.format("RT duration: %.3fms", toMs(mRtFrametimeMma))).sendToTarget();
|
||||
mUpdateHandler.obtainMessage(R.id.total_mma,
|
||||
String.format("Total duration: %.3fms", toMs(mTotalFrametimeMma))).sendToTarget();
|
||||
mUpdateHandler.obtainMessage(R.id.graph, (int) (jitter / 1000),
|
||||
(int) (mJitterMma / 1000)).sendToTarget();
|
||||
}
|
||||
|
||||
double add(double previous, double today) {
|
||||
return (((WEIGHT - 1) * previous) + today) / WEIGHT;
|
||||
}
|
||||
|
||||
double toMs(double val) {
|
||||
return val / 1000000;
|
||||
}
|
||||
};
|
||||
|
||||
private static final class AnimatedBackgroundDrawable extends Drawable {
|
||||
private static final int FROM_COLOR = 0xFF18FFFF;
|
||||
private static final int TO_COLOR = 0xFF40C4FF;
|
||||
private static final int DURATION = 1400;
|
||||
|
||||
private final Paint mPaint;
|
||||
private boolean mReverse;
|
||||
private long mStartTime;
|
||||
private int mColor;
|
||||
|
||||
private boolean mReverseX;
|
||||
private boolean mReverseY;
|
||||
private float mX;
|
||||
private float mY;
|
||||
private float mRadius;
|
||||
private float mMoveStep = 10.0f;
|
||||
|
||||
public AnimatedBackgroundDrawable() {
|
||||
mPaint = new Paint();
|
||||
mPaint.setColor(0xFFFFFF00);
|
||||
mPaint.setAntiAlias(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
stepColor();
|
||||
canvas.drawColor(mColor);
|
||||
|
||||
mX += (mReverseX ? -mMoveStep : mMoveStep);
|
||||
mY += (mReverseY ? -mMoveStep : mMoveStep);
|
||||
clampXY();
|
||||
canvas.drawCircle(mX, mY, mRadius, mPaint);
|
||||
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
private void clampXY() {
|
||||
if (mX <= mRadius) {
|
||||
mReverseX = false;
|
||||
mX = mRadius;
|
||||
}
|
||||
if (mY <= mRadius) {
|
||||
mReverseY = false;
|
||||
mY = mRadius;
|
||||
}
|
||||
float maxX = getBounds().width() - mRadius;
|
||||
if (mX >= maxX) {
|
||||
mReverseX = true;
|
||||
mX = maxX;
|
||||
}
|
||||
float maxY = getBounds().height() - mRadius;
|
||||
if (mY >= maxY) {
|
||||
mReverseY = true;
|
||||
mY = maxY;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBoundsChange(Rect bounds) {
|
||||
super.onBoundsChange(bounds);
|
||||
mMoveStep = Math.min(bounds.width(), bounds.height()) / 130.0f;
|
||||
mRadius = Math.min(bounds.width(), bounds.height()) / 20.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha(int alpha) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter colorFilter) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOpacity() {
|
||||
return PixelFormat.OPAQUE;
|
||||
}
|
||||
|
||||
private void stepColor() {
|
||||
if (mStartTime == 0) {
|
||||
mStartTime = AnimationUtils.currentAnimationTimeMillis();
|
||||
}
|
||||
float frac = (AnimationUtils.currentAnimationTimeMillis() - mStartTime)
|
||||
/ (float) DURATION;
|
||||
if (frac > 1.0f) frac = 1.0f;
|
||||
int dest = mReverse ? FROM_COLOR : TO_COLOR;
|
||||
int src = mReverse ? TO_COLOR : FROM_COLOR;
|
||||
int r = (int) (Color.red(src) + (Color.red(dest) - Color.red(src)) * frac);
|
||||
int g = (int) (Color.green(src) + (Color.green(dest) - Color.green(src)) * frac);
|
||||
int b = (int) (Color.blue(src) + (Color.blue(dest) - Color.blue(src)) * frac);
|
||||
mColor = Color.rgb(r, g, b);
|
||||
if (frac == 1.0f) {
|
||||
mStartTime = 0;
|
||||
mReverse = !mReverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package org.evolution.pixelparts.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import org.evolution.pixelparts.autohbm.AutoHBM;
|
||||
import org.evolution.pixelparts.services.AutoHBMService;
|
||||
|
||||
public class AutoHBMUtils {
|
||||
|
||||
private static boolean mAutoHBMEnabled = false;
|
||||
|
||||
private static void startAutoHBM(Context context) {
|
||||
context.startServiceAsUser(new Intent(context, AutoHBMService.class),
|
||||
UserHandle.CURRENT);
|
||||
mAutoHBMEnabled = true;
|
||||
}
|
||||
|
||||
private static void stopAutoHBM(Context context) {
|
||||
mAutoHBMEnabled = false;
|
||||
context.stopServiceAsUser(new Intent(context, AutoHBMService.class),
|
||||
UserHandle.CURRENT);
|
||||
}
|
||||
|
||||
public static void enableAutoHBM(Context context) {
|
||||
if (AutoHBM.isAutoHBMEnabled(context) && !mAutoHBMEnabled) {
|
||||
startAutoHBM(context);
|
||||
} else if (!AutoHBM.isAutoHBMEnabled(context) && mAutoHBMEnabled) {
|
||||
stopAutoHBM(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* Copyright (C) 2023-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ComponentUtils {
|
||||
* @param componentClass The class of the component to be enabled or disabled.
|
||||
* @param enable If true, the component will be enabled; if false, it will be disabled.
|
||||
*/
|
||||
public static void setComponentEnabled(Context context, Class<?> componentClass, boolean enable) {
|
||||
public static void toggleComponent(Context context, Class<?> componentClass, boolean enable) {
|
||||
ComponentName componentName = new ComponentName(context, componentClass);
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
int currentState = packageManager.getComponentEnabledSetting(componentName);
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Miku UI
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.utils;
|
||||
|
||||
import android.content.Context
|
||||
import android.hardware.Sensor
|
||||
import android.hardware.SensorEvent
|
||||
import android.hardware.SensorEventListener
|
||||
import android.hardware.SensorManager
|
||||
import kotlin.math.sqrt
|
||||
|
||||
class ShakeUtils(context: Context) : SensorEventListener {
|
||||
private var mOnShakeListeners: ArrayList<OnShakeListener>? = null
|
||||
|
||||
// Last time we triggered shake
|
||||
private var mLastShakeTime = 0L
|
||||
private var mLastUpdateTime = 0L
|
||||
|
||||
// Last position we triggered shake
|
||||
private var mLastX = 0f
|
||||
private var mLastY = 0f
|
||||
private var mLastZ = 0f
|
||||
|
||||
interface OnShakeListener {
|
||||
fun onShake(speed: Double)
|
||||
}
|
||||
|
||||
fun bindShakeListener(listener: OnShakeListener?) {
|
||||
if (listener != null) {
|
||||
mOnShakeListeners?.add(listener)
|
||||
}
|
||||
}
|
||||
|
||||
fun unBindShakeListener(listener: OnShakeListener) {
|
||||
mOnShakeListeners?.remove(listener)
|
||||
}
|
||||
|
||||
override fun onSensorChanged(event: SensorEvent) {
|
||||
if (event == null) {
|
||||
return
|
||||
}
|
||||
val curUpdateTime = System.currentTimeMillis()
|
||||
// Times between two shakes
|
||||
val timeInterval = curUpdateTime - mLastUpdateTime
|
||||
if (timeInterval < SHAKE_INTERVAL_MILLISECOND) {
|
||||
return
|
||||
}
|
||||
if (event.values.size < 3) {
|
||||
return
|
||||
}
|
||||
mLastUpdateTime = curUpdateTime
|
||||
val x = event.values[0]
|
||||
val y = event.values[1]
|
||||
val z = event.values[2]
|
||||
val deltaX = x - mLastX
|
||||
val deltaY = y - mLastY
|
||||
val deltaZ = z - mLastZ
|
||||
mLastX = x
|
||||
mLastY = y
|
||||
mLastZ = z
|
||||
val speed =
|
||||
sqrt((deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ).toDouble()) * 1000.0 / timeInterval
|
||||
if (speed >= SPEED_SHAKE_MILLISECONDS) {
|
||||
startShake(speed)
|
||||
}
|
||||
}
|
||||
|
||||
private fun startShake(speed: Double) {
|
||||
val curShakeTime = System.currentTimeMillis()
|
||||
if (curShakeTime - mLastShakeTime < MIN_SHAKE_INTERVAL) {
|
||||
return
|
||||
}
|
||||
mLastShakeTime = curShakeTime
|
||||
mOnShakeListeners?.let {
|
||||
for (i in it.indices) {
|
||||
it[i].onShake(speed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAccuracyChanged(sensor: Sensor, accuracy: Int) {}
|
||||
|
||||
companion object {
|
||||
|
||||
// Minimal time interval of position changes
|
||||
private const val MIN_SHAKE_INTERVAL = 1024
|
||||
|
||||
// Minimal shake speed
|
||||
private const val SPEED_SHAKE_MILLISECONDS = 400
|
||||
|
||||
// Minimal time interval between two shakes
|
||||
private const val SHAKE_INTERVAL_MILLISECOND = 55
|
||||
}
|
||||
|
||||
init {
|
||||
val mSensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager
|
||||
val sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER)
|
||||
mSensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_UI)
|
||||
mOnShakeListeners = ArrayList()
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.evolution.pixelparts.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
public class TorchUtils {
|
||||
|
||||
/**
|
||||
* Checks if the device has torch hardware.
|
||||
*
|
||||
* @param context The context used to access the package manager.
|
||||
* @return True if the device has torch hardware, false otherwise.
|
||||
*/
|
||||
public static boolean hasTorch(Context context) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
return packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user