From 48248c80e58c459d211d36164baa69354e070c07 Mon Sep 17 00:00:00 2001 From: Sungsoo Lim Date: Wed, 24 Dec 2014 17:30:00 +0900 Subject: [PATCH] DO NOT MERGE Make mute/unmute work Bug: 18844550 Change-Id: I431a223d55430aa8e1bb28f0275e11876ed0e0bb (cherry picked from commit d1851e6e4e49b6a45d9e013de2e1384711975328) --- .../core/java/com/android/server/am/ActivityStack.java | 8 ++++---- .../com/android/server/media/MediaSessionService.java | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 9870a1ae65f42..3f4749af5a59a 100755 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -2576,7 +2576,7 @@ final class ActivityStack { if (r != null && r.app == app) { // If the top running activity is from this crashing // process, then terminate it to avoid getting in a loop. - Slog.w(TAG, " Force finishing activity " + Slog.w(TAG, " Force finishing activity 1 " + r.intent.getComponent().flattenToShortString()); int taskNdx = mTaskHistory.indexOf(r.task); int activityNdx = r.task.mActivities.indexOf(r); @@ -2600,7 +2600,7 @@ final class ActivityStack { || r.state == ActivityState.PAUSING || r.state == ActivityState.PAUSED) { if (!r.isHomeActivity() || mService.mHomeProcess != r.app) { - Slog.w(TAG, " Force finishing activity " + Slog.w(TAG, " Force finishing activity 2 " + r.intent.getComponent().flattenToShortString()); finishActivityLocked(r, Activity.RESULT_CANCELED, null, "crashed", false); } @@ -3850,7 +3850,7 @@ final class ActivityStack { } } didSomething = true; - Slog.i(TAG, " Force finishing activity " + r); + Slog.i(TAG, " Force finishing activity 3 " + r); if (samePackage) { if (r.app != null) { r.app.removed = true; @@ -3960,7 +3960,7 @@ final class ActivityStack { for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) { final ActivityRecord r = activities.get(activityNdx); if (r.app == app) { - Slog.w(TAG, " Force finishing activity " + Slog.w(TAG, " Force finishing activity 4 " + r.intent.getComponent().flattenToShortString()); // Force the destroy to skip right to removal. r.app = null; diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java index 82be1bbb158f9..a72cc8df390b5 100644 --- a/services/core/java/com/android/server/media/MediaSessionService.java +++ b/services/core/java/com/android/server/media/MediaSessionService.java @@ -836,7 +836,9 @@ public class MediaSessionService extends SystemService implements Monitor { mAudioService.setMasterMute(!isMasterMute, flags, packageName, mICallback); } else { mAudioService.adjustMasterVolume(direction, flags, packageName); - if (isMasterMute) { + // Do not call setStreamMute when direction = 0 which is just to show + // UI. + if (isMasterMute && direction != 0) { mAudioService.setMasterMute(false, flags, packageName, mICallback); } } @@ -847,7 +849,9 @@ public class MediaSessionService extends SystemService implements Monitor { } else { mAudioService.adjustSuggestedStreamVolume(direction, suggestedStream, flags, packageName); - if (isStreamMute) { + // Do not call setStreamMute when direction = 0 which is just to show + // UI. + if (isStreamMute && direction != 0) { mAudioService.setStreamMute(suggestedStream, false, mICallback); } }