Don't create if not primary user
PhoneGlobals is instantiated only for primary users so check for
attempts to bring up this settings screen for non-primary users.
Bug:18354968
Change-Id: I449287603de51c7a42fc3ca27b8b46681129f6bb
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 2755bd7..7e670aa 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -52,6 +52,7 @@
import android.util.Log;
import android.view.MenuItem;
import android.widget.ListAdapter;
+import android.widget.Toast;
import com.android.ims.ImsManager;
import com.android.internal.telephony.CallForwardInfo;
@@ -1123,6 +1124,14 @@
super.onCreate(icicle);
if (DBG) log("onCreate: Intent is " + getIntent());
+ // Make sure we are running as the primary user.
+ if (UserHandle.myUserId() != UserHandle.USER_OWNER) {
+ Toast.makeText(this, R.string.call_settings_primary_user_only,
+ Toast.LENGTH_SHORT).show();
+ finish();
+ return;
+ }
+
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
mVmProviderSettingsUtil = new VoicemailProviderSettingsUtil(getApplicationContext());