Skip to content

Commit

Permalink
Code review suggestions fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyZhukovsky committed Dec 16, 2024
1 parent 42c5569 commit 44ce554
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
import android.media.AudioManager;

import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.notifications.NotificationConstants;

public class BraveMediaNotificationControllerDelegate
extends ChromeMediaNotificationControllerDelegate {
private static final String TAG = "BraveMediaNotif";

BraveMediaNotificationControllerDelegate(int id) {
super(id);
ChromeMediaNotificationControllerDelegate.sMapNotificationIdToOptions.put(
Expand Down Expand Up @@ -70,6 +73,11 @@ public void onReceive(Context context, Intent intent) {
try {
getContext().startService(i);
} catch (RuntimeException e) {
Log.e(
TAG,
"Can't start "
+ "BraveMediaNotificationControllerServices.PlaybackListenerMicService", // presubmit: ignore-long-line
e);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ public class BraveForegroundServiceUtils extends ForegroundServiceUtils {
public void startForeground(
Service service, int id, Notification notification, int foregroundServiceType) {
// Check for a service that is dedicated to Brave Talk
if (service.getClass().getSimpleName().equals(sBraveTalkServiceClassName)
|| service.getClass().getSimpleName().endsWith("$" + sBraveTalkServiceClassName)) {
String serviceSimpleName = service.getClass().getSimpleName();
if (serviceSimpleName.equals(sBraveTalkServiceClassName)
|| serviceSimpleName.endsWith("$" + sBraveTalkServiceClassName)) {
foregroundServiceType |= ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE;
}
super.startForeground(service, id, notification, foregroundServiceType);
Expand Down

0 comments on commit 44ce554

Please sign in to comment.