Returns the renderdoccmd arguments passed via am start Examples: am start ... -e renderdoccmd "remoteserver" -e renderdoccmd "replay /sdcard/capture.rdc"
| 401 | // Examples: am start ... -e renderdoccmd "remoteserver" |
| 402 | // -e renderdoccmd "replay /sdcard/capture.rdc" |
| 403 | std::vector<std::string> getRenderdoccmdArgs() |
| 404 | { |
| 405 | JNIEnv *env; |
| 406 | android_state->activity->vm->AttachCurrentThread(&env, 0); |
| 407 | |
| 408 | jobject me = android_state->activity->clazz; |
| 409 | |
| 410 | jclass acl = env->GetObjectClass(me); // class pointer of NativeActivity |
| 411 | jmethodID giid = env->GetMethodID(acl, "getIntent", "()Landroid/content/Intent;"); |
| 412 | jobject intent = env->CallObjectMethod(me, giid); // Got our intent |
| 413 | |
| 414 | jclass icl = env->GetObjectClass(intent); // class pointer of Intent |
| 415 | jmethodID gseid = |
| 416 | env->GetMethodID(icl, "getStringExtra", "(Ljava/lang/String;)Ljava/lang/String;"); |
| 417 | |
| 418 | jstring jsParam1 = (jstring)env->CallObjectMethod(intent, gseid, env->NewStringUTF("renderdoccmd")); |
| 419 | |
| 420 | std::vector<std::string> ret; |
| 421 | if(jsParam1) // Check if arg value found |
| 422 | { |
| 423 | ret.push_back("renderdoccmd"); |
| 424 | const char *param1 = env->GetStringUTFChars(jsParam1, 0); |
| 425 | std::istringstream iss(param1); |
| 426 | while(iss) |
| 427 | { |
| 428 | std::string sub; |
| 429 | iss >> sub; |
| 430 | ret.push_back(sub); |
| 431 | } |
| 432 | } |
| 433 | android_state->activity->vm->DetachCurrentThread(); |
| 434 | |
| 435 | return ret; |
| 436 | } |
| 437 | |
| 438 | void *cmdthread(void *) |
| 439 | { |