Fix issue #7214090: Need to be able to post notifications to all users

Also fix a bunch of system services that should be doing this.  And
while doing that, found I needed to fix PendingIntent to evaluate
USER_CURRENT at the point of sending, not creation.

Note that this may end up with us having some notification shown to
non-primary users that lead to settings UI that should only be for
the primary user (such as the vpn notification).  I'm not sure what
to do about this, maybe we need a different UI to come up there or
something, but showing the actual notification for those users at
least seems less broken than not telling them at all.

Change-Id: Iffc51e2d7c847e3d05064d292ab93937646a1ab7
diff --git a/services/java/com/android/server/connectivity/Vpn.java b/services/java/com/android/server/connectivity/Vpn.java
index b3cbb84..03ff21f 100644
--- a/services/java/com/android/server/connectivity/Vpn.java
+++ b/services/java/com/android/server/connectivity/Vpn.java
@@ -50,6 +50,7 @@
 import android.os.RemoteException;
 import android.os.SystemClock;
 import android.os.SystemService;
+import android.os.UserHandle;
 import android.security.Credentials;
 import android.security.KeyStore;
 import android.util.Log;
@@ -421,7 +422,7 @@
                     .setDefaults(0)
                     .setOngoing(true)
                     .build();
-            nm.notify(R.drawable.vpn_connected, notification);
+            nm.notifyAsUser(null, R.drawable.vpn_connected, notification, UserHandle.ALL);
         }
     }
 
@@ -433,7 +434,7 @@
                 mContext.getSystemService(Context.NOTIFICATION_SERVICE);
 
         if (nm != null) {
-            nm.cancel(R.drawable.vpn_connected);
+            nm.cancelAsUser(null, R.drawable.vpn_connected, UserHandle.ALL);
         }
     }