~aleteoryx/muditaos

60568d92478388ee55c7ff7df788c84f756787b5 — Bartosz 2 years ago 34485ba
[MOS-856] Add MTP path to DeviceInfo endpoint

Added MTP path for products to enable MC to use it instead
of hardcoded paths
M module-services/service-desktop/endpoints/include/endpoints/JsonKeyNames.hpp => module-services/service-desktop/endpoints/include/endpoints/JsonKeyNames.hpp +1 -0
@@ 55,6 55,7 @@ namespace sdesktop::endpoints::json
    inline constexpr auto updateFilePath         = "updateFilePath";
    inline constexpr auto backupFilePath         = "backupFilePath";
    inline constexpr auto syncFilePath           = "syncFilePath";
    inline constexpr auto mtpPath                = "mtpPath";
    inline constexpr auto deviceToken            = "deviceToken";

    namespace updateprocess

M module-vfs/paths/filesystem_paths.cpp => module-vfs/paths/filesystem_paths.cpp +8 -0
@@ 80,6 80,14 @@ namespace purefs
        {
            return getSystemDiskPath() / PATH_VAR;
        }
        std::filesystem::path getMusicPlayerPath() noexcept
        {
            return purefs::dir::getUserMediaPath() / "app/music_player";
        }
        std::filesystem::path getRelaxationPath() noexcept
        {
            return purefs::dir::getUserMediaPath() / "app/relaxation";
        }

    } // namespace dir
} // namespace purefs

M module-vfs/paths/include/purefs/filesystem_paths.hpp => module-vfs/paths/include/purefs/filesystem_paths.hpp +3 -0
@@ 21,6 21,9 @@ namespace purefs
        std::filesystem::path getAssetsDirPath() noexcept;
        std::filesystem::path getSystemDataDirPath() noexcept;
        std::filesystem::path getSystemVarDirPath() noexcept;
        std::filesystem::path getMusicPlayerPath() noexcept;
        std::filesystem::path getRelaxationPath() noexcept;

    } // namespace dir

    namespace file

M products/BellHybrid/BellHybridMain.cpp => products/BellHybrid/BellHybridMain.cpp +1 -1
@@ 82,7 82,7 @@ int main()
    systemServices.emplace_back(sys::CreatorFor<service::ServiceFileIndexer>(std::move(fileIndexerAudioPaths)));
    systemServices.emplace_back(sys::CreatorFor<ServiceDB>());
    systemServices.emplace_back(sys::CreatorFor<service::Audio>());
    systemServices.emplace_back(sys::CreatorFor<ServiceDesktop>(purefs::dir::getUserMediaPath() / "app/relaxation"));
    systemServices.emplace_back(sys::CreatorFor<ServiceDesktop>(purefs::dir::getRelaxationPath()));
    systemServices.emplace_back(sys::CreatorFor<stm::ServiceTime>(std::make_shared<alarms::AlarmOperationsFactory>()));
    systemServices.emplace_back(sys::CreatorFor<service::eink::ServiceEink>(service::eink::ExitAction::None));
    systemServices.emplace_back(

M products/BellHybrid/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp => products/BellHybrid/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp +2 -1
@@ 46,7 46,8 @@ namespace sdesktop::endpoints
              (purefs::dir::getTemporaryPath() / sdesktop::paths::recoveryStatusFilename).string()},
             {json::updateFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::updateFilename).string()},
             {json::backupFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::backupFilename).string()},
             {json::syncFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::syncFilename).string()}}));
             {json::syncFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::syncFilename).string()},
             {json::mtpPath, purefs::dir::getRelaxationPath().string()}}));

        return http::Code::OK;
    }

M products/PurePhone/PurePhoneMain.cpp => products/PurePhone/PurePhoneMain.cpp +1 -1
@@ 182,7 182,7 @@ int main()
    systemServices.emplace_back(sys::CreatorFor<ServiceBluetooth>());
#endif
#ifdef ENABLE_SERVICE_DESKTOP
    systemServices.emplace_back(sys::CreatorFor<ServiceDesktop>(purefs::dir::getUserMediaPath() / "app/music_player"));
    systemServices.emplace_back(sys::CreatorFor<ServiceDesktop>(purefs::dir::getMusicPlayerPath()));
#endif
#ifdef ENABLE_SERVICE_TIME
    systemServices.emplace_back(sys::CreatorFor<stm::ServiceTime>(std::make_shared<alarms::AlarmOperationsFactory>()));

M products/PurePhone/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp => products/PurePhone/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp +1 -0
@@ 62,6 62,7 @@ namespace sdesktop::endpoints
             {json::updateFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::updateFilename).string()},
             {json::backupFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::backupFilename).string()},
             {json::syncFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::syncFilename).string()},
             {json::mtpPath, purefs::dir::getMusicPlayerPath().string()},
             {json::deviceToken, getDeviceToken()}}));

        return http::Code::OK;