Don't send various Telephony notifications for managed users

Bug: 18226975
Change-Id: I3044318fd86f33d47fbad851d6e26a653e6b206e
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 5489c47..e06684c 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -392,7 +392,11 @@
 
             List<UserInfo> users = mUserManager.getUsers(true);
             for (int i = 0; i < users.size(); i++) {
-                UserHandle userHandle = users.get(i).getUserHandle();
+                final UserInfo user = users.get(i);
+                if (user.isManagedProfile()) {
+                    continue;
+                }
+                UserHandle userHandle = user.getUserHandle();
                 builder.setContentIntent(userHandle.isOwner() ? contentIntent : null);
                     mNotificationManager.notifyAsUser(
                             null /* tag */, CALL_FORWARD_NOTIFICATION, builder.build(), userHandle);
@@ -425,7 +429,11 @@
 
         List<UserInfo> users = mUserManager.getUsers(true);
         for (int i = 0; i < users.size(); i++) {
-            UserHandle userHandle = users.get(i).getUserHandle();
+            final UserInfo user = users.get(i);
+            if (user.isManagedProfile()) {
+                continue;
+            }
+            UserHandle userHandle = user.getUserHandle();
             builder.setContentIntent(userHandle.isOwner() ? contentIntent : null);
             final Notification notif =
                     new Notification.BigTextStyle(builder).bigText(contentText).build();
@@ -468,7 +476,11 @@
 
         List<UserInfo> users = mUserManager.getUsers(true);
         for (int i = 0; i < users.size(); i++) {
-            UserHandle userHandle = users.get(i).getUserHandle();
+            final UserInfo user = users.get(i);
+            if (user.isManagedProfile()) {
+                continue;
+            }
+            UserHandle userHandle = user.getUserHandle();
             builder.setContentIntent(userHandle.isOwner() ? contentIntent : null);
             mNotificationManager.notifyAsUser(
                     null /* tag */,