When I'm trying to use android 'am' command to start an activity ,it's wrong under 4.2 platform(I tried , it's ok under 2.3 version).The code is like this
out = process.getOutputStream(); out.write(("am start -a android.intent.action.VIEW -n com.android.browser/com.android.browser.BrowserActivity\n").getBytes()); out.flush(); InputStream in = process.getInputStream(); BufferedReader re = new BufferedReader(new InputStreamReader(in)); String line = null; while((line = re.readLine()) != null) { Log.d("conio","[result]"+line); }
and the error is like this:
java.lang.SecurityException: Permission Denial: startActivity asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL at android.os.Parcel.readException(Parcel.java:1425) at android.os.Parcel.readException(Parcel.java:1379) at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:1921) at com.android.commands.am.Am.runStart(Am.java:494) at com.android.commands.am.Am.run(Am.java:109) at com.android.commands.am.Am.main(Am.java:82) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235) at dalvik.system.NativeStart.main(Native Method)
I want to know
1.what does the user -2 and 0 means?
2.where I can find the details about these ids?
3.what should I do,just add the permissions? I don't want to add the permissions which I know nothing about them.Could anyone help me it,very thanks!