Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • briar briar
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 788
    • Issues 788
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • briar
  • briarbriar
  • Issues
  • #883

Closed
Open
Created Dec 28, 2016 by akwizgran@akwizgranOwner

AudioManager memory leak

@goapunk reported a memory leak on the Nexus S caused by the AudioManager. We don't use the AudioManager directly, but ViewRootImpl uses it to play click sounds, and the AudioManager gets a reference to the view's context. It seems that if the AudioManager isn't properly released, the context is leaked.

This has been fixed in AOSP by changing the AudioManager to keep a reference to the application context:
https://android-review.googlesource.com/#/c/140481/

A workaround is available for older versions that uses the application context to retrieve the AudioManager:
https://gist.github.com/jankovd/891d96f476f7a9ce24e2

We should be able to incorporate the workaround into BaseActivity.

Assignee
Assign to
Time tracking