Send APK path as param too

This commit is contained in:
twinaphex 2015-07-08 02:42:19 +02:00
parent b6760e27fb
commit a59fd029b1
2 changed files with 29 additions and 6 deletions

View File

@ -193,7 +193,8 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
prefs.getString("libretro_path", ctx.getApplicationInfo().dataDir + "/cores/"), prefs.getString("libretro_path", ctx.getApplicationInfo().dataDir + "/cores/"),
UserPreferences.getDefaultConfigPath(ctx), UserPreferences.getDefaultConfigPath(ctx),
Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD), Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD),
ctx.getApplicationInfo().dataDir); ctx.getApplicationInfo().dataDir,
ctx.getApplicationInfo().sourceDir);
startActivity(retro); startActivity(retro);
} }
// Quit RetroArch preference // Quit RetroArch preference
@ -208,7 +209,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
} }
public static void startRetroActivity(Intent retro, String contentPath, String corePath, public static void startRetroActivity(Intent retro, String contentPath, String corePath,
String configFilePath, String imePath, String dataDirPath) String configFilePath, String imePath, String dataDirPath, String dataSourcePath)
{ {
if (contentPath != null) { if (contentPath != null) {
retro.putExtra("ROM", contentPath); retro.putExtra("ROM", contentPath);
@ -217,6 +218,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
retro.putExtra("CONFIGFILE", configFilePath); retro.putExtra("CONFIGFILE", configFilePath);
retro.putExtra("IME", imePath); retro.putExtra("IME", imePath);
retro.putExtra("DATADIR", dataDirPath); retro.putExtra("DATADIR", dataDirPath);
retro.putExtra("APK", dataSourcePath);
retro.putExtra("SDCARD", Environment.getExternalStorageDirectory().getAbsolutePath()); retro.putExtra("SDCARD", Environment.getExternalStorageDirectory().getAbsolutePath());
retro.putExtra("DOWNLOADS", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath()); retro.putExtra("DOWNLOADS", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath());
retro.putExtra("SCREENSHOTS", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath()); retro.putExtra("SCREENSHOTS", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath());

View File

@ -439,6 +439,7 @@ static bool device_is_game_console(const char *name)
static char screenshot_dir[PATH_MAX_LENGTH]; static char screenshot_dir[PATH_MAX_LENGTH];
static char downloads_dir[PATH_MAX_LENGTH]; static char downloads_dir[PATH_MAX_LENGTH];
static char apk_path[PATH_MAX_LENGTH];
static char sdcard_dir[PATH_MAX_LENGTH]; static char sdcard_dir[PATH_MAX_LENGTH];
static char app_dir[PATH_MAX_LENGTH]; static char app_dir[PATH_MAX_LENGTH];
@ -590,7 +591,7 @@ static void frontend_android_get_environment_settings(int *argc,
if (*sdcard_dir) if (*sdcard_dir)
{ {
RARCH_LOG("External Storage Location %s.\n", sdcard_dir); RARCH_LOG("External Storage Location %s.\n", sdcard_dir);
//todo base dir handler /* TODO base dir handler */
} }
} }
@ -612,7 +613,7 @@ static void frontend_android_get_environment_settings(int *argc,
if (*screenshot_dir) if (*screenshot_dir)
{ {
RARCH_LOG("Screenshot Directory [%s]s.\n", screenshot_dir); RARCH_LOG("Screenshot Directory [%s]s.\n", screenshot_dir);
//todo screenshot handler /* TODO: screenshot handler */
} }
} }
@ -634,7 +635,27 @@ static void frontend_android_get_environment_settings(int *argc,
if (*downloads_dir) if (*downloads_dir)
{ {
RARCH_LOG("Download Directory [%s].\n", downloads_dir); RARCH_LOG("Download Directory [%s].\n", downloads_dir);
//todo downloads handler /* TODO: downloads handler */
}
}
CALL_OBJ_METHOD_PARAM(env, jstr, obj, android_app->getStringExtra,
(*env)->NewStringUTF(env, "APK"));
if (android_app->getStringExtra && jstr)
{
const char *argv = NULL;
*apk_path = '\0';
argv = (*env)->GetStringUTFChars(env, jstr, 0);
if (argv && *argv)
strlcpy(apk_path, argv, sizeof(apk_path));
(*env)->ReleaseStringUTFChars(env, jstr, argv);
if (*apk_path)
{
RARCH_LOG("APK Path [%s].\n", apk_path);
} }
} }
@ -720,7 +741,7 @@ static void frontend_android_get_environment_settings(int *argc,
g_defaults.settings.video_threaded_enable = true; g_defaults.settings.video_threaded_enable = true;
// Set automatic default values per device /* Set automatic default values per device */
if (device_is_xperia_play(device_model)) if (device_is_xperia_play(device_model))
{ {
g_defaults.settings.out_latency = 128; g_defaults.settings.out_latency = 128;