1 // Copyright 2024 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_ANDROID_MEMORY_PURGE_MANAGER_ANDROID_H_ 6 #define BASE_ANDROID_MEMORY_PURGE_MANAGER_ANDROID_H_ 7 8 #include "base/android/jni_android.h" 9 10 namespace base::android { 11 12 class BASE_EXPORT MemoryPurgeManagerAndroid { 13 public: 14 static void Initialize(JNIEnv* env); 15 16 MemoryPurgeManagerAndroid(const MemoryPurgeManagerAndroid&) = delete; 17 MemoryPurgeManagerAndroid& operator=(const MemoryPurgeManagerAndroid&) = 18 delete; 19 20 // Called by JNI 21 static void PostDelayedPurgeTaskOnUiThread(int delay); 22 23 // Called by JNI 24 static bool IsOnPreFreezeMemoryTrimEnabled(); 25 }; 26 27 } // namespace base::android 28 29 #endif // BASE_ANDROID_MEMORY_PURGE_MANAGER_ANDROID_H_ 30