Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
MediaSessionLegacyHelper uses global Application context
Browse files Browse the repository at this point in the history
MediaSessionLegacyHelper used a Context passed by an application
  which can cause a leak of Activity instances. Use the global
  Application context instead.
Also prevent crash if a null Context is supplied (method not
  documented as requesting a non-null Context).

Bug 18767503

Change-Id: I8281047d0af233a323f3fc11ababedff848829ec
  • Loading branch information
jmtrivi committed Dec 19, 2014
1 parent 296aa92 commit 9b5257c
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,9 @@ private MediaSessionLegacyHelper(Context context) {
}

public static MediaSessionLegacyHelper getHelper(Context context) {
if (DEBUG) {
Log.d(TAG, "Attempting to get helper with context " + context);
}
synchronized (sLock) {
if (sInstance == null) {
sInstance = new MediaSessionLegacyHelper(context);
sInstance = new MediaSessionLegacyHelper(context.getApplicationContext());
}
}
return sInstance;
Expand Down

0 comments on commit 9b5257c

Please sign in to comment.