universal7885: Remove parts/its hal, remenants

This commit is contained in:
roynatech2544 2023-07-16 19:32:10 +09:00
commit c55b034a4b
No known key found for this signature in database
GPG key ID: 389DAC92CAECBBCC
126 changed files with 0 additions and 4784 deletions

View file

@ -1,18 +0,0 @@
android_app {
name: "SamsungParts",
srcs: [
"src/**/*.kt",
],
platform_apis: true,
certificate: "platform",
jni_libs: [
"libStorageHelper",
"libSwapCallback",
],
static_libs: [
"androidx.preference_preference",
"vendor.eureka.hardware.parts-V1-java",
],
defaults: ["SettingsLibDefaults"],
required: ["vendor.eureka.hardware.parts-service"],
}

View file

@ -1,96 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.eurekateam.samsungextras" android:sharedUserId="android.uid.system">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER"/>
<protected-broadcast android:name="com.android.systemui.doze.pulse"/>
<application
android:label="@string/advanced_settings"
android:supportsRtl="true"
android:theme="@style/Theme.SubSettingsBase"
android:fullBackupOnly="true"
android:persistent="true"
android:defaultToDeviceProtectedStorage="true">
<receiver
android:name=".BootReceiver"
android:exported="true"
android:directBootAware="true">
<intent-filter>
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</receiver>
<activity
android:name=".DeviceSettingsActivity"
android:exported="true"
android:excludeFromRecents="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="com.android.settings.action.EXTRA_SETTINGS"/>
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES"/>
</intent-filter>
<meta-data android:name="com.android.settings.dismiss" android:value="9,13,30"/>
<meta-data android:name="com.android.settings.category" android:value="com.android.settings.category.ia.system"/>
<meta-data android:name="com.android.settings.summary" android:resource="@string/advanced_settings_summary"/>
<meta-data android:name="com.android.settings.icon" android:resource="@drawable/ic_device"/>
</activity>
<activity android:name=".speaker.ClearSpeakerActivity"
android:exported="true"
android:label="@string/clear_speaker_title">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name=".flashlight.FlashLightActivity" android:exported="true" android:label="@string/flashlight_title">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name=".dolby.DolbyActivity" android:exported="true" android:label="@string/dolby_title">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name=".swap.SwapActivity" android:exported="true" android:label="@string/swap_title">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<provider android:name=".dolby.DolbySearchIndexablesProvider" android:exported="true" android:authorities="com.eurekateam.samsungextras" android:multiprocess="false" android:grantUriPermissions="true" android:permission="android.permission.READ_SEARCH_INDEXABLES">
<intent-filter>
<action android:name="android.content.action.SEARCH_INDEXABLES_PROVIDER"/>
</intent-filter>
</provider>
<service android:name=".dolby.DolbyTile" android:exported="true" android:icon="@drawable/ic_speaker_cleaner_icon" android:label="@string/dolby_title" android:permission="android.permission.BIND_QUICK_SETTINGS_TILE" android:enabled="true">
<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>
<activity android:name=".battery.BatteryActivity" android:exported="true" android:label="@string/fastcharge_title">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name=".smartcharge.SmartChargeActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<service android:name=".fps.FPSInfoService" android:exported="false">
</service>
<service android:name=".fps.FPSTileService" android:icon="@drawable/ic_fps_info" android:label="@string/fps_info_title" android:permission="android.permission.BIND_QUICK_SETTINGS_TILE" android:exported="true">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
</service>
</application>
</manifest>

View file

@ -1,26 +0,0 @@
cc_library_shared {
name: "libStorageHelper",
cflags: [
"-Wall",
"-Wextra",
"-Wno-unused-parameter",
"-Werror",
],
srcs: ["Storage.cpp"],
header_libs: ["jni_headers"],
static_libs: ["libc++fs"],
}
cc_library_shared {
name: "libSwapCallback",
srcs: [
"SwapCallbackImpl.cpp",
"SwapCallbackNative.cpp",
],
header_libs: ["jni_headers"],
shared_libs: [
"vendor.eureka.hardware.parts-V1-ndk",
"libbase",
"libbinder_ndk",
],
}

View file

@ -1,22 +0,0 @@
#include <filesystem>
#include <jni.h>
#include <cmath>
#include <sys/stat.h>
namespace fs = std::filesystem;
extern "C" JNIEXPORT jdouble JNICALL
Java_com_eurekateam_samsungextras_interfaces_Swap_getFreeSpace(JNIEnv /*env*/,
jclass /*clazz*/) {
fs::space_info data = fs::space("/data");
auto freespace = data.free / 1024 / 1024;
return std::round((static_cast<double>(freespace) / 1024) / 0.1) * 0.1;
}
extern "C" JNIEXPORT jlong JNICALL
Java_com_eurekateam_samsungextras_interfaces_Swap_getSwapSize(JNIEnv /*env*/,
jclass /*clazz*/) {
struct stat stat_buf;
int rc = stat("/data/swap/swapfile", &stat_buf);
return rc == 0 ? stat_buf.st_size / 1024 / 1024 : -1;
}

View file

@ -1,21 +0,0 @@
// Copyright (C) 2021 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "SwapCallbackImpl.h"
::ndk::ScopedAStatus SwapCallbackImpl::respondToBool(bool result) {
jmethodID mid_callback = env->GetMethodID(cls, "reactToCallbackNative", "()V");
env->CallBooleanMethod(cls, mid_callback, result);
return ::ndk::ScopedAStatus::ok();
}

View file

@ -1,36 +0,0 @@
// Copyright (C) 2021 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <aidl/vendor/eureka/hardware/parts/BnBoolCallback.h>
#include <jni.h>
using namespace aidl::vendor::eureka::hardware::parts;
struct SwapCallbackImpl : public BnBoolCallback {
public:
SwapCallbackImpl(JNIEnv *_env, jclass _cls) {
env = _env;
cls = _cls;
};
// Methods from aidl::vendor::eureka::hardware::parts::IBoolCallback follow.
::ndk::ScopedAStatus respondToBool(bool result) override;
private:
JNIEnv *env;
jclass cls;
};

View file

@ -1,12 +0,0 @@
#include "SwapCallbackImpl.h"
#include <android/binder_manager.h>
#include <aidl/vendor/eureka/hardware/parts/BnSwapOnData.h>
extern "C" JNIEXPORT void JNICALL
Java_com_eurekateam_samsungextras_interfaces_Swap_setSwapOn
(JNIEnv *env, jclass clazz, jboolean cb) {
auto svc = ISwapOnData::fromBinder(ndk::SpAIBinder(AServiceManager_waitForService("vendor.eureka.hardware.parts.ISwapOnData/default")));
svc->setSwapOn(cb ? ndk::SharedRefBase::make<SwapCallbackImpl>(env, clazz) : nullptr);
}

View file

@ -1,3 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="?android:attr/colorAccent" android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z"/>
</vector>

View file

@ -1,3 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="?android:attr/colorAccent" android:pathData="M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z"/>
</vector>

View file

@ -1,3 +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="#000" android:pathData="M16,9H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z"/>
</vector>

View file

@ -1,3 +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="#000" android:pathData="M7,2V13H10V22L17,10H13L17,2H7Z"/>
</vector>

View file

@ -1,5 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000" android:pathData="M10.38 12.33h1.18l-0.59-1.87l-0.59 1.87zm4.69-2.02V7.9h-2.4l-1.7-1.7l-1.7 1.7h-2.4v2.4L5.19 12l1.7 1.7v2.4h2.4l1.7 1.69l1.69-1.7h2.4v-2.4L16.76 12l-1.7-1.7zm-2.92 3.74l-0.36-1.03h-1.64L9.8 14.05H8.82l1.64-4.6h1.02l1.64 4.6h-0.97z"/>
<path android:fillColor="#000" android:pathData="M21.06 8.47h2.06v7.06h-2.06z"/>
<path android:fillColor="#000" android:pathData="M19.23 3.74H2.7c-1 0-1.83 0.83-1.83 1.84v12.84c0 1.01 0.83 1.84 1.83 1.84h16.52c1 0 1.83-0.83 1.83-1.84V5.58c0-1.01-0.82-1.84-1.83-1.84zm0 14.7H2.7V5.56h16.52v12.86z"/>
</vector>

View file

@ -1,22 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?android:attr/colorControlNormal">
<group
android:name="rotationGroup"
android:pivotX="10.0"
android:pivotY="10.0"
android:rotation="15.0" >
<path
android:name="vect"
android:fillColor="#FF000000"
android:pathData="M15.67,4H14V2h-4v2H8.33C7.6,4 7,4.6 7,5.33V9h4.93L13,7v2h4V5.33C17,4.6 16.4,4 15.67,4z"
android:fillAlpha=".3"/>
<path
android:name="draw"
android:fillColor="#FF000000"
android:pathData="M13,12.5h2L11,20v-5.5H9L11.93,9H7v11.67C7,21.4 7.6,22 8.33,22h7.33c0.74,0 1.34,-0.6 1.34,-1.33V9h-4v3.5z"/>
</group>
</vector>

View file

@ -1,3 +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="#000" android:pathData="M16,15H8V5H16M16,1H8C6.89,1 6,1.89 6,3V17A2,2 0 0,0 8,19H16A2,2 0 0,0 18,17V3C18,1.89 17.1,1 16,1M8,23H16V21H8V23Z"/>
</vector>

View file

@ -1,3 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000" android:pathData="M11,17V7H4V17H11M11,3A2,2 0 0,1 13,5V19A2,2 0 0,1 11,21H4C2.89,21 2,20.1 2,19V5A2,2 0 0,1 4,3H11M16.5,3H21.5A1.5,1.5 0 0,1 23,4.5V7.5A1.5,1.5 0 0,1 21.5,9H18L15,12V9L15,4.5A1.5,1.5 0 0,1 16.5,3Z"/>
</vector>

View file

@ -1,4 +0,0 @@
<!-- drawable/fps_info.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000" android:pathData="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12C20,14.4 19,16.5 17.3,18C15.9,16.7 14,16 12,16C10,16 8.2,16.7 6.7,18C5,16.5 4,14.4 4,12A8,8 0 0,1 12,4M10,6A1,1 0 0,0 9,7A1,1 0 0,0 10,8A1,1 0 0,0 11,7A1,1 0 0,0 10,6M14,6A1,1 0 0,0 13,7A1,1 0 0,0 14,8A1,1 0 0,0 15,7A1,1 0 0,0 14,6M17.09,8.94C16.96,8.94 16.84,8.97 16.7,9L13.5,10.32L13.23,10.43C12.67,10 11.91,9.88 11.25,10.15C10.23,10.56 9.73,11.73 10.15,12.75C10.56,13.77 11.73,14.27 12.75,13.85C13.41,13.59 13.88,13 14,12.28L14.23,12.18L17.45,10.88L17.47,10.87C18,10.66 18.23,10.08 18.03,9.56C17.87,9.18 17.5,8.93 17.09,8.94M7,9A1,1 0 0,0 6,10A1,1 0 0,0 7,11A1,1 0 0,0 8,10A1,1 0 0,0 7,9Z"/>
</vector>

View file

@ -1,3 +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="#000" android:pathData="M16,6C14.87,6 13.77,6.35 12.84,7H4C2.89,7 2,7.89 2,9V15C2,16.11 2.89,17 4,17H5V18A1,1 0 0,0 6,19H8A1,1 0 0,0 9,18V17H15V18A1,1 0 0,0 16,19H18A1,1 0 0,0 19,18V17H20C21.11,17 22,16.11 22,15V9C22,7.89 21.11,7 20,7H19.15C18.23,6.35 17.13,6 16,6M16,7.5A3.5,3.5 0 0,1 19.5,11A3.5,3.5 0 0,1 16,14.5A3.5,3.5 0 0,1 12.5,11A3.5,3.5 0 0,1 16,7.5M4,9H8V10H4V9M16,9A2,2 0 0,0 14,11A2,2 0 0,0 16,13A2,2 0 0,0 18,11A2,2 0 0,0 16,9M4,11H8V12H4V11M4,13H8V14H4V13Z"/>
</vector>

View file

@ -1,4 +0,0 @@
<!-- drawable/hand.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000" android:pathData="M6.58,19H14.58V22H6.58V19M19.74,11.6C19.55,11.4 19.29,11.28 19,11.28L18.78,11.31L15.58,13V11.83L16.09,2.9C16.12,2.35 15.7,1.87 15.15,1.84C14.6,1.81 14.12,2.23 14.09,2.78L13.82,7.47H13.58L12.54,7.58V2A1,1 0 0,0 11.54,1C11,1 10.54,1.45 10.54,2V8.41L9.72,8.78L9.03,3.32C8.96,2.77 8.46,2.38 7.91,2.45C7.36,2.5 6.97,3 7.04,3.57L7.81,9.63L7.43,9.8C7.3,9.85 7.18,9.93 7.07,10L5.97,6.11C5.81,5.54 5.25,5.2 4.71,5.34C4.18,5.5 3.88,6.08 4.04,6.65L6.61,15.77C6.61,15.8 6.63,15.84 6.64,15.87L6.67,16H6.68C6.9,16.57 7.47,17 8.08,17H14.58C14.97,17 15.32,16.84 15.58,16.57L20.5,12.37L19.74,11.6Z"/>
</vector>

View file

@ -1,3 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000" android:pathData="M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/>
</vector>

View file

@ -1,4 +0,0 @@
<!-- drawable/headphone-settings.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000" android:pathData="M19,15v3c0,0.55 -0.45,1 -1,1h-1v-4H19M7,15v4H6c-0.55,0 -1,-0.45 -1,-1v-3H7M12,2c-4.97,0 -9,4.03 -9,9v7c0,1.66 1.34,3 3,3h3v-8H5v-2c0,-3.87 3.13,-7 7,-7s7,3.13 7,7v2h-4v8h3c1.66,0 3,-1.34 3,-3v-7C21,6.03 16.97,2 12,2L12,2z"/>
</vector>

View file

@ -1,3 +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="#000" android:pathData="M11,0V4H13V0H11M18.3,2.29L15.24,5.29L16.64,6.71L19.7,3.71L18.3,2.29M5.71,2.29L4.29,3.71L7.29,6.71L8.71,5.29L5.71,2.29M12,6A4,4 0 0,0 8,10V16H6V18H9V23H11V18H13V23H15V18H18V16H16V10A4,4 0 0,0 12,6M2,9V11H6V9H2M18,9V11H22V9H18Z"/>
</vector>

View file

@ -1,4 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:pathData="M0 0h24v24H0V0z"/>
<path android:fillColor="#000000" android:pathData="M15 9H9v6h6V9zm-2 4h-2v-2h2v2zm8-2V9h-2V7c0-1.1-0.9-2-2-2h-2V3h-2v2h-2V3H9v2H7c-1.1 0-2 0.9-2 2v2H3v2h2v2H3v2h2v2c0 1.1 0.9 2 2 2h2v2h2v-2h2v2h2v-2h2c1.1 0 2-0.9 2-2v-2h2v-2h-2v-2h2zm-4 6H7V7h10v10z"/>
</vector>

View file

@ -1,4 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" android:tint="?android:attr/colorControlNormal">
<path android:pathData="M0 0h24v24H0z"/>
<path android:fillColor="#000" android:pathData="M20 8h-2.81c-0.45-0.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-0.49 0-0.96 0.06 -1.41 0.17 L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-0.05 0.33 -0.09 0.66 -0.09 1v1H4v2h2v1c0 0.34 0.04 0.67 0.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c0.05-0.33 0.09 -0.66 0.09 -1v-1h2v-2h-2v-1c0-0.34-0.04-0.67-0.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/>
</vector>

View file

@ -1,3 +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="#000" android:pathData="M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"/>
</vector>

View file

@ -1,3 +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="#000" android:pathData="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"/>
</vector>

View file

@ -1,3 +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="#000" android:pathData="M12,3V12.26C11.5,12.09 11,12 10.5,12C8,12 6,14 6,16.5C6,19 8,21 10.5,21C13,21 15,19 15,16.5V6H19V3H12Z"/>
</vector>

View file

@ -1,4 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:tint="?android:attr/colorControlNormal" android:viewportHeight="24">
<path android:pathData="M0 0h24v24H0z"/>
<path android:fillColor="#FFFFFFFF" android:pathData="M20 4H4c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h16c1.1 0 2-0.9 2-2V6c0-1.1-0.9-2-2-2zM7.76 16.24l-1.41 1.41C4.78 16.1 4 14.05 4 12c0-2.05 0.78 -4.1 2.34-5.66l1.41 1.41C6.59 8.93 6 10.46 6 12s0.59 3.07 1.76 4.24zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm5.66 1.66l-1.41-1.41C17.41 15.07 18 13.54 18 12s-0.59-3.07-1.76-4.24l1.41-1.41C19.22 7.9 20 9.95 20 12c0 2.05-0.78 4.1-2.34 5.66zM12 10c-1.1 0-2 0.9-2 2s0.9 2 2 2 2-0.9 2-2-0.9-2-2-2z"/>
</vector>

View file

@ -1,4 +0,0 @@
<!-- drawable/vibration.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp" android:tint="?android:attr/colorControlNormal">
<path android:fillColor="#000" android:pathData="M1,15c0.55,0 1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v4c0,0.55 0.45,1 1,1zM4,17c0.55,0 1,-0.45 1,-1L5,8c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v8c0,0.55 0.45,1 1,1zM22,10v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1zM20,17c0.55,0 1,-0.45 1,-1L21,8c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v8c0,0.55 0.45,1 1,1zM16.5,3h-9C6.67,3 6,3.67 6,4.5v15c0,0.83 0.67,1.5 1.5,1.5h9c0.83,0 1.5,-0.67 1.5,-1.5v-15c0,-0.83 -0.67,-1.5 -1.5,-1.5zM16,19L8,19L8,5h8v14z"/>
</vector>

View file

@ -1,14 +0,0 @@
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight">
<item android:drawable="?android:attr/colorSecondary"/>
</ripple>

View file

@ -1,90 +0,0 @@
<!-- Copyright (C) 2020 The Xiaomi-SM6250 Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="advanced_settings">Partes de Samsung</string>
<string name="advanced_settings_summary">Ajustes específicos del dispositivo</string>
<!-- Categoría Pantalla -->
<string name="display_category">Pantalla</string>
<!-- FPS Info -->
<string name="fps_info_title">Superposición de FPS</string>
<string name="fps_info_summary">Muestra una superposición con los fotogramas actuales por segundo </string>
<!-- Categoría Altavoz -->
<string name="speaker_category">Audio</string>
<!-- Limpiar Altavoz -->
<string name="clear_speaker_title">Limpiar altavoz</string>
<string name="clear_speaker_summary">Reproduce un audio de 30 segundos para limpiar el altavoz</string>
<string name="clear_speaker_description">Ejecuta esta función una o varias veces si encuentra que su altavoz está ligeramente bloqueado por el polvo. Establezca el volumen multimedia al máximo.\n\nSi el altavoz está muy bloqueado, ejecute esta función de 2 a 5 veces mientras agita el dispositivo con el altavoz hacia abajo.</string>
<!-- Dolby -->
<string name="dolby_title">Dolby Atmos</string>
<string name="dolby_summary">Habilita el efecto de audio Dolby Atmos</string>
<string name="dolby_description">Habilita el audio Dolby, como en One UI.</string>
<string name="dolby_modes_title">Modos Dolby disponibles</string>
<string name="dolby_modes_summary">Elige uno de estos</string>
<string name="dolby_profile_auto">Perfil Automático</string>
<string name="dolby_profile_movie">Perfil de Pelicula</string>
<string name="dolby_profile_music">Perfil de Musica</string>
<string name="dolby_profile_voice">Perfil de Voz</string>
<string name="dolby_profile_game">Perfil de Juego</string>
<string name="dolby_profile_off">Sin Perfil</string>
<string name="dolby_profile_game_1">Perfil de Juego 1</string>
<string name="dolby_profile_game_2">Perfil de Juego 2</string>
<string name="dolby_profile_special_audio">Perfil de audio especial</string>
<!-- Categoría de características de Eureka Kernel -->
<string name="eureka_kernel_features">Características de Eureka Kernel</string>
<!-- Linterna -->
<string name="flashlight_title">Brillo de la linterna</string>
<string name="flashlight_summary">Ajusta el brillo de la linterna</string>
<string name="flashlight_description">Samsung OneUI Tiene una opción para ajustar el brillo de la linterna. AOSP no tiene esta función.\n\nUtilice esta función para ajustar el brillo de la linterna bajo o alto. el rango es del 1 a 10.</string>
<!-- Categoría del GPU -->
<string name="misc_category">Varios</string>
<!-- Batería -->
<string name="fastcharge_category">Batería</string>
<string name="fastcharge_2nd_title">Configuración de Carga rápida</string>
<string name="charge_title">Configuración de carga</string>
<string name="charge_summary">Habilite / deshabilite la carga aquí.</string>
<string name="fastcharge_title">Información y configuración de la batería</string>
<string name="fastcharge_summary">Habilitar / deshabilitar la función de carga rápida</string>
<string name="fastcharge_description">Administre la función de carga aquí.</string>
<string name="battery_info_title">Info Variada de la batería</string>
<string name="battery_info_summary">Sección para geeks</string>
<string name="battery_max_capa">Capacidad máxima de la batería (mAh)</string>
<string name="battery_status">Estado de la batería</string>
<string name="battery_chrged_up_to">Batería cargada hasta (%)</string>
<string name="battery_chrged_up_to_mah">Batería cargada hasta (mAh)</string>
<string name="battery_temp">Temperatura actual de la batería</string>
<string name="battery_current">Corriente de la batería (mA)</string>
<!-- Label for feature switch -->
<string name="switch_bar_on">Encendido</string>
<!-- Label for feature switch -->
<string name="switch_bar_off">Apagado</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 por defecto: <xliff:g id="v">%s</xliff:g>\nMantenga presionado para establecer</string>
<string name="custom_seekbar_default_value_is_set">Se establece el valor predeterminado</string>
<!-- Carga Inteligente -->
<string name="smartcharge_title">Implementación simple de carga inteligente</string>
<string name="smartcharge_switch">Habilitar la implementación</string>
<string name="choose_limit_title">Ajustar el limite de carga %</string>
<string name="choose_summary">Toque aqui para modificar el ajuste</string>
<string name="choose_restart_title">limite de readunación de carga</string>
<string name="limit_title">Limite de carga actual</string>
<string name="restart_title">reanudación de la carga actual</string>
<string name="limit_stat_title">Estadisticas del conteo del limite de carga desde el ultimo inicio</string>
<string name="restart_stat_title">Estadisticas del conteo de reanudaciónes de carga desde el ultimo inicio</string>
<string name="adjust_title">Mueva la barra para ajustar los valores</string>
<string name="adjust_summary">desde la izquierda el valor se movera de -10 -1 0 1 10</string>
<string name="smartcharge_description">\'Testa\' es una implementación simple de la carga inteligente
basada en el porcentaje de la bateria, Si el porcentaje esta por encima del limite
la carga se detendra y si el porcentaje baja del limite la carga se readunará,
el objetivo de esta herramienta es mejorar la salud y la vida de la bateria a largo plazo</string>
</resources>

View file

@ -1,100 +0,0 @@
<!-- Copyright (C) 2020 The Xiaomi-SM6250 Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="advanced_settings">Опции Samsung</string>
<string name="advanced_settings_summary">Дополнительные функции</string>
<string name="not_shown">Не отображается из-за пользовательских настроек</string>
<string name="show_data">Показать данные батареи</string>
<!-- Display category -->
<string name="display_category">Экран</string>
<!-- FPS Info -->
<string name="fps_info_title">Включить счётчик FPS</string>
<string name="fps_info_summary">Показать наложение с текущими кадрами в секунду</string>
<!-- Speaker category -->
<string name="speaker_category">Звук</string>
<string name="flash_enable_title">Включить опцию управленя вспышкой (от Eureka)</string>
<!-- Clear Speaker -->
<string name="clear_speaker_title">Очистка динмика</string>
<string name="clear_speaker_summary">Воспроизведение 30-секундного звука для очистки динамика</string>
<string name="clear_speaker_description">Запустите эту функцию один или два раза, если вы обнаружите, что ваш динамик слегка забит пылью. Установите громкость на максимум.\n\nЕсли динамик сильно заблокирован, запустите эту функцию 2-5 раза, встряхивая устройство так, чтобы динамик был направлен вниз.</string>
<!-- Dolby -->
<string name="dolby_summary">Включить аудио эффекты от Dolby Atmos</string>
<!-- Title -->
<string name="dolby_title" translatable="false">Dolby Atmos</string>
<!-- Switch bar -->
<string name="dolby_enable_title">Включить Dolby Atmos</string>
<!-- Intro -->
<string name="dolby_top_intro_summary">Испытайте революционный звук при воспроизведении мультимедиа, который струиться над вами и вокруг вас</string>
<!-- Profiles -->
<string name="dolby_profile_auto">Авто</string>
<string name="dolby_profile_game">Игра</string>
<string name="dolby_profile_game_1">Игра 1</string>
<string name="dolby_profile_game_2">Игра 2</string>
<string name="dolby_profile_movie">Фильм</string>
<string name="dolby_profile_music">Музыка</string>
<string name="dolby_profile_off">Без профиля</string>
<string name="dolby_profile_spacial_audio">Пространственный звук</string>
<string name="dolby_profile_voice">Голос</string>
<!-- Eureka Kernel features category -->
<string name="eureka_kernel_features">Возможности Eureka Kernel</string>
<!-- FlashLight -->
<string name="flashlight_title">Яркость вспышки</string>
<string name="flashlight_summary">Отрегулируйте яркость фонарика</string>
<string name="flashlight_description">Данная возможность перенесена из системы Samsung OneUI. По-умолчанию данная опция отсутствует в AOSP.\n\nИспользуйте эту функцию для регулировки низкой или высокой яркости фонарика. Диапазон от 0 до 10.</string>
<string name="swap_title">Файл подкачки (SWAP)</string>
<string name="swap_enable_title">Включить подкачку на EMMC</string>
<string name="swap_size_title">Размер подкачки</string>
<string name="swap_size_summary">Отрегулируйте размер подкачки</string>
<string name="swap_description">Создайте файл подкачки (не ZRam) на /data разделе. Полезно для устройств с низким объемом памяти</string>
<string name="free_space">Количество свободного места на /data</string>
<string name="swap_file_size">Размер файла подкачки</string>
<!-- Display Category -->
<string name="misc_category">Разное</string>
<string name="dt2w_mode">Двойное нажатие для пробуждения</string>
<string name="glove_mode">Режим перчаток</string>
<!-- Battery -->
<string name="fastcharge_category">Батарея</string>
<string name="fastcharge_2nd_title">Быстрая зарядка</string>
<string name="charge_title">Зарядка</string>
<string name="charge_summary">Включить/Отключить зарядку</string>
<string name="fastcharge_title">Информация о батареи и настройки</string>
<string name="fastcharge_summary">Включить/Отключить быструю зарядку</string>
<string name="fastcharge_description">Управление функцией зарядки.</string>
<string name="battery_info_title">Разная информация о батарее</string>
<string name="battery_info_summary">Раздел для инженеров</string>
<string name="battery_max_capa">Максимальный объем батареи (mAh)</string>
<string name="battery_status">Статус батареи</string>
<string name="battery_chrged_up_to">Аккумулятор заряжен до (%)</string>
<string name="battery_chrged_up_to_mah">Аккумулятор заряжен до (mAh)</string>
<string name="battery_temp">Текущая температура батареи</string>
<string name="battery_current">Ток батареи (mA)</string>
<!-- Label for feature switch -->
<string name="switch_bar_on">Включено</string>
<!-- Label for feature switch -->
<string name="switch_bar_off">Выключено</string>
<!-- SmartCharge -->
<string name="smartcharge_title">Смарт-зарядка</string>
<string name="smartcharge_switch">Включить данную реализацию</string>
<string name="choose_limit_title">Отрегулируйте предел заряда (%)</string>
<string name="choose_summary">Нажмите, чтобы изменить настройки</string>
<string name="choose_restart_title">Отрегулируйте перезапуск заряда (%)</string>
<string name="limit_title">Настройка предельного заряда по току (%)</string>
<string name="restart_title">Настройка заряда при перезапуске (%)</string>
<string name="limit_stat_title">Статистика количества зарядок с момента последней загрузки</string>
<string name="restart_stat_title">Статистика количества перезапущенных зарядок с момента последней загрузки</string>
<string name="adjust_title">Перемещайте ползунок, чтобы настроить значения</string>
<string name="adjust_summary">Начиная с самого левого, значение будет перемещаться на -10 -1 0 1 10</string>
<string name="smartcharge_description">Это простая реализация интеллектуальной зарядки, основанная на проценте батареи. Если процент заряда батареи выше предела, зарядка прекращается, или если ниже, она продолжаеться снова. Поможет увеличить срок службы батареи в долгосрочной перспективе.</string>
</resources>

View file

@ -1,104 +0,0 @@
<!-- Copyright (C) 2020 The Xiaomi-SM6250 Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="advanced_settings">SamsungParts</string>
<string name="advanced_settings_summary">Device specific tweaks</string>
<string name="not_shown">Not shown due to user settings</string>
<string name="show_data">Show the battery data</string>
<!-- Display category -->
<string name="display_category">Display</string>
<!-- FPS Info -->
<string name="fps_info_title">FPS info overlay</string>
<string name="fps_info_summary">Show overlay with current frames per second</string>
<!-- Speaker category -->
<string name="speaker_category">Audio</string>
<string name="flash_enable_title">Enable Eureka flash control feature</string>
<!-- Clear Speaker -->
<string name="clear_speaker_title">Clear speaker</string>
<string name="clear_speaker_summary">Play a 30-second audio to clear the speaker</string>
<string name="clear_speaker_description">Run this feature once or twice if you find that your speaker is lightly blocked by dust. Set media volume to maximum.\n\nIf the speaker is blocked heavily, run this feature 25 times while shaking your device with the speaker facing downwards.</string>
<!-- Dolby -->
<string name="dolby_summary">Enable the Dolby Atmos audio effect</string>
<!-- Title -->
<string name="dolby_title" translatable="false">Dolby Atmos</string>
<!-- Switch bar -->
<string name="dolby_enable_title">Enable Dolby Atmos</string>
<!-- Intro -->
<string name="dolby_top_intro_summary">Experience breakthrough audio for media playback that flows above and around you</string>
<!-- Profiles -->
<string name="dolby_profile_auto">Auto Profile</string>
<string name="dolby_profile_game">Game Profile</string>
<string name="dolby_profile_game_1">Game 1 Profile</string>
<string name="dolby_profile_game_2">Game 2 Profile</string>
<string name="dolby_profile_movie">Movie Profile</string>
<string name="dolby_profile_music">Music Profile</string>
<string name="dolby_profile_off">No Profile</string>
<string name="dolby_profile_spacial_audio">Spacial Audio Profile</string>
<string name="dolby_profile_voice">Voice Profile</string>
<!-- Eureka Kernel features category -->
<string name="eureka_kernel_features">Eureka Kernel Features</string>
<!-- FlashLight -->
<string name="flashlight_title">FlashLight Brightness</string>
<string name="flashlight_summary">Adjust FlashLight Brightness</string>
<string name="flashlight_description">Samsung\'s OneUI Has An Option to Adjust
Flashlight Brightness. AOSP doesn\'t have this feature.\n\n
Use this feature to adjust low or high flashlight brightness. Ranges from 0 to 10.</string>
<string name="swap_title">Swap on userdata</string>
<string name="swap_enable_title">Enable swap on EMMC</string>
<string name="swap_size_title">Swap size</string>
<string name="swap_size_summary">Adjust the size of swap</string>
<string name="swap_description">Creates the swap (not zram) on /data partiton. Useful for low memory devices.</string>
<string name="free_space">Free space on /data</string>
<string name="swap_file_size">Swap file size</string>
<!-- Display Category -->
<string name="misc_category">Misc</string>
<string name="dt2w_mode">Toggle for double tap to wake</string>
<string name="glove_mode">Toggle for glove mode</string>
<!-- Battery -->
<string name="fastcharge_category">Battery</string>
<string name="fastcharge_2nd_title">FastCharge Settings</string>
<string name="charge_title">Charging Settings</string>
<string name="charge_summary">Enable/Disable Charging here.</string>
<string name="fastcharge_title">Battery Info and Settings</string>
<string name="fastcharge_summary">Enable/Disable Fastcharge Feature</string>
<string name="fastcharge_description">Manage Charging Feature here.</string>
<string name="battery_info_title">Battery Misc Info</string>
<string name="battery_info_summary">Section for geeks</string>
<string name="battery_max_capa">Battery Max Capacity (mAh)</string>
<string name="battery_status">Battery Status</string>
<string name="battery_chrged_up_to">Battery Charged Up To (%)</string>
<string name="battery_chrged_up_to_mah">Battery Charged Up To (mAh)</string>
<string name="battery_temp">Battery Current Temperature</string>
<string name="battery_current">Battery Current (mA)</string>
<!-- Label for feature switch -->
<string name="switch_bar_on">On</string>
<!-- Label for feature switch -->
<string name="switch_bar_off">Off</string>
<!-- SmartCharge -->
<string name="smartcharge_title">Simple SmartCharge Implementation</string>
<string name="smartcharge_switch">Enable The Implementation</string>
<string name="choose_limit_title">Adjust Charge Limit %</string>
<string name="choose_summary">Tap here to adjust the settings</string>
<string name="choose_restart_title">Adjust Charge Restart %</string>
<string name="limit_title">Current Limit Charge % Setting</string>
<string name="restart_title">Current Restart Charge % Setting</string>
<string name="limit_stat_title">Stats of limited charging count since last boot</string>
<string name="restart_stat_title">Stats of restarted charging count since last boot</string>
<string name="adjust_title">Move the seekbar to adjust values</string>
<string name="adjust_summary">From the most left, the value will move by -10 -1 0 1 10</string>
<string name="smartcharge_description">This is a simple smartcharge implementation based on
battery percentage. If the battery percent is above limit, the charging stops, or if it is
below restart, it charges again. Said to improve battery life in long term</string>
</resources>

View file

@ -1,31 +0,0 @@
<resources>
<style name="CustomOptionsTheme" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="preferenceTheme">@style/PreferenceTheme</item>
<item name="dialogTheme">@style/Theme.MaterialComponents.Dialog</item>
<item name="alertDialogTheme">@style/Theme.MaterialComponents.Dialog</item>
</style>
<style name="PreferenceTheme" parent="@style/PreferenceThemeOverlay.v14.Material">
<item name="preferenceCategoryTitleTextAppearance">@style/TextAppearance.CategoryTitle</item>
</style>
<style name="TextAppearance" parent="android:TextAppearance.DeviceDefault"/>
<style name="TextAppearance.CategoryTitle" parent="@android:style/TextAppearance.DeviceDefault">
<item name="android:textAllCaps">true</item>
<item name="android:textSize">11sp</item>
<!-- 0.8 Spacing, 0.8/11 = 0.072727273 -->
<item name="android:letterSpacing">0.072727273</item>
</style>
<style name="Theme.Settings" parent="@android:style/Theme.Material.Settings">
<item name="android:actionBarStyle">@style/Theme.ActionBar</item>
<item name="android:colorAccent">#ff4285f4</item>
</style>
<style name="Theme.ActionBar" parent="@android:style/Widget.DeviceDefault.Light.ActionBar.Solid">
<item name="android:titleTextStyle">@style/Theme.Actionbar.Title</item>
</style>
<style name="Theme.Actionbar.Title" parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
<item name="android:textColor">#ff4285f4</item>
</style>
<style name="DeviceSettings.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar">
</style>
<style name="TextAppearance.Medium" parent="@android:style/TextAppearance.Material.Medium"/>
</resources>

View file

@ -1,60 +0,0 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/fastcharge_title">
<com.android.settingslib.widget.MainSwitchPreference
android:key="show_data"
android:title="@string/show_data"/>
<SwitchPreference
android:key="fastcharge_pref"
android:title="@string/fastcharge_2nd_title"
android:icon="@drawable/ic_bolt"
android:summary="@string/fastcharge_summary"/>
<SwitchPreference
android:key="charge_pref"
android:title="@string/charge_title"
android:icon="@drawable/ic_bolt"
android:summary="@string/charge_summary"/>
<Preference
android:key="battery_capacity"
android:title="@string/battery_max_capa"
android:summary="@string/not_shown"
android:selectable="false"/>
<Preference
android:key="battery_charged_up_to"
android:title="@string/battery_chrged_up_to"
android:summary="@string/not_shown"
android:selectable="false"/>
<Preference
android:key="battery_charged_up_to_mah"
android:title="@string/battery_chrged_up_to_mah"
android:summary="@string/not_shown"
android:selectable="false"/>
<Preference
android:key="battery_current"
android:title="@string/battery_current"
android:summary="@string/not_shown"
android:selectable="false"/>
<Preference
android:key="battery_status"
android:title="@string/battery_status"
android:summary="@string/not_shown"
android:selectable="false"/>
<Preference
android:key="battery_temp"
android:title="@string/battery_temp"
android:summary="@string/not_shown"
android:selectable="false"/>
<com.android.settingslib.widget.FooterPreference
android:key="footer_preference"
android:title="@string/fastcharge_description"
android:selectable="false"/>
</PreferenceScreen>

View file

@ -1,13 +0,0 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/clear_speaker_title">
<com.android.settingslib.widget.MainSwitchPreference
android:key="clear_speaker_pref"
android:title="@string/clear_speaker_title"
android:icon="@drawable/ic_sound"
android:summary="@string/clear_speaker_summary"/>
<com.android.settingslib.widget.FooterPreference
android:key="footer_preference"
android:title="@string/clear_speaker_description"
android:selectable="false"/>
</PreferenceScreen>

View file

@ -1,49 +0,0 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/dolby_title">
<com.android.settingslib.widget.MainSwitchPreference
android:defaultValue="false"
android:key="dolby_enable"
android:title="@string/dolby_enable_title"/>
<com.android.settingslib.widget.RadioButtonPreference
android:key="dolby_profile_auto"
android:title="@string/dolby_profile_auto"/>
<com.android.settingslib.widget.RadioButtonPreference
android:key="dolby_profile_game"
android:title="@string/dolby_profile_game"/>
<com.android.settingslib.widget.RadioButtonPreference
android:key="dolby_profile_game_1"
android:title="@string/dolby_profile_game_1"/>
<com.android.settingslib.widget.RadioButtonPreference
android:key="dolby_profile_game_2"
android:title="@string/dolby_profile_game_2"/>
<com.android.settingslib.widget.RadioButtonPreference
android:key="dolby_profile_movie"
android:title="@string/dolby_profile_movie"/>
<com.android.settingslib.widget.RadioButtonPreference
android:key="dolby_profile_music"
android:title="@string/dolby_profile_music"/>
<com.android.settingslib.widget.RadioButtonPreference
android:key="dolby_profile_off"
android:title="@string/dolby_profile_off"/>
<com.android.settingslib.widget.RadioButtonPreference
android:defaultValue="true"
android:key="dolby_profile_spacial_audio"
android:title="@string/dolby_profile_spacial_audio"/>
<com.android.settingslib.widget.RadioButtonPreference
android:key="dolby_profile_voice"
android:title="@string/dolby_profile_voice"/>
<com.android.settingslib.widget.FooterPreference
android:key="dolby_top_intro"
android:title="@string/dolby_top_intro_summary"/>
</PreferenceScreen>

View file

@ -1,19 +0,0 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/flashlight_title">
<com.android.settingslib.widget.MainSwitchPreference
android:defaultValue="false"
android:key="flashlight_enable"
android:title="@string/flash_enable_title"/>
<SeekBarPreference
android:key="flashlight_pref"
android:title="@string/flashlight_title"
android:icon="@drawable/ic_led"
android:summary="@string/flashlight_summary"/>
<com.android.settingslib.widget.FooterPreference
android:key="footer_preference"
android:title="@string/flashlight_description"
android:selectable="false"/>
</PreferenceScreen>

View file

@ -1,104 +0,0 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/advanced_settings">
<PreferenceCategory
android:key="display"
android:title="@string/display_category">
<SwitchPreference
android:key="fps_info"
android:icon="@drawable/ic_fps_info"
android:title="@string/fps_info_title"
android:summary="@string/fps_info_summary"
android:persistent="true"/>
</PreferenceCategory>
<PreferenceCategory
android:key="speaker"
android:title="@string/speaker_category">
<Preference
android:key="clear_speaker_settings"
android:title="@string/clear_speaker_title"
android:summary="@string/clear_speaker_summary"
android:icon="@drawable/ic_sound">
<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.eurekateam.samsungextras.speaker.ClearSpeakerActivity"
android:targetPackage="com.eurekateam.samsungextras"/>
</Preference>
<Preference
android:key="dolby_settings"
android:title="@string/dolby_title"
android:summary="@string/dolby_summary"
android:icon="@drawable/ic_speaker_cleaner_icon">
<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.eurekateam.samsungextras.dolby.DolbyActivity"
android:targetPackage="com.eurekateam.samsungextras"/>
</Preference>
</PreferenceCategory>
<PreferenceCategory
android:key="eureka_kernel_features"
android:title="@string/eureka_kernel_features">
<Preference
android:key="flashlight_settings"
android:title="@string/flashlight_title"
android:summary="@string/flashlight_summary"
android:icon="@drawable/ic_led">
<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.eurekateam.samsungextras.flashlight.FlashLightActivity"
android:targetPackage="com.eurekateam.samsungextras"/>
</Preference>
</PreferenceCategory>
<PreferenceCategory
android:key="fastcharge"
android:title="@string/fastcharge_category">
<Preference
android:key="battery_settings"
android:title="@string/fastcharge_title"
android:icon="@drawable/ic_bolt"
android:summary="@string/fastcharge_summary"
android:persistent="true">
<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.eurekateam.samsungextras.battery.BatteryActivity"
android:targetPackage="com.eurekateam.samsungextras"/>
</Preference>
<Preference
android:key="smartcharge_settings"
android:title="@string/smartcharge_title"
android:icon="@drawable/ic_charge"
android:summary="@string/smartcharge_switch"
android:persistent="true">
<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.eurekateam.samsungextras.smartcharge.SmartChargeActivity"
android:targetPackage="com.eurekateam.samsungextras"/>
</Preference>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/misc_category">
<Preference
android:key="swap_settings"
android:title="@string/swap_title"
android:icon="@drawable/ic_memory"
android:summary="@string/swap_description"
android:persistent="true">
<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.eurekateam.samsungextras.swap.SwapActivity"
android:targetPackage="com.eurekateam.samsungextras"/>
</Preference>
<SwitchPreference
android:defaultValue="true"
android:key="dt2w_settings"
android:title="@string/dt2w_mode"
android:persistent="true"/>
<SwitchPreference
android:key="glove_mode_settings"
android:title="@string/glove_mode"
android:persistent="true"/>
</PreferenceCategory>
<com.android.settingslib.widget.FooterPreference
android:title="@string/advanced_settings_summary"
android:selectable="false"/>
</PreferenceScreen>

View file

@ -1,51 +0,0 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/smartcharge_title">
<com.android.settingslib.widget.MainSwitchPreference
android:defaultValue="false"
android:key="smartcharge"
android:title="@string/smartcharge_switch"/>
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="choose_limit"
android:title="@string/choose_limit_title"
android:summary="@string/choose_summary"/>
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="choose_restart"
android:title="@string/choose_restart_title"
android:summary="@string/choose_summary"/>
<SeekBarPreference
android:key="adjust"
android:title="@string/adjust_title"
android:summary="@string/adjust_summary"/>
<Preference
android:key="limit"
android:title="@string/limit_title"
android:icon="@drawable/ic_battery"
android:selectable="false"/>
<Preference
android:key="restart"
android:title="@string/restart_title"
android:icon="@drawable/ic_battery"
android:selectable="false"/>
<Preference
android:key="limit_stat"
android:title="@string/limit_stat_title"
android:icon="@drawable/ic_charge"
android:selectable="false"/>
<Preference
android:key="restart_stat"
android:title="@string/restart_stat_title"
android:icon="@drawable/ic_charge"
android:selectable="false"/>
<com.android.settingslib.widget.FooterPreference
android:title="@string/smartcharge_description"
android:selectable="false"/>
</PreferenceScreen>

View file

@ -1,25 +0,0 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/swap_title">
<com.android.settingslib.widget.MainSwitchPreference
android:defaultValue="false"
android:key="swap_enable"
android:title="@string/swap_enable_title"/>
<SeekBarPreference
android:key="swap_size"
android:title="@string/swap_size_title"
android:icon="@drawable/ic_memory"
android:summary="@string/swap_size_summary"/>
<Preference
android:key="free_space"
android:title="@string/free_space"
android:selectable="false"/>
<Preference
android:key="swap_file_size"
android:title="@string/swap_file_size"
android:selectable="false"/>
<com.android.settingslib.widget.FooterPreference
android:title="@string/swap_description"
android:selectable="false"/>
</PreferenceScreen>

View file

@ -1,65 +0,0 @@
package com.eurekateam.samsungextras
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.preference.PreferenceManager
import com.eurekateam.samsungextras.battery.BatteryFragment
import com.eurekateam.samsungextras.dolby.DolbyCore
import com.eurekateam.samsungextras.dolby.DolbyFragment
import com.eurekateam.samsungextras.flashlight.FlashLightFragment
import com.eurekateam.samsungextras.smartcharge.SmartChargeFragment
import com.eurekateam.samsungextras.interfaces.Battery
import com.eurekateam.samsungextras.interfaces.Display
import com.eurekateam.samsungextras.interfaces.FlashLight
import com.eurekateam.samsungextras.interfaces.Swap
import com.eurekateam.samsungextras.interfaces.SmartCharge
import com.eurekateam.samsungextras.swap.SwapFragment
class BootReceiver : BroadcastReceiver() {
override fun onReceive(p0: Context?, p1: Intent?) {
val mSharedPreferences = p0?.let { PreferenceManager.getDefaultSharedPreferences(it) }
if (p1 != null && mSharedPreferences != null) {
if (p1.action == Intent.ACTION_LOCKED_BOOT_COMPLETED) {
System.loadLibrary("StorageHelper")
System.loadLibrary("SwapCallback")
// Battery
val mBattery = Battery()
mBattery.Charge = mSharedPreferences.getBoolean(BatteryFragment.PREF_CHARGE, true)
mBattery.FastCharge = mSharedPreferences.getBoolean(BatteryFragment.PREF_FASTCHARGE, true)
// Dolby
DolbyCore.setEnabled(
mSharedPreferences
.getBoolean(DolbyFragment.PREF_DOLBY_ENABLE, true)
)
DolbyCore.setProfile(
mSharedPreferences
.getInt(DolbyFragment.PREF_DOLBY_PROFILE, 8)
)
// FlashLight
val mFlash = FlashLight()
mFlash.setFlash(mSharedPreferences.getInt(FlashLightFragment.PREF_FLASHLIGHT, 5))
// ZRAM
val mSwap = Swap()
if (mSharedPreferences.getBoolean(SwapFragment.PREF_SWAP_ENABLE, false)) {
mSwap.setSwapOn(false)
}
// Display
val mDisplay = Display()
mDisplay.DT2W = mSharedPreferences.getBoolean(DeviceSettings.PREF_DOUBLE_TAP, true)
mDisplay.GloveMode = mSharedPreferences.getBoolean(DeviceSettings.PREF_GLOVE_MODE, false)
val limit = mSharedPreferences.getInt(SmartChargeFragment.PREF_LIMIT, 20)
val restart = mSharedPreferences.getInt(SmartChargeFragment.PREF_RESTART, 80)
val mSmartCharge = SmartCharge()
mSmartCharge.setConfig(limit, restart)
Log.i("SamsungParts", "Applied settings")
}
}
}
}

View file

@ -1,119 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.eurekateam.samsungextras
import android.content.Intent
import android.content.SharedPreferences
import android.os.Build
import android.os.Bundle
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import androidx.preference.SwitchPreference
import com.eurekateam.samsungextras.battery.BatteryActivity
import com.eurekateam.samsungextras.flashlight.FlashLightActivity
import com.eurekateam.samsungextras.fps.FPSInfoService
import com.eurekateam.samsungextras.interfaces.Display
import com.eurekateam.samsungextras.speaker.ClearSpeakerActivity
import com.eurekateam.samsungextras.smartcharge.SmartChargeActivity
class DeviceSettings : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener {
private lateinit var mPrefs: SharedPreferences
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
System.loadLibrary("StorageHelper")
System.loadLibrary("SwapCallback")
setPreferencesFromResource(R.xml.preferences_samsung_parts, rootKey)
mPrefs = PreferenceManager.getDefaultSharedPreferences(requireContext())
val mClearSpeakerPref = findPreference<Preference>(PREF_CLEAR_SPEAKER)!!
mClearSpeakerPref.onPreferenceClickListener =
Preference.OnPreferenceClickListener {
val intent = Intent(requireActivity().applicationContext, ClearSpeakerActivity::class.java)
startActivity(intent)
true
}
val mFpsInfo = findPreference<SwitchPreference>(PREF_KEY_FPS_INFO)!!
mFpsInfo.isChecked = mPrefs.getBoolean(PREF_KEY_FPS_INFO, false)
mFpsInfo.onPreferenceChangeListener = this
val mDT2W = findPreference<SwitchPreference>(PREF_DOUBLE_TAP)!!
mDT2W.onPreferenceChangeListener = this
mDT2W.isEnabled = !(Build.PRODUCT.contains("a10") || Build.PRODUCT.contains("a20e"))
mDT2W.isChecked = mPrefs.getBoolean(PREF_DOUBLE_TAP, false)
val mGloveMode = findPreference<SwitchPreference>(PREF_GLOVE_MODE)!!
mGloveMode.onPreferenceChangeListener = this
mGloveMode.isEnabled = !Build.PRODUCT.contains("a10")
mGloveMode.isChecked = mPrefs.getBoolean(PREF_GLOVE_MODE, false)
val mFlashLight = findPreference<Preference>(PREF_FLASHLIGHT)!!
mFlashLight.onPreferenceClickListener =
Preference.OnPreferenceClickListener {
val intent = Intent(requireActivity().applicationContext, FlashLightActivity::class.java)
startActivity(intent)
true
}
val mFastCharge = findPreference<Preference>(PREF_BATTERY)!!
mFastCharge.onPreferenceClickListener =
Preference.OnPreferenceClickListener {
val intent = Intent(requireActivity().applicationContext, BatteryActivity::class.java)
startActivity(intent)
true
}
val mSmartCharge = findPreference<Preference>(PREF_SMARTCHARGE)!!
mSmartCharge.onPreferenceClickListener =
Preference.OnPreferenceClickListener {
val intent = Intent(requireActivity().applicationContext, SmartChargeActivity::class.java)
startActivity(intent)
true
}
}
override fun onPreferenceChange(preference: Preference, value: Any): Boolean {
val mDisplay = Display()
when (preference.key) {
PREF_KEY_FPS_INFO -> {
val mEnabled = value as Boolean
val mFPSService = Intent(this.context, FPSInfoService::class.java)
if (mEnabled) {
requireContext().startService(mFPSService)
} else {
requireContext().stopService(mFPSService)
}
mPrefs.edit().putBoolean(PREF_KEY_FPS_INFO, mEnabled).apply()
}
PREF_DOUBLE_TAP -> {
mDisplay.DT2W = value as Boolean
mPrefs.edit().putBoolean(PREF_DOUBLE_TAP, value).apply()
}
PREF_GLOVE_MODE -> {
mDisplay.GloveMode = value as Boolean
mPrefs.edit().putBoolean(PREF_GLOVE_MODE, value).apply()
}
else -> {
return false
}
}
return true
}
companion object {
const val PREF_KEY_FPS_INFO = "fps_info"
private const val PREF_CLEAR_SPEAKER = "clear_speaker_settings"
private const val PREF_FLASHLIGHT = "flashlight_settings"
const val PREF_DOUBLE_TAP = "dt2w_settings"
const val PREF_GLOVE_MODE = "glove_mode_settings"
const val PREF_BATTERY = "battery_settings"
const val PREF_SMARTCHARGE = "smartcharge_settings"
}
}

View file

@ -1,30 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.eurekateam.samsungextras
import android.os.Bundle
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
import com.android.settingslib.widget.R
class DeviceSettingsActivity : CollapsingToolbarBaseActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
supportFragmentManager.beginTransaction().replace(
R.id.content_frame,
DeviceSettings()
).commit()
}
}

View file

@ -1,176 +0,0 @@
package com.eurekateam.samsungextras
import android.os.Parcel
import android.os.ServiceManager
/*
* Copyright (C) 2020-2021 Samsung Electronics Co. Ltd
* This Class is based on Samsung's OneUI 3.1
* /system/frameworks/gamesdk.jar
*/
class SurfaceFlingerFPS private constructor() {
private var mFps: Double
private val mLock: Any = Any()
private var mPrevFPSCheckStartTime: Long
private var mPrevFlipCount: Int
private var mPrevFps: Double
private var running = false
private var mPrevPrevCheckStartTime: Long
private var mPrevPrevFlipCount: Int
@Volatile
private var mSkipUpdate = false
@Volatile
private var mStopThread = false
private var mThread: ThreadGetFlip? = null
/**
* Starts the thread
*/
fun start() {
synchronized(this) {
if (mThread == null || mStopThread) {
mStopThread = false
val threadGetFlip = ThreadGetFlip()
mThread = threadGetFlip
threadGetFlip.start()
running = true
}
}
}
/**
* Stops the thread
*/
fun stop() {
synchronized(this) {
mStopThread = true
if (mThread != null) {
mThread!!.interrupt()
}
mThread = null
running = false
}
}
/**
* Check if the fps monitor is able to start
* @return true if able to start, else false
*/
private val isAvailable: Boolean
get() = mStopThread || mThread == null
private fun updateCurrentFps() {
try {
synchronized(mLock) {
mSkipUpdate = true
val curTime = System.currentTimeMillis()
val curFlipCount = flipCount
mFps = if (curTime - mPrevFPSCheckStartTime < 200) {
(curFlipCount - mPrevPrevFlipCount).toDouble() / ((curTime - mPrevPrevCheckStartTime).toDouble() / 1000.0)
} else {
(curFlipCount - mPrevFlipCount).toDouble() / ((curTime - mPrevFPSCheckStartTime).toDouble() / 1000.0)
}
if (mFps < 1.0) {
mFps = mPrevFps
}
mPrevFlipCount = curFlipCount
mPrevFPSCheckStartTime = curTime
mPrevFps = mFps
mSkipUpdate = false
}
} catch (e: Exception) {
e.printStackTrace()
}
}
/**
* Gets the fps value from internal thread
* @return fps value in Double
*/
val fps: Double
get() {
if (isAvailable) {
return -999.0
}
updateCurrentFps()
return mFps
}
/**
* Gets the flip count from SurfaceFlinger Service
* @return flip count
*/
private val flipCount: Int
get() {
var flipCount = -1
try {
val data = Parcel.obtain()
val reply = Parcel.obtain()
try {
val surfaceFlinger = ServiceManager.getService("SurfaceFlinger")
data.writeInterfaceToken("android.ui.ISurfaceComposer")
if (surfaceFlinger != null && surfaceFlinger.transact(1013, data, reply, 0)) {
flipCount = reply.readInt()
}
} catch (e: Exception) {
e.printStackTrace()
}
data.recycle()
reply.recycle()
} catch (e2: Exception) {
e2.printStackTrace()
}
return flipCount
}
/* access modifiers changed from: private */
fun updateFlipCountRecord() {
try {
synchronized(mLock) {
mPrevPrevCheckStartTime = mPrevFPSCheckStartTime
mPrevPrevFlipCount = mPrevFlipCount
mPrevFPSCheckStartTime = System.currentTimeMillis()
mPrevFlipCount = flipCount
}
} catch (e: Exception) {
e.printStackTrace()
}
}
/* access modifiers changed from: private */ /* loaded from: classes.dex */
inner class ThreadGetFlip : Thread() {
// java.lang.Thread, java.lang.Runnable
override fun run() {
while (!mStopThread) {
if (!mSkipUpdate) {
updateFlipCountRecord()
try {
sleep(300)
} catch (e: InterruptedException) {
e.printStackTrace()
}
}
}
}
}
companion object {
/**
* Gets an instance of this class
* @return new instance
*/
val instance: SurfaceFlingerFPS
get() = SurfaceFlingerFPS()
}
init {
mFps = 0.0
mPrevFps = 0.0
mPrevFlipCount = 0
mPrevFPSCheckStartTime = 0
mPrevPrevFlipCount = 0
mPrevPrevCheckStartTime = 0
}
}

View file

@ -1,32 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.battery
import android.os.Bundle
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
import com.android.settingslib.widget.R
class BatteryActivity : CollapsingToolbarBaseActivity() {
private var mInstance : BatteryFragment? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (mInstance == null) mInstance = BatteryFragment()
supportFragmentManager.beginTransaction().replace(
R.id.content_frame,
mInstance!!
).commit()
}
}

View file

@ -1,122 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.battery
import android.content.SharedPreferences
import android.os.Bundle
import android.widget.Switch
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import androidx.preference.SwitchPreference
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.OnMainSwitchChangeListener
import com.eurekateam.samsungextras.R
import com.eurekateam.samsungextras.interfaces.Battery
import com.eurekateam.samsungextras.interfaces.BatteryIds
import java.util.concurrent.ScheduledThreadPoolExecutor
import java.util.concurrent.TimeUnit
class BatteryFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, OnMainSwitchChangeListener {
private lateinit var mFastChargePref: SwitchPreference
private var mPoolExecutor: ScheduledThreadPoolExecutor? = null
private lateinit var mChargePref: SwitchPreference
private lateinit var mShowDataPref: MainSwitchPreference
private lateinit var mSharedPreferences: SharedPreferences
private val mBattery = Battery()
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.battery_settings)
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
mFastChargePref = findPreference(PREF_FASTCHARGE)!!
mFastChargePref.onPreferenceChangeListener = this
mFastChargePref.isChecked = mSharedPreferences.getBoolean(PREF_FASTCHARGE, true)
mChargePref = findPreference(PREF_CHARGE)!!
mChargePref.onPreferenceChangeListener = this
mChargePref.isChecked = mSharedPreferences.getBoolean(PREF_CHARGE, true)
mShowDataPref = findPreference(PREF_SHOW_DATA)!!
mShowDataPref.isChecked = mSharedPreferences.getBoolean(PREF_SHOW_DATA, true)
mShowDataPref.addOnSwitchChangeListener(this)
if (mShowDataPref.isChecked) {
mPoolExecutor = ScheduledThreadPoolExecutor(3)
mPoolExecutor!!.scheduleWithFixedDelay(mScheduler, 0, 2, TimeUnit.SECONDS)
}
}
override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
if (preference == mChargePref) {
mBattery.Charge = newValue as Boolean
mChargePref.isChecked = mBattery.Charge
mSharedPreferences.edit().putBoolean(PREF_CHARGE, mBattery.Charge).apply()
return true
} else if (preference == mFastChargePref) {
mBattery.FastCharge = newValue as Boolean
mFastChargePref.isChecked = mBattery.FastCharge
mSharedPreferences.edit().putBoolean(PREF_FASTCHARGE, mBattery.FastCharge).apply()
return true
}
return false
}
private val mScheduler = Runnable {
requireActivity().runOnUiThread {
findPreference<Preference>(INFO_MAX_CAP)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_CAPACITY_MAX).toString() + " mAh"
findPreference<Preference>(INFO_CHARGED_UP_TO)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_CAPACITY_CURRENT).toString() + " %"
findPreference<Preference>(INFO_CHARGED_MAH)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_CAPACITY_CURRENT_MAH).toString() + " mAh"
findPreference<Preference>(INFO_CURRENT)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_CURRENT).toString() + " mA"
findPreference<Preference>(INFO_STATUS)!!.summary = if (mBattery.getGeneralBatteryStats(BatteryIds.CHARGING_STATE) == 1) "Charging" else "Discharging"
findPreference<Preference>(INFO_TEMP)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_TEMP).toString() + " \u2103"
}
}
override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
if (isChecked) {
if (mPoolExecutor == null) {
mPoolExecutor = ScheduledThreadPoolExecutor(2)
mPoolExecutor!!.scheduleWithFixedDelay(
mScheduler,
0,
2,
TimeUnit.SECONDS
)
}
} else {
if (mPoolExecutor != null) {
mPoolExecutor!!.shutdown()
mPoolExecutor = null
}
val mNotShown = requireContext().getString(R.string.not_shown)
findPreference<Preference>(INFO_MAX_CAP)!!.summary = mNotShown
findPreference<Preference>(INFO_CHARGED_UP_TO)!!.summary = mNotShown
findPreference<Preference>(INFO_CHARGED_MAH)!!.summary = mNotShown
findPreference<Preference>(INFO_CURRENT)!!.summary = mNotShown
findPreference<Preference>(INFO_STATUS)!!.summary = mNotShown
findPreference<Preference>(INFO_TEMP)!!.summary = mNotShown
}
mSharedPreferences.edit().putBoolean(PREF_SHOW_DATA, isChecked).apply()
}
companion object {
const val PREF_FASTCHARGE = "fastcharge_pref"
const val PREF_CHARGE = "charge_pref"
const val INFO_MAX_CAP = "battery_capacity"
const val INFO_CHARGED_UP_TO = "battery_charged_up_to"
const val INFO_CHARGED_MAH = "battery_charged_up_to_mah"
const val INFO_CURRENT = "battery_current"
const val INFO_STATUS = "battery_status"
const val INFO_TEMP = "battery_temp"
const val PREF_SHOW_DATA = "show_data"
private const val BATTERY_INFO = "battery_info"
}
}

View file

@ -1,33 +0,0 @@
/*
* Copyright (C) 2022 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.dolby
import android.os.Bundle
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
import com.android.settingslib.widget.R
class DolbyActivity : CollapsingToolbarBaseActivity() {
private var mInstance : DolbyFragment? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (mInstance == null) mInstance = DolbyFragment()
supportFragmentManager.beginTransaction().replace(
R.id.content_frame,
mInstance!!
).commit()
}
}

View file

@ -1,73 +0,0 @@
/*
* Copyright (C) 2022 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.dolby
import android.content.Context
import android.media.audiofx.AudioEffect
import com.eurekateam.samsungextras.dolby.DolbyFragment.Companion.PREF_DOLBY_MODES
import java.util.UUID
object DolbyCore {
private const val EFFECT_PARAM_PROFILE = 0
private const val EFFECT_PARAM_EFF_ENAB = 19
private val EFFECT_TYPE_DAP = UUID.fromString("46d279d9-9be7-453d-9d7c-ef937f675587")
const val PROFILE_AUTO = 0
const val PROFILE_MOVIE = 1
const val PROFILE_MUSIC = 2
const val PROFILE_VOICE = 3
const val PROFILE_GAME = 4
const val PROFILE_OFF = 5
const val PROFILE_GAME_1 = 6
const val PROFILE_GAME_2 = 7
const val PROFILE_SPACIAL_AUDIO = 8
private val audioEffect = runCatching {
AudioEffect(EFFECT_TYPE_DAP, AudioEffect.EFFECT_TYPE_NULL, 0, 0)
}.getOrNull()
fun getProfile(): Int {
val out = intArrayOf(PROFILE_AUTO)
audioEffect?.getParameter(EFFECT_PARAM_PROFILE, out)
return out.first().coerceIn(PROFILE_AUTO, PROFILE_SPACIAL_AUDIO)
}
fun getProfileName(context: Context): String {
val profile = getProfile()
val resourceName = PREF_DOLBY_MODES.filter { it.value == profile }.keys.first()
return context.resources.getString(
context.resources.getIdentifier(
resourceName,
"string",
context.packageName
)
)
}
fun setProfile(profile: Int) {
audioEffect?.setParameter(EFFECT_PARAM_EFF_ENAB, 1)
audioEffect?.setParameter(EFFECT_PARAM_PROFILE, profile)
}
fun setEnabled(enabled: Boolean) {
audioEffect?.enabled = enabled
}
fun isEnabled() = audioEffect?.enabled ?: false
}

View file

@ -1,79 +0,0 @@
/*
* Copyright (C) 2022 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.dolby
import android.content.SharedPreferences
import android.os.Bundle
import android.widget.Switch
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.OnMainSwitchChangeListener
import com.android.settingslib.widget.RadioButtonPreference
import com.eurekateam.samsungextras.R
class DolbyFragment : PreferenceFragmentCompat(), OnMainSwitchChangeListener {
private lateinit var switchBar: MainSwitchPreference
private lateinit var mSharedPreferences: SharedPreferences
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.dolby_settings)
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
switchBar = findPreference<MainSwitchPreference>(PREF_DOLBY_ENABLE)!!
switchBar.addOnSwitchChangeListener(this)
switchBar.isChecked = DolbyCore.isEnabled()
for ((key, value) in PREF_DOLBY_MODES) {
val preference = findPreference<RadioButtonPreference>(key)!!
preference.setOnPreferenceClickListener {
setProfile(value)
true
}
}
}
override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
DolbyCore.setEnabled(isChecked)
mSharedPreferences.edit().putBoolean(PREF_DOLBY_ENABLE, true).apply()
}
private fun setProfile(profile: Int) {
DolbyCore.setProfile(profile)
for ((key, value) in PREF_DOLBY_MODES) {
val preference = findPreference<RadioButtonPreference>(key)!!
preference.isChecked = value == profile
}
mSharedPreferences.edit().putInt(PREF_DOLBY_PROFILE, profile).apply()
}
companion object {
const val PREF_DOLBY_ENABLE = "dolby_enable"
const val PREF_DOLBY_PROFILE = "dolby_profile"
val PREF_DOLBY_MODES = mapOf(
"dolby_profile_auto" to DolbyCore.PROFILE_AUTO,
"dolby_profile_movie" to DolbyCore.PROFILE_MOVIE,
"dolby_profile_music" to DolbyCore.PROFILE_MUSIC,
"dolby_profile_voice" to DolbyCore.PROFILE_VOICE,
"dolby_profile_game" to DolbyCore.PROFILE_GAME,
"dolby_profile_off" to DolbyCore.PROFILE_OFF,
"dolby_profile_game_1" to DolbyCore.PROFILE_GAME_1,
"dolby_profile_game_2" to DolbyCore.PROFILE_GAME_2,
"dolby_profile_spacial_audio" to DolbyCore.PROFILE_SPACIAL_AUDIO
)
}
}

View file

@ -1,78 +0,0 @@
/*
* Copyright (C) 2022 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.dolby
import android.database.Cursor
import android.database.MatrixCursor
import android.provider.SearchIndexableResource
import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_CLASS_NAME
import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_ICON_RESID
import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_ACTION
import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS
import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE
import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RANK
import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RESID
import android.provider.SearchIndexablesContract.INDEXABLES_RAW_COLUMNS
import android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS
import android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS
import android.provider.SearchIndexablesProvider
import com.eurekateam.samsungextras.R
class DolbySearchIndexablesProvider : SearchIndexablesProvider() {
override fun onCreate(): Boolean = true
override fun queryXmlResources(projection: Array<String?>?): Cursor {
val cursor = MatrixCursor(INDEXABLES_XML_RES_COLUMNS)
INDEXABLE_RES.forEach {
cursor.addRow(generateResourceRef(it))
}
return cursor
}
override fun queryRawData(projection: Array<String?>?): Cursor {
return MatrixCursor(INDEXABLES_RAW_COLUMNS)
}
override fun queryNonIndexableKeys(projection: Array<String?>?): Cursor {
return MatrixCursor(NON_INDEXABLES_KEYS_COLUMNS)
}
private fun generateResourceRef(sir: SearchIndexableResource): Array<Any?> {
val ref = arrayOfNulls<Any>(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] = "com.eurekateam.samsungextras.dolby"
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className
return ref
}
companion object {
private const val TAG = "DolbySearchIndexablesProvider"
private val INDEXABLE_RES = arrayOf<SearchIndexableResource>(
SearchIndexableResource(
1,
R.xml.dolby_settings,
DolbyActivity::class.java.name,
0
)
)
}
}

View file

@ -1,46 +0,0 @@
/*
* Copyright (C) 2022 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.dolby
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import androidx.preference.PreferenceManager
import com.eurekateam.samsungextras.dolby.DolbyFragment.Companion.PREF_DOLBY_ENABLE
class DolbyTile : TileService() {
private var isEnabled = false
set(value) {
field = value
qsTile.state = if (value) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE
qsTile.subtitle = DolbyCore.getProfileName(this)
qsTile.updateTile()
}
override fun onStartListening() {
super.onStartListening()
isEnabled = DolbyCore.isEnabled()
}
override fun onClick() {
isEnabled = !isEnabled
DolbyCore.setEnabled(isEnabled)
PreferenceManager.getDefaultSharedPreferences(this)
.edit()
.putBoolean(PREF_DOLBY_ENABLE, isEnabled)
.apply()
}
}

View file

@ -1,32 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.flashlight
import android.os.Bundle
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
import com.android.settingslib.widget.R
class FlashLightActivity : CollapsingToolbarBaseActivity() {
private var mInstance : FlashLightFragment? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (mInstance == null) mInstance = FlashLightFragment()
supportFragmentManager.beginTransaction().replace(
R.id.content_frame,
mInstance!!
).commit()
}
}

View file

@ -1,72 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.flashlight
import android.content.SharedPreferences
import android.os.Build
import android.os.Bundle
import android.widget.Switch
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import androidx.preference.SeekBarPreference
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.OnMainSwitchChangeListener
import com.eurekateam.samsungextras.R
import com.eurekateam.samsungextras.interfaces.FlashLight
class FlashLightFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, OnMainSwitchChangeListener {
private lateinit var mFlashLightPref: SeekBarPreference
private lateinit var mSharedPreferences: SharedPreferences
private lateinit var mFlashLightEnable: MainSwitchPreference
private val mFlashLight = FlashLight()
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.flashlight_settings)
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
mFlashLightPref = findPreference(PREF_FLASHLIGHT)!!
mFlashLightPref.onPreferenceChangeListener = this
mFlashLightPref.setMax(10)
mFlashLightPref.setMin(1)
mFlashLightPref.value = mFlashLight.getFlash(Build.DEVICE.contains("a10"))
mFlashLightPref.showSeekBarValue = true
mFlashLightEnable = findPreference(PREF_FLASHLIGHT_ENABLE)!!
mFlashLightEnable.isChecked = mSharedPreferences.getBoolean(PREF_FLASHLIGHT_ENABLE, true)
mFlashLightEnable.addOnSwitchChangeListener(this)
mFlashLightPref.isEnabled = mFlashLightEnable.isChecked
}
override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
if (preference == mFlashLightPref) {
val value = newValue as Int
mFlashLight.setFlash(value)
mSharedPreferences.edit().putInt(PREF_FLASHLIGHT, value).apply()
return true
}
return false
}
override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
mFlashLight.setEnabled(isChecked)
mSharedPreferences.edit().putBoolean(PREF_FLASHLIGHT_ENABLE, isChecked)
mFlashLightPref.isEnabled = isChecked
}
companion object {
const val PREF_FLASHLIGHT = "flashlight_pref"
const val PREF_FLASHLIGHT_ENABLE = "flashlight_enable"
}
}

View file

@ -1,253 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.fps
import android.app.Service
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.graphics.*
import android.os.*
import android.service.dreams.DreamService
import android.service.dreams.IDreamManager
import android.util.Log
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.eurekateam.samsungextras.SurfaceFlingerFPS
import kotlin.math.roundToInt
open class FPSInfoService : Service() {
private var mView: View? = null
private var mCurFPSThread: Thread? = null
private val TAG = "FPSInfoService"
private var fPSInfoString: String? = null
private var mDreamManager: IDreamManager? = null
private inner class FPSView(c: Context) : View(c) {
private val mOnlinePaint: Paint?
private val mAscent: Float
private var mMaxWidth = 0
private var mNeededWidth = 0
private var mNeededHeight = 0
private var mDataAvail = false
private val mCurFPSHandler: Handler = object : Handler(Looper.getMainLooper()) {
override fun handleMessage(msg: Message) {
if (msg.obj == null || msg.what != 1) {
return
}
val msgData = msg.obj as String
fPSInfoString = "$msgData FPS"
mDataAvail = true
updateDisplay()
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
mCurFPSHandler.removeMessages(1)
}
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
setMeasuredDimension(
resolveSize(mNeededWidth, widthMeasureSpec),
resolveSize(mNeededHeight, heightMeasureSpec)
)
}
public override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
if (!mDataAvail) {
return
}
val LEFT = width - 1
val y = mPaddingTop - mAscent.toInt()
val s = fPSInfoString
canvas.drawText(
s,
(LEFT - mPaddingLeft - mMaxWidth).toFloat(),
(
y - 1
).toFloat(),
mOnlinePaint
)
}
fun updateDisplay() {
if (!mDataAvail) {
return
}
if (mOnlinePaint != null) {
mMaxWidth = mOnlinePaint.measureText(fPSInfoString).toInt()
}
val neededWidth = mPaddingLeft + mPaddingRight + mMaxWidth
val neededHeight = mPaddingTop + mPaddingBottom + 40
if (neededWidth != mNeededWidth || neededHeight != mNeededHeight) {
mNeededWidth = neededWidth
mNeededHeight = neededHeight
requestLayout()
} else {
invalidate()
}
}
override fun getHandler(): Handler {
return mCurFPSHandler
}
init {
val density = c.resources.displayMetrics.density
val paddingPx = (5 * density).roundToInt()
setPadding(paddingPx, paddingPx, paddingPx, paddingPx)
setBackgroundColor(Color.argb(0x60, 0, 0, 0))
val textSize = (12 * density).roundToInt()
val typeface = Typeface.create("monospace", Typeface.NORMAL)
mOnlinePaint = Paint()
mOnlinePaint.typeface = typeface
mOnlinePaint.isAntiAlias = true
mOnlinePaint.textSize = textSize.toFloat()
mOnlinePaint.color = Color.WHITE
mOnlinePaint.setShadowLayer(5.0f, 0.0f, 0.0f, Color.BLACK)
mAscent = mOnlinePaint.ascent()
mOnlinePaint.descent()
updateDisplay()
}
}
/**
* Thead to monitor fps
*/
protected class CurFPSThread(private val mHandler: Handler) : Thread() {
private var mInterrupt = false
override fun interrupt() {
mInterrupt = true
}
override fun run() {
try {
while (!mInterrupt) {
sleep(500)
StringBuilder()
val fpsVal = surfaceFlingerFPS?.fps?.roundToInt().toString()
mHandler.sendMessage(mHandler.obtainMessage(1, fpsVal))
}
} catch (ignored: InterruptedException) {
}
}
}
override fun onCreate() {
super.onCreate()
mView = FPSView(this)
val params = WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
PixelFormat.TRANSLUCENT
)
params.y = 50
params.gravity = Gravity.START or Gravity.TOP
params.title = "FPS Info"
surfaceFlingerFPS = SurfaceFlingerFPS.instance
startThread()
mDreamManager = IDreamManager.Stub.asInterface(
ServiceManager.checkService(DreamService.DREAM_SERVICE)
)
val screenStateFilter = IntentFilter(Intent.ACTION_SCREEN_ON)
screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF)
registerReceiver(mScreenStateReceiver, screenStateFilter)
val wm = getSystemService(WINDOW_SERVICE) as WindowManager
wm.addView(mView, params)
}
override fun onDestroy() {
super.onDestroy()
stopThread()
(getSystemService(WINDOW_SERVICE) as WindowManager).removeView(mView)
mView = null
unregisterReceiver(mScreenStateReceiver)
}
override fun onBind(intent: Intent): IBinder? {
return null
}
private val mScreenStateReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == Intent.ACTION_SCREEN_ON) {
Log.d(TAG, "ACTION_SCREEN_ON $isDozeMode")
if (!isDozeMode) {
startThread()
mView!!.visibility = View.VISIBLE
}
} else if (intent.action == Intent.ACTION_SCREEN_OFF) {
Log.d(TAG, "ACTION_SCREEN_OFF")
mView!!.visibility = View.GONE
stopThread()
}
}
}
/**
* Find is the device is in doze mode
* @return true if device is in doze mode, else false
*/
private val isDozeMode: Boolean
get() {
try {
if (mDreamManager != null && mDreamManager!!.isDreaming) {
return true
}
} catch (e: RemoteException) {
return false
}
return false
}
private fun startThread() {
Log.d(TAG, "started CurFPSThread")
mRunning = true
mCurFPSThread = CurFPSThread(mView!!.handler)
surfaceFlingerFPS!!.start()
mCurFPSThread?.start()
}
private fun stopThread() {
if (mCurFPSThread != null && mCurFPSThread!!.isAlive) {
Log.d(TAG, "stopping CurFPSThread")
surfaceFlingerFPS!!.stop()
mCurFPSThread!!.interrupt()
try {
mCurFPSThread!!.join()
} catch (e: InterruptedException) {
e.printStackTrace()
}
}
mRunning = false
mCurFPSThread = null
}
fun getRunning(): Boolean {
return mRunning
}
companion object {
private var surfaceFlingerFPS: SurfaceFlingerFPS? = null
private var mRunning: Boolean = false
}
}

View file

@ -1,46 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.fps
import android.content.Intent
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
// TODO: Add FPS drawables
class FPSTileService : TileService() {
private lateinit var fpsinfo: Intent
private var isShowing = false
override fun onStartListening() {
super.onStartListening()
fpsinfo = Intent(this, FPSInfoService::class.java)
val fpsInfoService = FPSInfoService()
isShowing = fpsInfoService.getRunning()
updateTile()
}
override fun onClick() {
if (!isShowing) startService(fpsinfo) else stopService(fpsinfo)
isShowing = !isShowing
updateTile()
}
private fun updateTile() {
val tile = qsTile
tile.state =
if (isShowing) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE
tile.updateTile()
}
}

View file

@ -1,53 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.interfaces
import android.os.ServiceManager
import vendor.eureka.hardware.parts.BatterySys
import vendor.eureka.hardware.parts.IBatteryStats
class Battery {
private val mBattery: IBatteryStats
init {
mBattery = IBatteryStats.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.IBatteryStats/default"))
}
var Charge: Boolean
get() {
return mBattery.getBatteryStats(BatterySys.CHARGE) == 0
}
set(k) {
mBattery.setBatteryWritable(BatterySys.CHARGE, !k)
}
var FastCharge: Boolean
get() {
return mBattery.getBatteryStats(BatterySys.FASTCHARGE) == 0
}
set(k) {
mBattery.setBatteryWritable(BatterySys.FASTCHARGE, !k)
}
fun getGeneralBatteryStats(id: BatteryIds): Int = when (id) {
BatteryIds.BATTERY_CAPACITY_MAX -> mBattery.getBatteryStats(BatterySys.CAPACITY_MAX) / 1000
BatteryIds.BATTERY_CAPACITY_CURRENT -> mBattery.getBatteryStats(BatterySys.CAPACITY_CURRENT)
BatteryIds.BATTERY_CAPACITY_CURRENT_MAH -> (mBattery.getBatteryStats(BatterySys.CAPACITY_CURRENT).toFloat() * mBattery.getBatteryStats(BatterySys.CAPACITY_MAX).toFloat() / 100000).toInt()
BatteryIds.CHARGING_STATE -> if (mBattery.getBatteryStats(BatterySys.CURRENT) > 0) 1 else 0
BatteryIds.BATTERY_TEMP -> mBattery.getBatteryStats(BatterySys.TEMP) / 10
BatteryIds.BATTERY_CURRENT -> mBattery.getBatteryStats(BatterySys.CURRENT)
}
}

View file

@ -1,10 +0,0 @@
package com.eurekateam.samsungextras.interfaces
enum class BatteryIds {
BATTERY_CAPACITY_MAX,
BATTERY_CAPACITY_CURRENT,
BATTERY_CAPACITY_CURRENT_MAH,
CHARGING_STATE,
BATTERY_TEMP,
BATTERY_CURRENT
}

View file

@ -1,35 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.interfaces
import android.os.ServiceManager
import vendor.eureka.hardware.parts.DisplaySys
import vendor.eureka.hardware.parts.IDisplayConfigs
class Display {
private val mDisplay: IDisplayConfigs
init {
mDisplay = IDisplayConfigs.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.IDisplayConfigs/default"))
}
var DT2W: Boolean = false
set(k) = mDisplay.writeDisplay(k, DisplaySys.DOUBLE_TAP)
var GloveMode: Boolean = false
set(k) = mDisplay.writeDisplay(k, DisplaySys.GLOVE_MODE)
}

View file

@ -1,33 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.interfaces
import android.os.ServiceManager
import vendor.eureka.hardware.parts.IFlashBrightness
class FlashLight {
private val mFlash: IFlashBrightness
init {
mFlash = IFlashBrightness.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.IFlashBrightness/default"))
}
fun setFlash(value: Int) = mFlash.setFlashlightWritable(value)
fun getFlash(a10: Boolean): Int = mFlash.readFlashlightstats(!a10)
fun setEnabled(enable: Boolean) = mFlash.setFlashlightEnable(enable)
}

View file

@ -1,37 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.interfaces
import android.os.ServiceManager
import vendor.eureka.hardware.parts.ISmartCharge
class SmartCharge {
private val mSmartCharge: ISmartCharge
init {
mSmartCharge = ISmartCharge.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.ISmartCharge/default"))
}
fun start() = mSmartCharge.start()
fun stop() = mSmartCharge.stop()
fun setConfig(limit: Int, restart: Int) = mSmartCharge.setConfig(limit, restart)
fun getStats(type: StatsType): Int = when (type) {
StatsType.TYPE_LIMITED_CNT -> mSmartCharge.getLimitCnt()
StatsType.TYPE_RESTARTED_CNT -> mSmartCharge.getRestartCnt()
}
}

View file

@ -1,6 +0,0 @@
package com.eurekateam.samsungextras.interfaces
enum class StatsType {
TYPE_LIMITED_CNT,
TYPE_RESTARTED_CNT
}

View file

@ -1,35 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.interfaces
import android.os.ServiceManager
import vendor.eureka.hardware.parts.ISwapOnData
class Swap {
private val mSwap: ISwapOnData
init {
mSwap = ISwapOnData.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.ISwapOnData/default"))
}
external fun setSwapOn(mCallBackEnabled: Boolean)
fun setSwapOff() = mSwap.setSwapOff()
fun mkFile(mSize: Int) = mSwap.makeSwapFile(mSize)
fun delFile() = mSwap.removeSwapFile()
fun isLocked(): Boolean = mSwap.isMutexLocked()
external fun getFreeSpace(): Double
external fun getSwapSize(): Long
}

View file

@ -1,6 +0,0 @@
package com.eurekateam.samsungextras.smartcharge
enum class SelectedOption {
SELECTED_LIMIT,
SELECTED_RESTART
}

View file

@ -1,32 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.smartcharge
import android.os.Bundle
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
import com.android.settingslib.widget.R
class SmartChargeActivity : CollapsingToolbarBaseActivity() {
private var mInstance : SmartChargeFragment? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (mInstance == null) mInstance = SmartChargeFragment()
supportFragmentManager.beginTransaction().replace(
R.id.content_frame,
mInstance!!
).commit()
}
}

View file

@ -1,175 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.smartcharge
import android.content.SharedPreferences
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.View
import android.widget.Switch
import android.widget.Toast
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import androidx.preference.SeekBarPreference
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.OnMainSwitchChangeListener
import com.android.settingslib.widget.SelectorWithWidgetPreference
import com.eurekateam.samsungextras.R
import com.eurekateam.samsungextras.interfaces.StatsType
import com.eurekateam.samsungextras.interfaces.SmartCharge
import java.util.concurrent.ScheduledThreadPoolExecutor
import java.util.concurrent.TimeUnit
class SmartChargeFragment : PreferenceFragmentCompat(), OnMainSwitchChangeListener, Preference.OnPreferenceChangeListener, SelectorWithWidgetPreference.OnClickListener {
private lateinit var mLimit: SelectorWithWidgetPreference
private lateinit var mRestart: SelectorWithWidgetPreference
private lateinit var mSharedPreferences: SharedPreferences
private lateinit var mSmartChargeBtn: MainSwitchPreference
private lateinit var mAdjust: SeekBarPreference
private lateinit var mLimitShow: Preference
private lateinit var mRestartShow: Preference
private lateinit var mLimitStat: Preference
private lateinit var mRestartStat: Preference
private val mPoolExecutor = ScheduledThreadPoolExecutor(3)
private var mSelected = SelectedOption.SELECTED_LIMIT
private val mSmartCharge = SmartCharge()
private val mMainHandler = Handler(Looper.getMainLooper())
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.smartcharge_settings)
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
mSmartChargeBtn = findPreference(PREF_SMARTCHARGE_MAIN)!!
mAdjust = findPreference(PREF_ADJUST)!!
mLimit = findPreference(PREF_LIMIT_SELECT)!!
mRestart = findPreference(PREF_RESTART_SELECT)!!
mLimitShow = findPreference(PREF_LIMIT)!!
mRestartShow = findPreference(PREF_RESTART)!!
mLimitStat = findPreference(PREF_LIMIT_STAT)!!
mRestartStat = findPreference(PREF_RESTART_STAT)!!
mSmartChargeBtn.addOnSwitchChangeListener(this)
mSmartChargeBtn.isChecked = mSharedPreferences.getBoolean(PREF_SMARTCHARGE_MAIN, false)
mAdjust.min = 1
mAdjust.max = 5
mAdjust.value = 3
mAdjust.onPreferenceChangeListener = this
mLimit.setOnClickListener(this)
mRestart.setOnClickListener(this)
mLimitShow.summary = "${mSharedPreferences.getInt(PREF_LIMIT, 20)} %"
mRestartShow.summary = "${mSharedPreferences.getInt(PREF_RESTART, 80)} %"
if (!mRestart.isChecked) mLimit.isChecked = true
}
override fun onRadioButtonClicked(btn: SelectorWithWidgetPreference) {
when (btn) {
mLimit -> {
mSelected = SelectedOption.SELECTED_LIMIT
mMainHandler.post({ mLimit.isChecked = true })
mMainHandler.post({ mRestart.isChecked = false })
}
mRestart -> {
mSelected = SelectedOption.SELECTED_RESTART
mMainHandler.post({ mLimit.isChecked = false })
mMainHandler.post({ mRestart.isChecked = true })
}
else -> {}
}
}
private inline fun fromStringToNum(s: String): Int {
return if (s.contains("ten")) 10 else if (s.contains("one")) 1 else 0
}
private inline fun fromSelectedToId(): String = when (mSelected) {
SelectedOption.SELECTED_LIMIT -> PREF_LIMIT
SelectedOption.SELECTED_RESTART -> PREF_RESTART
}
override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
if (preference == mAdjust) {
var tmp = mSharedPreferences.getInt(fromSelectedToId(), 50)
val toAdd = when (newValue as Int) {
1 -> -10
2 -> -1
4 -> 1
5 -> 10
else -> 0
}
if (tmp + toAdd > 99) tmp = 99 else if (tmp + toAdd < 1) tmp = 1 else tmp += toAdd
mSharedPreferences.edit().putInt(fromSelectedToId(), tmp).apply()
when (mSelected) {
SelectedOption.SELECTED_LIMIT -> {
mLimitShow
}
SelectedOption.SELECTED_RESTART -> {
mRestartShow
}
}.summary = "$tmp %"
mMainHandler.post({ mAdjust.value = 3 })
return true
}
return false
}
private val mScheduler = Runnable {
requireActivity().runOnUiThread {
mLimitStat.summary = "${mSmartCharge.getStats(StatsType.TYPE_LIMITED_CNT)} times"
mRestartStat.summary = "${mSmartCharge.getStats(StatsType.TYPE_RESTARTED_CNT)} times"
}
}
override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
if (isChecked) {
val limit = mSharedPreferences.getInt(PREF_LIMIT, 80)
val restart = mSharedPreferences.getInt(PREF_RESTART, 20)
if (limit > restart) {
mSmartCharge.setConfig(limit, restart)
mMainHandler.post({
for (i in listOf(mAdjust, mLimit, mRestart))
i.isEnabled = false
})
} else {
Toast.makeText(requireContext(), "Limit percent should be bigger than restart percent", Toast.LENGTH_SHORT).show()
mMainHandler.post({ mSmartChargeBtn.isEnabled = false })
return
}
mSmartCharge.start()
mPoolExecutor.scheduleWithFixedDelay(mScheduler, 0, 3, TimeUnit.MINUTES)
} else {
mSmartCharge.stop()
mMainHandler.post({
for (i in listOf(mAdjust, mLimit, mRestart))
i.isEnabled = true
})
}
mSharedPreferences.edit().putBoolean(PREF_SMARTCHARGE_MAIN, isChecked).apply()
}
companion object {
const val PREF_SMARTCHARGE_MAIN = "smartcharge"
const val PREF_LIMIT_SELECT = "choose_limit"
const val PREF_RESTART_SELECT = "choose_restart"
const val PREF_LIMIT = "limit"
const val PREF_RESTART = "restart"
const val PREF_LIMIT_STAT = "limit_stat"
const val PREF_RESTART_STAT = "restart_stat"
const val PREF_ADJUST = "adjust"
}
}

View file

@ -1,32 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.speaker
import android.os.Bundle
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
import com.android.settingslib.widget.R
class ClearSpeakerActivity : CollapsingToolbarBaseActivity() {
private var mInstance : ClearSpeakerFragment? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (mInstance == null) mInstance = ClearSpeakerFragment()
supportFragmentManager.beginTransaction().replace(
R.id.content_frame,
mInstance!!
).commit()
}
}

View file

@ -1,101 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.speaker
import android.media.AudioManager
import android.media.MediaPlayer
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.widget.Switch
import androidx.preference.PreferenceFragmentCompat
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.OnMainSwitchChangeListener
import com.eurekateam.samsungextras.R
import java.io.IOException
class ClearSpeakerFragment : PreferenceFragmentCompat(), OnMainSwitchChangeListener {
private lateinit var mHandler: Handler
private lateinit var mMediaPlayer: MediaPlayer
private lateinit var mClearSpeakerPref: MainSwitchPreference
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.clear_speaker_settings)
mClearSpeakerPref = findPreference(PREF_CLEAR_SPEAKER)!!
mClearSpeakerPref.addOnSwitchChangeListener(this)
mHandler = Handler(Looper.getMainLooper())
}
override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
if (isChecked) {
if (startPlaying()) {
mHandler.removeCallbacksAndMessages(null)
mHandler.postDelayed({ stopPlaying() }, 30000)
}
}
}
override fun onStop() {
stopPlaying()
super.onStop()
}
/**
* Start playing speaker-clearing audio
* @return true on success, else false
*/
private fun startPlaying(): Boolean {
mMediaPlayer = MediaPlayer()
requireActivity().volumeControlStream = AudioManager.STREAM_MUSIC
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC)
mMediaPlayer.isLooping = true
try {
resources.openRawResourceFd(R.raw.clear_speaker_sound).use { file ->
mMediaPlayer.setDataSource(
file.fileDescriptor,
file.startOffset,
file.length
)
}
mClearSpeakerPref.isEnabled = false
mMediaPlayer.setVolume(1.0f, 1.0f)
mMediaPlayer.prepare()
mMediaPlayer.start()
} catch (ioe: IOException) {
Log.e(TAG, "Failed to play speaker clean sound!", ioe)
return false
}
return true
}
/**
* Stops and invalidates
*/
private fun stopPlaying() {
if (::mMediaPlayer.isInitialized) {
mMediaPlayer.stop()
mMediaPlayer.reset()
mMediaPlayer.release()
}
mClearSpeakerPref.isEnabled = true
mClearSpeakerPref.isChecked = false
}
companion object {
private val TAG = ClearSpeakerFragment::class.java.simpleName
private const val PREF_CLEAR_SPEAKER = "clear_speaker_pref"
}
}

View file

@ -1,32 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.swap
import android.os.Bundle
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
import com.android.settingslib.widget.R
class SwapActivity : CollapsingToolbarBaseActivity() {
private var mInstance : SwapFragment? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (mInstance == null) mInstance = SwapFragment()
supportFragmentManager.beginTransaction().replace(
R.id.content_frame,
mInstance!!
).commit()
}
}

View file

@ -1,110 +0,0 @@
/*
* Copyright (C) 2022 Eureka Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.eurekateam.samsungextras.swap
import android.content.SharedPreferences
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.widget.Switch
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import androidx.preference.SeekBarPreference
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.OnMainSwitchChangeListener
import com.eurekateam.samsungextras.R
import com.eurekateam.samsungextras.interfaces.Swap
import java.util.concurrent.ScheduledThreadPoolExecutor
import java.util.concurrent.TimeUnit
class SwapFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, OnMainSwitchChangeListener {
private lateinit var mSwapSizePref: SeekBarPreference
private lateinit var mSharedPreferences: SharedPreferences
private lateinit var mSwapEnable: MainSwitchPreference
private lateinit var mFreeSpace: Preference
private lateinit var mSwapFileSize: Preference
private var mPoolExecutor = ScheduledThreadPoolExecutor(3)
private var mSwapSize = 0
private val mSwap = Swap()
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.swap_settings)
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
mSwapSizePref = findPreference(PREF_SWAP_SIZE)!!
mSwapSizePref.onPreferenceChangeListener = this
mSwapSizePref.setMax(100)
mSwapSizePref.setMin(10)
mSwapSizePref.value = mSharedPreferences.getInt(PREF_SWAP_SIZE, 50)
mSwapEnable = findPreference(PREF_SWAP_ENABLE)!!
mSwapEnable.isChecked = mSharedPreferences.getBoolean(PREF_SWAP_ENABLE, false)
mSwapEnable.addOnSwitchChangeListener(this)
mSwapSizePref.isEnabled = !mSwapEnable.isChecked
mSwapSizePref.showSeekBarValue = true
mFreeSpace = findPreference(INFO_FREE_SPACE)!!
mFreeSpace.summary = "${mSwap.getFreeSpace()} GB"
mSwapFileSize = findPreference(INFO_SWAP_FILE_SIZE)!!
mSwapFileSize.summary = "${mSwap.getSwapSize()} MB"
mPoolExecutor.scheduleWithFixedDelay(mScheduler, 0, 3, TimeUnit.SECONDS)
}
private val mScheduler = Runnable { requireActivity().runOnUiThread {
mSwapEnable.isEnabled = !mSwap.isLocked()
mFreeSpace.summary = "${mSwap.getFreeSpace()} GB"
mSwapFileSize.summary = "${mSwap.getSwapSize()} MB"
} }
override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
if (preference == mSwapSizePref) {
val value = newValue as Int
mSwapSize = value
mSharedPreferences.edit().putInt(PREF_SWAP_SIZE, value).apply()
return true
}
return false
}
// This is called from native - DO NOT CHANGE SIGNATURE
fun reactToCallbackNative(res: Boolean) {
if (!res) {
mSwap.delFile()
mSharedPreferences.edit().putBoolean(PREF_SWAP_ENABLE, false).apply()
mSwapSizePref.isEnabled = true
}
}
override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
mSwapEnable.isEnabled = false
val mSwap = Swap()
if (isChecked) {
mSwap.mkFile(mSwapSize)
mSwap.setSwapOn(true)
} else {
mSwap.setSwapOff()
mSwap.delFile()
}
mSwapEnable.isEnabled = true
mSharedPreferences.edit().putBoolean(PREF_SWAP_ENABLE, isChecked).apply()
mSwapSizePref.isEnabled = !isChecked
}
companion object {
const val PREF_SWAP_SIZE = "swap_size"
const val PREF_SWAP_ENABLE = "swap_enable"
const val INFO_FREE_SPACE = "free_space"
const val INFO_SWAP_FILE_SIZE = "swap_file_size"
}
}

View file

@ -1,26 +0,0 @@
aidl_interface {
name: "vendor.eureka.hardware.parts",
srcs: ["vendor/eureka/hardware/parts/*.aidl"],
stability: "vintf",
owner: "Eureka Team",
backend: {
ndk: {
enabled: true,
},
java: {
platform_apis: true,
},
},
versions_with_info: [
{
version: "1",
imports: [],
},
{
version: "2",
imports: [],
},
],
}

View file

@ -1 +0,0 @@
48bdd89bd2780de4c4254e0d52a8c4e53e416d00

View file

@ -1,26 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package vendor.eureka.hardware.parts;
@Backing(type="int")
@VintfStability
enum BatterySys {
CAPACITY_MAX,
TEMP,
CAPACITY_CURRENT,
CURRENT,
FASTCHARGE,
CHARGE,
}

View file

@ -1,22 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package vendor.eureka.hardware.parts;
@Backing(type="int")
@VintfStability
enum DisplaySys {
DOUBLE_TAP,
GLOVE_MODE,
}

View file

@ -1,24 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package vendor.eureka.hardware.parts;
import vendor.eureka.hardware.parts.BatterySys;
@VintfStability
interface IBatteryStats {
int getBatteryStats(in BatterySys stats);
oneway void setBatteryWritable(in BatterySys stats, in boolean value);
}

View file

@ -1,20 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package vendor.eureka.hardware.parts;
@VintfStability
interface IBoolCallback {
void respondToBool(in boolean result);
}

View file

@ -1,22 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package vendor.eureka.hardware.parts;
import vendor.eureka.hardware.parts.DisplaySys;
@VintfStability
interface IDisplayConfigs {
oneway void writeDisplay(in boolean enable, in DisplaySys type);
}

View file

@ -1,24 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package vendor.eureka.hardware.parts;
@VintfStability
interface IFlashBrightness {
int readFlashlightstats(in boolean s2mu106);
oneway void setFlashlightEnable(in boolean enable);
oneway void setFlashlightWritable(in int value);
}

View file

@ -1,28 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package vendor.eureka.hardware.parts;
@VintfStability
interface ISmartCharge {
int getLimitCnt();
int getRestartCnt();
oneway void setConfig(in int limit, in int restart);
oneway void start();
oneway void stop();
}

View file

@ -1,31 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package vendor.eureka.hardware.parts;
import vendor.eureka.hardware.parts.IBoolCallback;
@VintfStability
interface ISwapOnData {
boolean isMutexLocked();
oneway void removeSwapFile();
oneway void setSwapOff();
oneway void setSwapOn(in IBoolCallback cb);
oneway void makeSwapFile(in int size);
}

View file

@ -1 +0,0 @@
dad5105afc869ca8a3c4621e51c4e575b1425e0c

View file

@ -1,41 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@Backing(type="int") @VintfStability
enum BatterySys {
CAPACITY_MAX = 0,
TEMP = 1,
CAPACITY_CURRENT = 2,
CURRENT = 3,
FASTCHARGE = 4,
CHARGE = 5,
}

View file

@ -1,37 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@Backing(type="int") @VintfStability
enum DisplaySys {
DOUBLE_TAP = 0,
GLOVE_MODE = 1,
}

View file

@ -1,37 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface IBatteryStats {
int getBatteryStats(in vendor.eureka.hardware.parts.BatterySys stats);
oneway void setBatteryWritable(in vendor.eureka.hardware.parts.BatterySys stats, in boolean value);
}

View file

@ -1,36 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface IBoolCallback {
void respondToBool(in boolean result);
}

View file

@ -1,37 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface IDisplayConfigs {
oneway void writeDisplay(in boolean enable, in vendor.eureka.hardware.parts.DisplaySys type);
boolean readDisplay(in vendor.eureka.hardware.parts.DisplaySys type);
}

View file

@ -1,38 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface IFlashBrightness {
int readFlashlightstats(in boolean s2mu106);
oneway void setFlashlightEnable(in boolean enable);
oneway void setFlashlightWritable(in int value);
}

View file

@ -1,40 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface ISmartCharge {
int getLimitCnt();
int getRestartCnt();
oneway void setConfig(in int limit, in int restart);
oneway void start();
oneway void stop();
}

View file

@ -1,40 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface ISwapOnData {
boolean isMutexLocked();
oneway void removeSwapFile();
oneway void setSwapOff();
oneway void setSwapOn(in vendor.eureka.hardware.parts.IBoolCallback cb);
oneway void makeSwapFile(in int size);
}

View file

@ -1,41 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@Backing(type="int") @VintfStability
enum BatterySys {
CAPACITY_MAX = 0,
TEMP = 1,
CAPACITY_CURRENT = 2,
CURRENT = 3,
FASTCHARGE = 4,
CHARGE = 5,
}

View file

@ -1,37 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@Backing(type="int") @VintfStability
enum DisplaySys {
DOUBLE_TAP = 0,
GLOVE_MODE = 1,
}

View file

@ -1,37 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface IBatteryStats {
int getBatteryStats(in vendor.eureka.hardware.parts.BatterySys stats);
oneway void setBatteryWritable(in vendor.eureka.hardware.parts.BatterySys stats, in boolean value);
}

View file

@ -1,36 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface IBoolCallback {
void respondToBool(in boolean result);
}

View file

@ -1,37 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface IDisplayConfigs {
oneway void writeDisplay(in boolean enable, in vendor.eureka.hardware.parts.DisplaySys type);
boolean readDisplay(in vendor.eureka.hardware.parts.DisplaySys type);
}

View file

@ -1,38 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface IFlashBrightness {
int readFlashlightstats(in boolean s2mu106);
oneway void setFlashlightEnable(in boolean enable);
oneway void setFlashlightWritable(in int value);
}

View file

@ -1,40 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface ISmartCharge {
int getLimitCnt();
int getRestartCnt();
oneway void setConfig(in int limit, in int restart);
oneway void start();
oneway void stop();
}

View file

@ -1,40 +0,0 @@
// Copyright (C) 2022 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.eureka.hardware.parts;
@VintfStability
interface ISwapOnData {
boolean isMutexLocked();
oneway void removeSwapFile();
oneway void setSwapOff();
oneway void setSwapOn(in vendor.eureka.hardware.parts.IBoolCallback cb);
oneway void makeSwapFile(in int size);
}

View file

@ -1,20 +0,0 @@
cc_binary {
name: "vendor.eureka.hardware.parts-service",
srcs: [
"Battery.cpp",
"FlashLight.cpp",
"Display.cpp",
"Swap.cpp",
"SmartCharge.cpp",
"service.cpp",
],
shared_libs: [
"libbase",
"libbinder_ndk",
"libfileio",
"vendor.eureka.hardware.parts-V1-ndk",
],
header_libs: ["logformat"],
init_rc: ["vendor.eureka.hardware.parts-service.rc"],
vintf_fragments: ["vendor.eureka.hardware.parts.xml"],
}

View file

@ -1,56 +0,0 @@
// Copyright (C) 2021 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <unistd.h>
#include "Battery.h"
#include "BatteryConstants.h"
#include <FileIO.h>
namespace aidl::vendor::eureka::hardware::parts {
static inline const char *BatterySysToPath(BatterySys type) {
switch (type) {
case BatterySys::CAPACITY_MAX:
return BATTERY_CAPACITY_MAX;
case BatterySys::TEMP:
return BATTERY_TEMP;
case BatterySys::CAPACITY_CURRENT:
return BATTERY_CAPACITY_CURRENT;
case BatterySys::CURRENT:
return BATTERY_CURRENT;
case BatterySys::FASTCHARGE:
return BATTERY_FASTCHARGE;
case BatterySys::CHARGE:
return BATTERY_CHARGE;
default:
return "";
}
}
// Methods from ::android::hardware::battery::V1_0::IBattery follow.
::ndk::ScopedAStatus BatteryStats::getBatteryStats(BatterySys stats,
int32_t *_aidl_return) {
*_aidl_return = FileIO::readint(BatterySysToPath(stats));
return ::ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus BatteryStats::setBatteryWritable(BatterySys stats,
bool value) {
FileIO::writeline(BatterySysToPath(stats), value ? 1 : 0);
return ::ndk::ScopedAStatus::ok();
}
} // namespace aidl::vendor::eureka::hardware::parts

View file

@ -1,32 +0,0 @@
// Copyright (C) 2021 Eureka Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <aidl/vendor/eureka/hardware/parts/BnBatteryStats.h>
#define ANDROID_SYSTEM_UID 1000
#define ANDROID_ROOT_UID 0
namespace aidl::vendor::eureka::hardware::parts {
struct BatteryStats : public BnBatteryStats {
// Methods from ::aidl::::vendor::eureka::hardware::parts::IBatteryStats
// follow.
::ndk::ScopedAStatus getBatteryStats(BatterySys stats,
int32_t *_aidl_return) override;
::ndk::ScopedAStatus setBatteryWritable(BatterySys stats,
bool value) override;
};
} // namespace aidl::vendor::eureka::hardware::parts

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