#include "base/base_paths.h"
#include <limits.h>
#include <unistd.h>
#include <ostream>
#include "base/android/jni_android.h"
#include "base/android/path_utils.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/notimplemented.h"
#include "base/process/process_metrics.h"
namespace base {
bool PathProviderAndroid(int key, FilePath* result) {
switch (key) {
case base::FILE_EXE: {
FilePath bin_dir;
if (!ReadSymbolicLink(FilePath(kProcSelfExe), &bin_dir)) {
LOG(ERROR) << "Unable to resolve " << kProcSelfExe << ".";
return false;
}
*result = bin_dir;
return true;
}
case base::FILE_MODULE:
NOTIMPLEMENTED();
return false;
case base::DIR_MODULE:
return base::android::GetNativeLibraryDirectory(result);
case base::DIR_SRC_TEST_DATA_ROOT:
case base::DIR_OUT_TEST_DATA_ROOT:
NOTIMPLEMENTED();
return false;
case base::DIR_USER_DESKTOP:
NOTIMPLEMENTED();
return false;
case base::DIR_CACHE:
return base::android::GetCacheDirectory(result);
case base::DIR_ASSETS:
return false;
case base::DIR_ANDROID_APP_DATA:
return base::android::GetDataDirectory(result);
case base::DIR_ANDROID_EXTERNAL_STORAGE:
return base::android::GetExternalStorageDirectory(result);
}
return false;
}
}