Merge pull request #18101 from unknownbrackets/android-run-tests

Android: Fix developer tools -> run tests
This commit is contained in:
Henrik Rydgård 2023-09-08 08:34:34 +02:00 committed by GitHub
commit 2e22fbdb8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View File

@ -40,7 +40,7 @@ bool RequestManager::MakeSystemRequest(SystemRequestType type, RequestCallback c
callbackMap_[requestId] = { callback, failedCallback };
}
DEBUG_LOG(SYSTEM, "Making system request %s: id %d", RequestTypeAsString(type), requestId);
VERBOSE_LOG(SYSTEM, "Making system request %s: id %d", RequestTypeAsString(type), requestId);
if (!System_MakeRequest(type, requestId, param1, param2, param3)) {
if (callback || failedCallback) {
std::lock_guard<std::mutex> guard(callbackMutex_);

View File

@ -21,6 +21,7 @@
#include "Common/Thread/ThreadUtil.h"
#include "Common/System/Request.h"
#include "Common/File/AndroidContentURI.h"
#include "Common/File/FileUtil.h"
#include "Common/StringUtils.h"
#ifdef _WIN32
@ -380,6 +381,10 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
std::string path = full_path.GetDirectory();
std::string file = full_path.GetFilename();
if (full_path.Type() == PathType::CONTENT_URI) {
path = AndroidContentURI(full_path.c_str()).FilePath();
}
size_t pos = path.find("PSP/GAME/");
std::string ms_path;
if (pos != std::string::npos) {
@ -393,7 +398,11 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
if (!PSP_CoreParameter().mountRoot.empty()) {
// We don't want to worry about .. and cwd and such.
const Path rootNorm = NormalizePath(PSP_CoreParameter().mountRoot);
const Path pathNorm = NormalizePath(Path(path));
Path pathNorm = NormalizePath(Path(path));
if (full_path.Type() == PathType::CONTENT_URI) {
pathNorm = full_path.NavigateUp();
}
// If root is not a subpath of path, we can't boot the game.
if (!pathNorm.StartsWith(rootNorm)) {
@ -402,10 +411,17 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
return false;
}
// TODO(scoped): This won't work!
const std::string filepath = ReplaceAll(pathNorm.ToString().substr(rootNorm.ToString().size()), "\\", "/");
std::string filepath;
if (full_path.Type() == PathType::CONTENT_URI) {
std::string rootFilePath = AndroidContentURI(rootNorm.c_str()).FilePath();
std::string pathFilePath = AndroidContentURI(pathNorm.c_str()).FilePath();
filepath = pathFilePath.substr(rootFilePath.size());
} else {
filepath = ReplaceAll(pathNorm.ToString().substr(rootNorm.ToString().size()), "\\", "/");
}
file = filepath + "/" + file;
path = rootNorm.ToString() + "/";
path = rootNorm.ToString();
pspFileSystem.SetStartingDirectory(filepath);
} else {
pspFileSystem.SetStartingDirectory(ms_path);