Loading src/com/android/server/telecom/CallsManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -672,7 +672,8 @@ public class CallsManager extends Call.ListenerBase mPhoneAccountRegistrar = phoneAccountRegistrar; mPhoneAccountRegistrar.addListener(mPhoneAccountListener); mMissedCallNotifier = missedCallNotifier; mDisconnectedCallNotifier = disconnectedCallNotifierFactory.create(mContext, this); mDisconnectedCallNotifier = disconnectedCallNotifierFactory.create(mContext, this, featureFlags); StatusBarNotifier statusBarNotifier = new StatusBarNotifier(context, this); mWiredHeadsetManager = wiredHeadsetManager; mSystemStateHelper = systemStateHelper; Loading src/com/android/server/telecom/InCallController.java +2 −6 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import android.annotation.Nullable; import android.app.AppOpsManager; import android.app.KeyguardManager; import android.app.Notification; import android.app.NotificationManager; import android.content.AttributionSource; import android.content.BroadcastReceiver; import android.content.ComponentName; Loading Loading @@ -302,7 +301,6 @@ public class InCallController extends CallsManagerListenerBase implements private boolean mIsConnected = false; private boolean mIsBound = false; private boolean mIsNullBinding = false; private NotificationManager mNotificationManager; //this is really used for cases where the userhandle for a call //does not match what we want to use for bindAsUser Loading Loading @@ -3322,8 +3320,6 @@ public class InCallController extends CallsManagerListenerBase implements } catch (PackageManager.NameNotFoundException e) { appName = packageName; } NotificationManager notificationManager = (NotificationManager) mContext .getSystemService(Context.NOTIFICATION_SERVICE); Notification.Builder builder = new Notification.Builder(mContext, NotificationChannelManager.CHANNEL_ID_IN_CALL_SERVICE_CRASH); builder.setSmallIcon(R.drawable.ic_phone) Loading @@ -3334,8 +3330,8 @@ public class InCallController extends CallsManagerListenerBase implements .setStyle(new Notification.BigTextStyle() .bigText(mContext.getText( R.string.notification_incallservice_not_responding_body))); notificationManager.notifyAsUser(NOTIFICATION_TAG, IN_CALL_SERVICE_NOTIFICATION_ID, builder.build(), userHandle); UserUtil.processNotification(mContext, userHandle, NOTIFICATION_TAG, IN_CALL_SERVICE_NOTIFICATION_ID, builder.build(), mFeatureFlags); } private void updateCallTracking(Call call, InCallServiceInfo info, boolean isAdd) { Loading src/com/android/server/telecom/TelecomSystem.java +3 −2 Original line number Diff line number Diff line Loading @@ -347,7 +347,7 @@ public class TelecomSystem { ); AudioProcessingNotification audioProcessingNotification = new AudioProcessingNotification(mContext); new AudioProcessingNotification(mContext, mFeatureFlags); ToastFactory toastFactory = new ToastFactory() { @Override Loading Loading @@ -391,7 +391,8 @@ public class TelecomSystem { CallStreamingNotification callStreamingNotification = new CallStreamingNotification(mContext, (packageName, userHandle) -> AppLabelProxy.Util.getAppLabel(mContext, userHandle, packageName, mFeatureFlags), asyncTaskExecutor); userHandle, packageName, mFeatureFlags), asyncTaskExecutor, mFeatureFlags); mCallsManager = new CallsManager( mContext, Loading src/com/android/server/telecom/UserUtil.java +26 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.telecom; import android.app.Notification; import android.app.NotificationManager; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.Intent; Loading Loading @@ -167,4 +169,28 @@ public final class UserUtil { // return the current user. return currentUser; } public static void processNotification(Context context, UserHandle userHandle, String tag, int id, Notification notification, FeatureFlags featureFlags) { if (featureFlags.resolveHiddenDependenciesTwo()) { Context userContext = context.createContextAsUser(userHandle, 0); NotificationManager userNotificationMgr = userContext.getSystemService( NotificationManager.class); if (userNotificationMgr != null) { if (notification != null) { userNotificationMgr.notify(tag, id, notification); } else { userNotificationMgr.cancel(tag, id); } } } else { NotificationManager notificationMgr = (NotificationManager) context.getSystemService( Context.NOTIFICATION_SERVICE); if (notification != null) { notificationMgr.notifyAsUser(tag, id, notification, userHandle); } else { notificationMgr.cancelAsUser(tag, id, userHandle); } } } } src/com/android/server/telecom/components/TelecomService.java +2 −2 Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ public class TelecomService extends Service implements TelecomSystem.Component { new Timeouts.Adapter(), new AsyncRingtonePlayer(), new PhoneNumberUtilsAdapterImpl(), new IncomingCallNotifier(context), new IncomingCallNotifier(context, featureFlags), ToneGenerator::new, new CallAudioRouteStateMachine.Factory(), new CallAudioModeStateMachine.Factory(), Loading Loading @@ -242,7 +242,7 @@ public class TelecomService extends Service implements TelecomSystem.Component { public void updateEmergencyCallNotification(Context context, boolean showNotification) { BlockedNumbersUtil.updateEmergencyCallNotification(context, showNotification); showNotification, featureFlags); } }, featureFlags, Loading Loading
src/com/android/server/telecom/CallsManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -672,7 +672,8 @@ public class CallsManager extends Call.ListenerBase mPhoneAccountRegistrar = phoneAccountRegistrar; mPhoneAccountRegistrar.addListener(mPhoneAccountListener); mMissedCallNotifier = missedCallNotifier; mDisconnectedCallNotifier = disconnectedCallNotifierFactory.create(mContext, this); mDisconnectedCallNotifier = disconnectedCallNotifierFactory.create(mContext, this, featureFlags); StatusBarNotifier statusBarNotifier = new StatusBarNotifier(context, this); mWiredHeadsetManager = wiredHeadsetManager; mSystemStateHelper = systemStateHelper; Loading
src/com/android/server/telecom/InCallController.java +2 −6 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import android.annotation.Nullable; import android.app.AppOpsManager; import android.app.KeyguardManager; import android.app.Notification; import android.app.NotificationManager; import android.content.AttributionSource; import android.content.BroadcastReceiver; import android.content.ComponentName; Loading Loading @@ -302,7 +301,6 @@ public class InCallController extends CallsManagerListenerBase implements private boolean mIsConnected = false; private boolean mIsBound = false; private boolean mIsNullBinding = false; private NotificationManager mNotificationManager; //this is really used for cases where the userhandle for a call //does not match what we want to use for bindAsUser Loading Loading @@ -3322,8 +3320,6 @@ public class InCallController extends CallsManagerListenerBase implements } catch (PackageManager.NameNotFoundException e) { appName = packageName; } NotificationManager notificationManager = (NotificationManager) mContext .getSystemService(Context.NOTIFICATION_SERVICE); Notification.Builder builder = new Notification.Builder(mContext, NotificationChannelManager.CHANNEL_ID_IN_CALL_SERVICE_CRASH); builder.setSmallIcon(R.drawable.ic_phone) Loading @@ -3334,8 +3330,8 @@ public class InCallController extends CallsManagerListenerBase implements .setStyle(new Notification.BigTextStyle() .bigText(mContext.getText( R.string.notification_incallservice_not_responding_body))); notificationManager.notifyAsUser(NOTIFICATION_TAG, IN_CALL_SERVICE_NOTIFICATION_ID, builder.build(), userHandle); UserUtil.processNotification(mContext, userHandle, NOTIFICATION_TAG, IN_CALL_SERVICE_NOTIFICATION_ID, builder.build(), mFeatureFlags); } private void updateCallTracking(Call call, InCallServiceInfo info, boolean isAdd) { Loading
src/com/android/server/telecom/TelecomSystem.java +3 −2 Original line number Diff line number Diff line Loading @@ -347,7 +347,7 @@ public class TelecomSystem { ); AudioProcessingNotification audioProcessingNotification = new AudioProcessingNotification(mContext); new AudioProcessingNotification(mContext, mFeatureFlags); ToastFactory toastFactory = new ToastFactory() { @Override Loading Loading @@ -391,7 +391,8 @@ public class TelecomSystem { CallStreamingNotification callStreamingNotification = new CallStreamingNotification(mContext, (packageName, userHandle) -> AppLabelProxy.Util.getAppLabel(mContext, userHandle, packageName, mFeatureFlags), asyncTaskExecutor); userHandle, packageName, mFeatureFlags), asyncTaskExecutor, mFeatureFlags); mCallsManager = new CallsManager( mContext, Loading
src/com/android/server/telecom/UserUtil.java +26 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.telecom; import android.app.Notification; import android.app.NotificationManager; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.Intent; Loading Loading @@ -167,4 +169,28 @@ public final class UserUtil { // return the current user. return currentUser; } public static void processNotification(Context context, UserHandle userHandle, String tag, int id, Notification notification, FeatureFlags featureFlags) { if (featureFlags.resolveHiddenDependenciesTwo()) { Context userContext = context.createContextAsUser(userHandle, 0); NotificationManager userNotificationMgr = userContext.getSystemService( NotificationManager.class); if (userNotificationMgr != null) { if (notification != null) { userNotificationMgr.notify(tag, id, notification); } else { userNotificationMgr.cancel(tag, id); } } } else { NotificationManager notificationMgr = (NotificationManager) context.getSystemService( Context.NOTIFICATION_SERVICE); if (notification != null) { notificationMgr.notifyAsUser(tag, id, notification, userHandle); } else { notificationMgr.cancelAsUser(tag, id, userHandle); } } } }
src/com/android/server/telecom/components/TelecomService.java +2 −2 Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ public class TelecomService extends Service implements TelecomSystem.Component { new Timeouts.Adapter(), new AsyncRingtonePlayer(), new PhoneNumberUtilsAdapterImpl(), new IncomingCallNotifier(context), new IncomingCallNotifier(context, featureFlags), ToneGenerator::new, new CallAudioRouteStateMachine.Factory(), new CallAudioModeStateMachine.Factory(), Loading Loading @@ -242,7 +242,7 @@ public class TelecomService extends Service implements TelecomSystem.Component { public void updateEmergencyCallNotification(Context context, boolean showNotification) { BlockedNumbersUtil.updateEmergencyCallNotification(context, showNotification); showNotification, featureFlags); } }, featureFlags, Loading