Don't show storage notification across users

Also don't show for restricted profile

b/22471005

Change-Id: I9a0389092859e977082125cd7d8a46b68bb43674
diff --git a/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java b/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java
index b077c32..e5b1783 100644
--- a/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java
+++ b/Settings/src/com/android/tv/settings/device/storage/NewStorageActivity.java
@@ -18,10 +18,14 @@
 
 import android.annotation.Nullable;
 import android.app.Activity;
+import android.app.ActivityManager;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
+import android.content.pm.UserInfo;
 import android.os.Bundle;
+import android.os.UserHandle;
+import android.os.UserManager;
 import android.os.storage.DiskInfo;
 import android.os.storage.StorageManager;
 import android.os.storage.VolumeInfo;
@@ -250,6 +254,16 @@
         private StorageManager mStorageManager;
         @Override
         public void onReceive(Context context, Intent intent) {
+            final UserManager userManager =
+                    (UserManager) context.getSystemService(Context.USER_SERVICE);
+            final UserInfo userInfo = userManager.getUserInfo(UserHandle.myUserId());
+
+            if (userInfo.isRestricted() ||
+                    ActivityManager.getCurrentUser() != UserHandle.myUserId()) {
+                Log.d(TAG, "Ignoring storage notification: wrong user");
+                return;
+            }
+
             mStorageManager = context.getSystemService(StorageManager.class);
 
             if (TextUtils.equals(intent.getAction(), VolumeInfo.ACTION_VOLUME_STATE_CHANGED)) {