From ef97fdeb7779030dd545a5752377a6ef80140da7 Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Wed, 12 Oct 2022 01:54:08 +0900 Subject: [PATCH] universal7885: parts-aidl: Just send callback through setSwapOn() - Set callback on JNI, since Java class cant be sent through, use the ndk backend to implement callback and send to swapon() --- .../apps/SamsungParts/Android.bp | 5 ++- .../apps/SamsungParts/jni/Android.bp | 19 ++++++++-- .../SamsungParts/jni/SwapCallbackImpl.cpp | 21 +++++++++++ .../apps/SamsungParts/jni/SwapCallbackImpl.h | 36 +++++++++++++++++++ .../SamsungParts/jni/SwapCallbackNative.cpp | 12 +++++++ .../eurekateam/samsungextras/BootReceiver.kt | 8 +++-- .../samsungextras/DeviceSettings.kt | 3 +- .../samsungextras/interfaces/Swap.kt | 4 ++- .../samsungextras/swap/SwapFragment.kt | 20 +++++++++-- .../vendor.eureka.hardware.parts/1/.hash | 2 +- .../eureka/hardware/parts/IBoolCallback.aidl | 20 +++++++++++ .../eureka/hardware/parts/ISwapOnData.aidl | 5 +-- .../eureka/hardware/parts/IBoolCallback.aidl | 36 +++++++++++++++++++ .../eureka/hardware/parts/ISwapOnData.aidl | 3 +- .../apps/aidl-support/parts/default/Swap.cpp | 15 +++----- .../apps/aidl-support/parts/default/Swap.h | 5 +-- .../eureka/hardware/parts/IBoolCallback.aidl | 20 +++++++++++ .../eureka/hardware/parts/ISwapOnData.aidl | 5 +-- 18 files changed, 209 insertions(+), 30 deletions(-) create mode 100644 universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.cpp create mode 100644 universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.h create mode 100644 universal7885-common/apps/SamsungParts/jni/SwapCallbackNative.cpp create mode 100644 universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBoolCallback.aidl create mode 100644 universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBoolCallback.aidl create mode 100644 universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBoolCallback.aidl diff --git a/universal7885-common/apps/SamsungParts/Android.bp b/universal7885-common/apps/SamsungParts/Android.bp index f33ebb1..1043278 100644 --- a/universal7885-common/apps/SamsungParts/Android.bp +++ b/universal7885-common/apps/SamsungParts/Android.bp @@ -5,7 +5,10 @@ android_app { ], platform_apis: true, certificate: "platform", - jni_libs: ["libSwapStorageHelper"], + jni_libs: [ + "libStorageHelper", + "libSwapCallback", + ], static_libs: [ "androidx.preference_preference", "vendor.eureka.hardware.parts-V1-java", diff --git a/universal7885-common/apps/SamsungParts/jni/Android.bp b/universal7885-common/apps/SamsungParts/jni/Android.bp index 64f6213..e5a2729 100644 --- a/universal7885-common/apps/SamsungParts/jni/Android.bp +++ b/universal7885-common/apps/SamsungParts/jni/Android.bp @@ -1,5 +1,5 @@ cc_library_shared { - name: "libSwapStorageHelper", + name: "libStorageHelper", defaults: ["eureka_defaults"], cflags: [ "-Wall", @@ -7,7 +7,22 @@ cc_library_shared { "-Wno-unused-parameter", "-Werror", ], - srcs: ["*.cpp"], + srcs: ["Storage.cpp"], header_libs: ["jni_headers"], static_libs: ["libc++fs"], } + +cc_library_shared { + name: "libSwapCallback", + defaults: ["eureka_defaults"], + srcs: [ + "SwapCallbackImpl.cpp", + "SwapCallbackNative.cpp", + ], + header_libs: ["jni_headers"], + shared_libs: [ + "vendor.eureka.hardware.parts-V1-ndk", + "libbase", + "libbinder_ndk", + ], +} diff --git a/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.cpp b/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.cpp new file mode 100644 index 0000000..6e7f9e2 --- /dev/null +++ b/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.cpp @@ -0,0 +1,21 @@ +// 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(); +} diff --git a/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.h b/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.h new file mode 100644 index 0000000..9c94456 --- /dev/null +++ b/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.h @@ -0,0 +1,36 @@ +// 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 + +#include + +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; +}; diff --git a/universal7885-common/apps/SamsungParts/jni/SwapCallbackNative.cpp b/universal7885-common/apps/SamsungParts/jni/SwapCallbackNative.cpp new file mode 100644 index 0000000..2d956a7 --- /dev/null +++ b/universal7885-common/apps/SamsungParts/jni/SwapCallbackNative.cpp @@ -0,0 +1,12 @@ +#include "SwapCallbackImpl.h" + +#include + +#include + +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(env, clazz) : nullptr); +} diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt index 5cc5d68..6d10689 100644 --- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt +++ b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt @@ -19,8 +19,9 @@ 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_BOOT_COMPLETED) { - System.loadLibrary("SwapStorageHelper") + 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) @@ -41,7 +42,8 @@ class BootReceiver : BroadcastReceiver() { // ZRAM val mSwap = Swap() - mSwap.setSwapOn(mSharedPreferences.getBoolean(SwapFragment.PREF_SWAP_ENABLE, false)) + if (mSharedPreferences.getBoolean(SwapFragment.PREF_SWAP_ENABLE, false)) + mSwap.setSwapOn(false) else mSwap.setSwapOff() // Display val mDisplay = Display() diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt index 6eaccbc..cbdf7cd 100644 --- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt +++ b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt @@ -33,7 +33,8 @@ class DeviceSettings : PreferenceFragmentCompat(), Preference.OnPreferenceChange private lateinit var mPrefs: SharedPreferences override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - System.loadLibrary("SwapStorageHelper") + System.loadLibrary("StorageHelper") + System.loadLibrary("SwapCallback") setPreferencesFromResource(R.xml.preferences_samsung_parts, rootKey) mPrefs = PreferenceManager.getDefaultSharedPreferences(requireContext()) val mClearSpeakerPref = findPreference(PREF_CLEAR_SPEAKER)!! diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Swap.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Swap.kt index da78f56..f620c1f 100644 --- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Swap.kt +++ b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Swap.kt @@ -17,6 +17,7 @@ package com.eurekateam.samsungextras.interfaces import vendor.eureka.hardware.parts.ISwapOnData +import vendor.eureka.hardware.parts.IBoolCallback import android.os.ServiceManager @@ -26,7 +27,8 @@ class Swap { mSwap = ISwapOnData.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.ISwapOnData/default")) } - fun setSwapOn(mEnabled: Boolean) = if (mEnabled) mSwap.setSwapOn() else mSwap.setSwapOff() + 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() diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapFragment.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapFragment.kt index 85aa621..c682e15 100644 --- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapFragment.kt +++ b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapFragment.kt @@ -31,6 +31,7 @@ import com.eurekateam.samsungextras.interfaces.Swap import java.lang.Thread import java.util.concurrent.ScheduledThreadPoolExecutor import java.util.concurrent.TimeUnit +import vendor.eureka.hardware.parts.IBoolCallback class SwapFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, OnMainSwitchChangeListener { private lateinit var mSwapSizePref: SeekBarPreference @@ -77,11 +78,26 @@ class SwapFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeLi 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 + } + mSwapFileSize.summary = "${mSwap.getSwapSize()} MB" + } + override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) { mSwapEnable.isEnabled = false val mSwap = Swap() - if (isChecked) mSwap.mkFile(mSwapSize) else mSwap.delFile() - mSwap.setSwapOn(isChecked) + 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 diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/.hash b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/.hash index 68d064b..498aaf5 100644 --- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/.hash +++ b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/.hash @@ -1 +1 @@ -d1cebfb943ba21a23e9c502b43d6c2766f6e608d +48bdd89bd2780de4c4254e0d52a8c4e53e416d00 diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBoolCallback.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBoolCallback.aidl new file mode 100644 index 0000000..32bc47d --- /dev/null +++ b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBoolCallback.aidl @@ -0,0 +1,20 @@ +// 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); +} diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISwapOnData.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISwapOnData.aidl index aa98e39..24f10df 100644 --- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISwapOnData.aidl +++ b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISwapOnData.aidl @@ -14,9 +14,10 @@ package vendor.eureka.hardware.parts; +import vendor.eureka.hardware.parts.IBoolCallback; + @VintfStability interface ISwapOnData { - boolean getSwapOnResult(); boolean isMutexLocked(); @@ -24,7 +25,7 @@ interface ISwapOnData { oneway void setSwapOff(); - oneway void setSwapOn(); + oneway void setSwapOn(in IBoolCallback cb); oneway void makeSwapFile(in int size); } diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBoolCallback.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBoolCallback.aidl new file mode 100644 index 0000000..b0734b6 --- /dev/null +++ b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBoolCallback.aidl @@ -0,0 +1,36 @@ +// 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 -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); +} diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISwapOnData.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISwapOnData.aidl index b83d5b0..8dc63ee 100644 --- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISwapOnData.aidl +++ b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISwapOnData.aidl @@ -32,10 +32,9 @@ package vendor.eureka.hardware.parts; @VintfStability interface ISwapOnData { - boolean getSwapOnResult(); boolean isMutexLocked(); oneway void removeSwapFile(); oneway void setSwapOff(); - oneway void setSwapOn(); + oneway void setSwapOn(in vendor.eureka.hardware.parts.IBoolCallback cb); oneway void makeSwapFile(in int size); } diff --git a/universal7885-common/apps/aidl-support/parts/default/Swap.cpp b/universal7885-common/apps/aidl-support/parts/default/Swap.cpp index d488000..aa6672f 100644 --- a/universal7885-common/apps/aidl-support/parts/default/Swap.cpp +++ b/universal7885-common/apps/aidl-support/parts/default/Swap.cpp @@ -29,8 +29,6 @@ namespace aidl::vendor::eureka::hardware::parts { static std::mutex thread_lock; -static bool swapOnRes = false; - static inline bool swapfile_exist(void) { return access(SWAP_PATH, F_OK) == 0; } @@ -61,15 +59,15 @@ static void rmswap(void) { return ::ndk::ScopedAStatus::ok(); } -static void swapon_func(void) { +static void swapon_func(cb_t cb) { const std::lock_guard lock(thread_lock); int res = swapon(SWAP_PATH, (10 << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK); - swapOnRes = res == 0; + if (cb != nullptr) cb->respondToBool(res == 0); } -::ndk::ScopedAStatus SwapOnData::setSwapOn() { +::ndk::ScopedAStatus SwapOnData::setSwapOn(cb_t cb) { if (!swapfile_exist()) return ::ndk::ScopedAStatus::ok(); - std::thread swapon_thread(swapon_func); + std::thread swapon_thread(swapon_func, cb); swapon_thread.detach(); return ::ndk::ScopedAStatus::ok(); } @@ -86,11 +84,6 @@ static void swapoff_func(void) { return ::ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus SwapOnData::getSwapOnResult(bool *_aidl_return) { - *_aidl_return = swapOnRes; - return ::ndk::ScopedAStatus::ok(); -} - ::ndk::ScopedAStatus SwapOnData::isMutexLocked(bool *_aidl_return) { if (thread_lock.try_lock()) { thread_lock.unlock(); diff --git a/universal7885-common/apps/aidl-support/parts/default/Swap.h b/universal7885-common/apps/aidl-support/parts/default/Swap.h index 5c4b714..3168b17 100644 --- a/universal7885-common/apps/aidl-support/parts/default/Swap.h +++ b/universal7885-common/apps/aidl-support/parts/default/Swap.h @@ -18,14 +18,15 @@ namespace aidl::vendor::eureka::hardware::parts { +using cb_t = const std::shared_ptr&; + struct SwapOnData : public BnSwapOnData { // Methods from ::aidl::vendor::eureka::hardware::parts::ISwapOnData // follow. ::ndk::ScopedAStatus makeSwapFile(int32_t size); - ::ndk::ScopedAStatus setSwapOn(void); + ::ndk::ScopedAStatus setSwapOn(cb_t cb); ::ndk::ScopedAStatus removeSwapFile(void); ::ndk::ScopedAStatus setSwapOff(void); - ::ndk::ScopedAStatus getSwapOnResult(bool *_aidl_return); ::ndk::ScopedAStatus isMutexLocked(bool *_aidl_return); }; } // namespace vendor::eureka::hardware::parts::V1_0 diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBoolCallback.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBoolCallback.aidl new file mode 100644 index 0000000..32bc47d --- /dev/null +++ b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBoolCallback.aidl @@ -0,0 +1,20 @@ +// 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); +} diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISwapOnData.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISwapOnData.aidl index aa98e39..24f10df 100644 --- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISwapOnData.aidl +++ b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISwapOnData.aidl @@ -14,9 +14,10 @@ package vendor.eureka.hardware.parts; +import vendor.eureka.hardware.parts.IBoolCallback; + @VintfStability interface ISwapOnData { - boolean getSwapOnResult(); boolean isMutexLocked(); @@ -24,7 +25,7 @@ interface ISwapOnData { oneway void setSwapOff(); - oneway void setSwapOn(); + oneway void setSwapOn(in IBoolCallback cb); oneway void makeSwapFile(in int size); }