Skip to content

Conversation

@LofoWalker
Copy link
Contributor

πŸ›‘οΈ PR Description: Add Rule ESOB016 – Detect Explicit and Implicit Use of Hardware Acceleration

This pull request introduces a new ecoCode rule for Android projects: ESOB016 – Detects explicit or implicit use of hardware acceleration in Android component declarations.

πŸ“Œ Motivation

Hardware acceleration (android:hardwareAccelerated="true") can increase rendering performance, but at the cost of higher RAM usage and potential compatibility issues, especially on low-end or memory-constrained devices. This rule helps teams identify when it is unnecessarily enabledβ€”either explicitly or implicitlyβ€”to encourage more conscious resource management.

πŸ” What the Rule Detects

Explicit activation of hardware acceleration via android:hardwareAccelerated="true" on supported XML elements.

Implicit activation when:

  • The attribute is omitted on the component, and
  • The parent does not explicitly disable it.

🎯 Scope
The rule targets the following AndroidManifest components:

βœ… Recommendation
Enable hardware acceleration only when necessary for visual performance, such as complex animations or canvas rendering. In most other casesβ€”especially for background components or simple UIsβ€”it should be disabled to save memory.

πŸ“– Reference
Android Developer Guide: Hardware Acceleration

@LofoWalker LofoWalker force-pushed the feat/ESOB016_hardware_acceleration branch 2 times, most recently from f32882d to 8b7ecb7 Compare May 21, 2025 07:55
@olegoaer olegoaer changed the title ESOB016: Detects explicit or implicit use of hardware acceleration in… Added rule Sobriety > Hardware acceleration May 21, 2025
@olegoaer olegoaer added πŸ—ƒοΈ rule Rule submission πŸ† challenge πŸ† Work done during the ecoCode Challenge labels May 21, 2025
@LofoWalker LofoWalker force-pushed the feat/ESOB016_hardware_acceleration branch from 8b7ecb7 to f37cd96 Compare May 21, 2025 08:06
@LofoWalker LofoWalker force-pushed the feat/ESOB016_hardware_acceleration branch 2 times, most recently from 1a21293 to a3781a6 Compare May 21, 2025 12:18
@LofoWalker LofoWalker force-pushed the feat/ESOB016_hardware_acceleration branch from a3781a6 to 8ff0704 Compare May 21, 2025 12:42
@jduigoudev jduigoudev self-requested a review May 21, 2025 12:54
@jduigoudev jduigoudev merged commit fbac1ca into green-code-initiative:main May 21, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

πŸ—ƒοΈ rule Rule submission πŸ† challenge πŸ† Work done during the ecoCode Challenge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants