#include <manifest_parser/utils/logging.h>
+#include "common/request.h"
#include "common/utils/byte_size_literals.h"
#include "common/utils/file_util.h"
uid_);
break;
default:
- LOG(ERROR) << "Not supported installation mode";
+ LOG(ERROR) << "Not supported installation mode ("
+ << GetRequestTypeString(type_) << ")";
}
return ret == APP2EXT_STATUS_SUCCESS;
}
uid_);
break;
default:
- LOG(ERROR) << "Installation type is not supported by external installation";
+ LOG(ERROR) << "Installation type (" << GetRequestTypeString(type_) << ")"
+ << " is not supported by external installation";
ret = -1;
break;
}
#include "common/request.h"
+#include <map>
+#include <string>
#include <tzplatform_config.h>
#include <unistd.h>
namespace common_installer {
+const std::map<RequestType, const char*> kRequestTypeStringMap = {
+ {RequestType::Unknown, "Unknown"},
+ {RequestType::Install, "Install"},
+ {RequestType::Update, "Update"},
+ {RequestType::Uninstall, "Uninstall"},
+ {RequestType::Reinstall, "Reinstall"},
+ {RequestType::Delta, "Delta"},
+ {RequestType::Move, "Move"},
+ {RequestType::Recovery, "Recovery"},
+ {RequestType::RecoveryUpdate, "RecoveryUpdate"},
+ {RequestType::MountInstall, "MountInstall"},
+ {RequestType::MountUpdate, "MountUpdate"},
+ {RequestType::ManifestDirectInstall, "ManifestDirectInstall"},
+ {RequestType::ManifestDirectUpdate, "ManifestDirectUpdate"},
+ {RequestType::ManifestPartialInstall, "ManifestPartialInstall"},
+ {RequestType::ManifestPartialUpdate, "ManifestPartialUpdate"},
+ {RequestType::PartialUninstall, "PartialUninstall"},
+ {RequestType::ReadonlyUpdateInstall, "ReadonlyUpdateInstall"},
+ {RequestType::ReadonlyUpdateUninstall, "ReadonlyUpdateUninstall"},
+ {RequestType::DisablePkg, "DisablePkg"},
+ {RequestType::EnablePkg, "EnablePkg"},
+ {RequestType::MigrateExtImg, "MigrateExtImg"},
+ {RequestType::RecoverDB, "RecoverDB"},
+};
+
+std::string GetRequestTypeString(RequestType request_type) {
+ const auto& it = kRequestTypeStringMap.find(request_type);
+ if (it == kRequestTypeStringMap.end())
+ return "Unknown";
+ else
+ return it->second;
+}
+
RequestMode GetRequestMode(uid_t uid) {
return (uid == tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)) ?
RequestMode::GLOBAL : RequestMode::USER;