summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/certinstaller/CertInstaller.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/certinstaller/CertInstaller.java b/src/com/android/certinstaller/CertInstaller.java
index d6e3ed6..c953416 100644
--- a/src/com/android/certinstaller/CertInstaller.java
+++ b/src/com/android/certinstaller/CertInstaller.java
@@ -25,6 +25,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
+import android.os.UserHandle;
import android.security.Credentials;
import android.security.KeyChain;
import android.security.KeyChain.KeyChainConnection;
@@ -84,6 +85,12 @@ public class CertInstaller extends Activity {
protected void onCreate(Bundle savedStates) {
super.onCreate(savedStates);
+ if (UserHandle.myUserId() != UserHandle.USER_OWNER) {
+ toastErrorAndFinish(R.string.only_primary_user_allowed);
+ finish();
+ return;
+ }
+
mCredentials = createCredentialHelper(getIntent());
mState = (savedStates == null) ? STATE_INIT : STATE_RUNNING;