Skip to content
Ubaid_ur_Rehman
All work

EcoTrace

Shipped

Android energy-intelligence platform that traces battery drain back to the architectural decision that caused it.

Problem

Battery profilers tell an Android engineer what drained the power, not why. A leaked wakelock is a symptom; the repeating alarm in MainActivity that re-arms it 96 times a day is the defect, and no existing tool walks the chain that connects them.

What I built

23 energy detectors across wakefulness, network, location and lifecycle patterns, feeding a real cross-file call graph. Each finding is traced backwards to its lifecycle entry point. IBM Bob 2.0 holds the whole repository in one pass, revises severities and authors a fix against the specific traced chain; the same detectors then re-run over that fix and reject any patch that silences a rule by deleting the construct.

Impact

Findings arrive as causal chains rather than a flat line list. Patches are self-verified before a human ever sees them, and land on a branch for review rather than straight to main. Built in 48 hours at the IBM Bob 2.0 hackathon.

Highlights

  • Reasons about cause, not symptoms: builds a genuine cross-file call graph and walks backwards from each finding to its lifecycle entry point, so a leaked wakelock in NetworkManager is reported as the symptom of a wakeup alarm registered in MainActivity that re-arms the path 96 times a day
  • 23 energy detectors across wakefulness, network, location and lifecycle patterns — unclosed WakeLocks, postDelayed polling loops, sub-30-second GPS intervals, and JobInfo constraints written but never submitted
  • Whole-repository reasoning with IBM Bob 2.0: Bob holds every file in a single pass, revises severities, corrects descriptions, and writes a fix against the specific traced chain — including defects the local pass attributes to the wrong method
  • Self-verifying patch loop: Bob proposes a patch, EcoTrace re-runs its own detectors over it, and any patch that silences a rule by deleting the construct is rejected. Accepted changes land on a branch for human merge, never straight to main
  • Measures real drain where devices are available: parses adb shell dumpsys batterystats snapshots and differences them into a drain rate in mAh/min attributed to the app under test rather than the whole device
  • Honest provenance and zero-key operation: every figure reports whether it is measured, estimator-derived, or unknown, and all 23 detectors, call-graph chains, grading, history and reporting run offline, deterministically and free — Bob sharpens the analysis but is never a prerequisite
  • Output is a self-contained HTML or PDF report that attaches to a ticket, plus an optional one-click patch that is authored, verified and branched for review

Stack

  • Kotlin
  • Android
  • Static Analysis
  • Energy Profiling
  • Call Graph
  • IBM Bob 2.0
  • Agentic Workflow
  • Developer Tools
LiveGitHub