Loading services/core/java/com/android/server/notification/NotificationManagerService.java +12 −14 Original line number Diff line number Diff line Loading @@ -1643,7 +1643,7 @@ public class NotificationManagerService extends SystemService { ActivityManager activityManager, GroupHelper groupHelper, IActivityManager am, UsageStatsManagerInternal appUsageStats, DevicePolicyManagerInternal dpm, IUriGrantsManager ugm, UriGrantsManagerInternal ugmInternal, AppOpsManager appOps, UserManager userManager) { UserManager userManager, TelephonyManager telephonyManager) { Resources resources = getContext().getResources(); mMaxPackageEnqueueRate = Settings.Global.getFloat(getContext().getContentResolver(), Settings.Global.MAX_NOTIFICATION_ENQUEUE_RATE, Loading Loading @@ -1766,7 +1766,15 @@ public class NotificationManagerService extends SystemService { mInterruptionFilter = mZenModeHelper.getZenModeListenerInterruptionFilter(); mUserProfiles.updateCache(getContext()); listenForCallState(); telephonyManager.listen(new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (mCallState == state) return; if (DBG) Slog.d(TAG, "Call state changed: " + callStateToString(state)); mCallState = state; } }, PhoneStateListener.LISTEN_CALL_STATE); mSettingsObserver = new SettingsObserver(mHandler); Loading Loading @@ -1825,7 +1833,8 @@ public class NotificationManagerService extends SystemService { UriGrantsManager.getService(), LocalServices.getService(UriGrantsManagerInternal.class), (AppOpsManager) getContext().getSystemService(Context.APP_OPS_SERVICE), getContext().getSystemService(UserManager.class)); getContext().getSystemService(UserManager.class), getContext().getSystemService(TelephonyManager.class)); // register for various Intents IntentFilter filter = new IntentFilter(); Loading Loading @@ -7467,17 +7476,6 @@ public class NotificationManagerService extends SystemService { } } private void listenForCallState() { getContext().getSystemService(TelephonyManager.class).listen(new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (mCallState == state) return; if (DBG) Slog.d(TAG, "Call state changed: " + callStateToString(state)); mCallState = state; } }, PhoneStateListener.LISTEN_CALL_STATE); } /** * Generates a NotificationRankingUpdate from 'sbns', considering only * notifications visible to the given listener. Loading services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.NotificationStats; import android.service.notification.StatusBarNotification; import android.service.notification.ZenPolicy; import android.telephony.TelephonyManager; import android.test.suitebuilder.annotation.SmallTest; import android.testing.AndroidTestingRunner; import android.testing.TestableContext; Loading Loading @@ -391,7 +392,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { mCompanionMgr, mSnoozeHelper, mUsageStats, mPolicyFile, mActivityManager, mGroupHelper, mAm, mAppUsageStats, mock(DevicePolicyManagerInternal.class), mUgm, mUgmInternal, mAppOpsManager, mUm); mAppOpsManager, mUm, mock(TelephonyManager.class)); mService.onBootPhase(SystemService.PHASE_SYSTEM_SERVICES_READY); mService.setAudioManager(mAudioManager); Loading services/tests/uiservicestests/src/com/android/server/notification/RoleObserverTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.content.pm.UserInfo; import android.os.Looper; import android.os.UserHandle; import android.os.UserManager; import android.telephony.TelephonyManager; import android.test.suitebuilder.annotation.SmallTest; import android.testing.AndroidTestingRunner; import android.testing.TestableContext; Loading Loading @@ -140,7 +141,7 @@ public class RoleObserverTest extends UiServiceTestCase { mock(UsageStatsManagerInternal.class), mock(DevicePolicyManagerInternal.class), mock(IUriGrantsManager.class), mock(UriGrantsManagerInternal.class), mock(AppOpsManager.class), mUm); mock(AppOpsManager.class), mUm, mock(TelephonyManager.class)); } catch (SecurityException e) { if (!e.getMessage().contains("Permission Denial: not allowed to send broadcast")) { throw e; Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +12 −14 Original line number Diff line number Diff line Loading @@ -1643,7 +1643,7 @@ public class NotificationManagerService extends SystemService { ActivityManager activityManager, GroupHelper groupHelper, IActivityManager am, UsageStatsManagerInternal appUsageStats, DevicePolicyManagerInternal dpm, IUriGrantsManager ugm, UriGrantsManagerInternal ugmInternal, AppOpsManager appOps, UserManager userManager) { UserManager userManager, TelephonyManager telephonyManager) { Resources resources = getContext().getResources(); mMaxPackageEnqueueRate = Settings.Global.getFloat(getContext().getContentResolver(), Settings.Global.MAX_NOTIFICATION_ENQUEUE_RATE, Loading Loading @@ -1766,7 +1766,15 @@ public class NotificationManagerService extends SystemService { mInterruptionFilter = mZenModeHelper.getZenModeListenerInterruptionFilter(); mUserProfiles.updateCache(getContext()); listenForCallState(); telephonyManager.listen(new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (mCallState == state) return; if (DBG) Slog.d(TAG, "Call state changed: " + callStateToString(state)); mCallState = state; } }, PhoneStateListener.LISTEN_CALL_STATE); mSettingsObserver = new SettingsObserver(mHandler); Loading Loading @@ -1825,7 +1833,8 @@ public class NotificationManagerService extends SystemService { UriGrantsManager.getService(), LocalServices.getService(UriGrantsManagerInternal.class), (AppOpsManager) getContext().getSystemService(Context.APP_OPS_SERVICE), getContext().getSystemService(UserManager.class)); getContext().getSystemService(UserManager.class), getContext().getSystemService(TelephonyManager.class)); // register for various Intents IntentFilter filter = new IntentFilter(); Loading Loading @@ -7467,17 +7476,6 @@ public class NotificationManagerService extends SystemService { } } private void listenForCallState() { getContext().getSystemService(TelephonyManager.class).listen(new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if (mCallState == state) return; if (DBG) Slog.d(TAG, "Call state changed: " + callStateToString(state)); mCallState = state; } }, PhoneStateListener.LISTEN_CALL_STATE); } /** * Generates a NotificationRankingUpdate from 'sbns', considering only * notifications visible to the given listener. Loading
services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.NotificationStats; import android.service.notification.StatusBarNotification; import android.service.notification.ZenPolicy; import android.telephony.TelephonyManager; import android.test.suitebuilder.annotation.SmallTest; import android.testing.AndroidTestingRunner; import android.testing.TestableContext; Loading Loading @@ -391,7 +392,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { mCompanionMgr, mSnoozeHelper, mUsageStats, mPolicyFile, mActivityManager, mGroupHelper, mAm, mAppUsageStats, mock(DevicePolicyManagerInternal.class), mUgm, mUgmInternal, mAppOpsManager, mUm); mAppOpsManager, mUm, mock(TelephonyManager.class)); mService.onBootPhase(SystemService.PHASE_SYSTEM_SERVICES_READY); mService.setAudioManager(mAudioManager); Loading
services/tests/uiservicestests/src/com/android/server/notification/RoleObserverTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.content.pm.UserInfo; import android.os.Looper; import android.os.UserHandle; import android.os.UserManager; import android.telephony.TelephonyManager; import android.test.suitebuilder.annotation.SmallTest; import android.testing.AndroidTestingRunner; import android.testing.TestableContext; Loading Loading @@ -140,7 +141,7 @@ public class RoleObserverTest extends UiServiceTestCase { mock(UsageStatsManagerInternal.class), mock(DevicePolicyManagerInternal.class), mock(IUriGrantsManager.class), mock(UriGrantsManagerInternal.class), mock(AppOpsManager.class), mUm); mock(AppOpsManager.class), mUm, mock(TelephonyManager.class)); } catch (SecurityException e) { if (!e.getMessage().contains("Permission Denial: not allowed to send broadcast")) { throw e; Loading