利用 Android 動態效能架構改善熱溫和 CPU 效能
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本指南說明如何使用 Android 動態效能架構 (ADPF),根據 Android 上的動態熱能和 CPU 管理功能對遊戲進行最佳化調整。重點在於遊戲,但您也可以將這些功能用於其他耗用大量效能的應用程式。
ADPF 是一組 API,可讓遊戲和耗用大量效能的應用程式直接與 Android 裝置的電源和熱系統系統互動。這些 API 可讓您監控 Android 系統的動態行為,並且在不會使裝置過熱的永續等級最佳化遊戲效能。
相較於電腦和控制台,行動 SoC 和 Android 的動態效能行為更靈活。這些行為包括熱力狀態管理、不同的 CPU 堆疊,以及不同的 CPU 核心類型。再加上日益多元的 SoC 核心拓撲,我們要在不影響裝置效能的情況下,致力確保遊戲能夠善用這類行為,因此會帶來許多挑戰。ADPF 提供了部分這類資訊,藉此提高效能的可預測性。
以下是 ADPF 的主要功能:
- Thermal API:監控裝置的熱力狀態,讓應用程式能在無法維持永續等級前主動調整工作負載。
- CPU Performance Hint API:提供效能提示,讓 Android 為工作負載選擇適當的效能設定 (例如 CPU 作業點或核心)。
- Game Mode API 和 Game State API:根據使用者的設定和遊戲專屬設定,決定效能或電池續航力特性的優先處理順序,藉此啟用遊戲最佳化功能。
- 固定效能模式:在基準化期間為裝置啟用固定效能模式,以取得非由動態 CPU 時脈變更的測量數據。
- 電源效率模式:告知工作階段效能提示工作階段中的執行緒可以安全排程,偏好耗電量而非效能。(適用於 Android 15)。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Optimize thermal and CPU performance with the Android Dynamic Performance Framework\n\nThis guide describes how to use the Android Dynamic Performance Framework (ADPF)\nto optimize games based on the dynamic thermal and CPU management features on\nAndroid. The focus is on games, but you can also use the features for other\nperformance-intensive apps.\n\nADPF is a set of APIs that allow games and performance-intensive apps to\ninteract more directly with power and thermal systems of Android devices. With\nthese APIs, you can monitor the dynamic behavior on Android systems and optimize\ngame performance at a sustainable level that doesn't overheat devices.\n\nMobile SoCs and Android have more dynamic performance behaviors than desktops\nand consoles. These behaviors include thermal state management, varying CPU\nclocks, and varying CPU core types. This combined with the increasingly diverse\ncore topology of SoCs creates challenges when trying to ensure that your game\ncan take advantage of this behavior without negatively impacting device\nperformance. ADPF provides some of this information in order to make performance\nmore predictable.\n\nHere are the main ADPF features:\n\n- **Thermal API**: Monitor the thermal state of a device so that the application can proactively adjust workload before it becomes unsustainable.\n- **CPU Performance Hint API**: Provide performance hints that let Android choose the right performance settings (for example, CPU operating point or core) for the workload.\n- **Game Mode API \\& Game State API**: Enable game play optimization by prioritizing performance or battery life characteristics, based on user's settings and game specific configurations.\n- **Fixed Performance Mode**: Enable fixed-performance mode on a device during benchmarking to get measurements that aren't altered by dynamic CPU clocking.\n- **Power Efficiency Mode** : Tells the session that the threads in Performance Hint Session can be safely scheduled to prefer power efficiency over performance. ([Available in Android 15](/reference/android/os/PerformanceHintManager.Session#setPreferPowerEfficiency(boolean)))"]]