Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5904)

Unified Diff: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastAudioManager.java

Issue 1180253002: Chromecast: unmute audio stream on Cast session finish on pre-M devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CastShellActivity: use "this" instead of getApplicationContext Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastShellActivity.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastAudioManager.java
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastAudioManager.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastAudioManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..cc5b46e7a59f9584b027134d393e10705ee02baa
--- /dev/null
+++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastAudioManager.java
@@ -0,0 +1,25 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chromecast.shell;
+
+import android.content.Context;
+import android.media.AudioManager;
+
+/**
+ * Wrapper for Cast code to use a single AudioManager instance.
+ * Muting and unmuting streams must be invoke on the same AudioManager instance.
+ */
+public class CastAudioManager {
+
+ private static AudioManager sAudioManager = null;
+
+ public static AudioManager getAudioManager(Context context) {
+ if (sAudioManager == null) {
+ sAudioManager = (AudioManager) context.getApplicationContext()
+ .getSystemService(Context.AUDIO_SERVICE);
+ }
+ return sAudioManager;
+ }
+}
« no previous file with comments | « no previous file | chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastShellActivity.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698