~aleteoryx/muditaos

950cf78aa9fe3f30d25d5048f0ec46bf5fe2eac0 — Lukasz Mastalerz 2 years ago f90e513
[CP-1825] Update while on onboarding screen

Add a parameter to device info about onboarding state.
Update documentation for Pure and Harmony.
25 files changed, 404 insertions(+), 124 deletions(-)

A doc/os_api/endpoints/harmony/device_info_endpoint.md
M doc/os_api/endpoints/pure/device_info_endpoint.md
M harmony_changelog.md
M module-services/service-appmgr/model/ApplicationManagerCommon.cpp
M module-services/service-desktop/ServiceDesktop.cpp
M module-services/service-desktop/USBSecurityModel.cpp
M module-services/service-desktop/endpoints/include/endpoints/Endpoint.hpp
M module-services/service-desktop/endpoints/include/endpoints/JsonKeyNames.hpp
M module-services/service-desktop/endpoints/security/SecurityEndpointHelper.cpp
M module-services/service-desktop/include/service-desktop/ServiceDesktop.hpp
M module-services/service-desktop/include/service-desktop/USBSecurityModel.hpp
M products/BellHybrid/services/appmgr/ApplicationManager.cpp
M products/BellHybrid/services/db/databases/migration/settings_bell/0/up.sql
A products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/.meta
A products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/down.sql
A products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/up.sql
M products/BellHybrid/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp
M products/BellHybrid/services/desktop/endpoints/include/endpoints/deviceInfo/DeviceInfoEndpoint.hpp
A products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/.meta
A products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/down.sql
A products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/up.sql
M products/PurePhone/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp
M products/PurePhone/services/desktop/endpoints/include/endpoints/deviceInfo/DeviceInfoEndpoint.hpp
M pure_changelog.md
M test/pytest/service-desktop/test_device_info.py
A doc/os_api/endpoints/harmony/device_info_endpoint.md => doc/os_api/endpoints/harmony/device_info_endpoint.md +165 -0
@@ 0,0 1,165 @@
Device Info endpoint (1)
=============================

* [Parameters explanation](#parameters-explanation)
* [Usage examples](#usage-examples)
    * [Get Device Information](#get-device-information)
    * [Get a List of logs and crash dumps](#get-a-list-of-logs-and-crash-dumps)

## Parameters explanation

[Common parameters explanation](../../protocol_description/common_parameters_explanation.md)

## Usage examples

### Get Device Information

**Request Payload Structure**

```json
#000000036
{
"endpoint": 1,
"method": 1,
"uuid": 123
}
```

Parameters:

- *endpoint* - endpoint type (it’s set to 1, which means **“deviceInfo”** type) - see code snippets below
- *method* - method type (it’s set to 1, which means **“get”** method) - see code snippets below
- *uuid* - unique payload id

**Response Payload Structure**

```json
{
  "body": {
    "batteryLevel": "68",
    "batteryState": "2",
    "deviceSpaceTotal": "4005",
    "systemReservedSpace": "798",
    "usedUserSpace": "2",
    "gitBranch": "master",
    "gitRevision": "58e3688f6",
    "gitTag": "release-0.73.1-rc1-11-g58e3688f6",
    "currentRTCTime": "1626085629",
    "version": "0.73.1",
    "serialNumber": "12345678901234",
    "recoveryStatusFilePath": "path/to/recovery_status",
    "updateFilePath": "path/to/update_package",
    "backupFilePath": "path/to/backup_package",
    "syncFilePath": "path/to/sync_package",
    "mtpPath": "/path/to/music/assets/or/other/available/from/MTP",
    "onboardingState": "1"
  },
  "endpoint": 1,
  "status": 200,
  "uuid": 123
}
```

Parameters:

- *body*  - actual response from endpoint in response message
- *batteryLevel* - battery level (in percentage)
- *batteryState* - battery state - see code snippets below
- *currentRTCTime* - current timestamp from RTC (in seconds)
- *deviceToken* - unique device token
- *deviceSpaceTotal* - total storage space on the device (in Mebibytes)
- *systemReservedSpace* - storage space on the device reserved for the OS (in Mebibytes)
- *usedUserSpace* - storage space on the device used for user files on the user partition (in Mebibytes)
- *gitBranch* - git branch from which the system was built
- *gitRevision* - git commit sha from which the system was built
- *gitTag* - git tag from which the system was built
- *endpoint* - endpoint type (it’s set to 1, which means “deviceInfo” type)
- *status* - http like status code - see code snippets below
- *uuid* - unique payload id, same as in request message
- *version* - os version string
- *serialNumber* - device serial number (14 digits)
- *recoveryStatusFilePath* - location of the PureRecovery status file
- *updateFilePath* - location of the update package
- *backupFilePath* - location of the backup package
- *syncFilePath* - location of the sync package
- *mtpPath* - path to the catalog available via MTP
- *onboardingState* - information about current onboarding state

```c++
struct Battery
{
    enum class State
    {
        Discharging,
        Charging,
        PluggedNotCharging,
    }
};
```

```c++
enum class OnboardingState{
    InProgress,
    Finished
};
```

### Get a List of logs and crash dumps

**Request Payload Structure**

```json
{
  "endpoint": 1,
  "method": 1,
  "uuid": 123,
  "body": {
    "fileList": 0
  }
}
```

Parameters:

- *endpoint* - endpoint type (it’s set to 1, which means “**deviceInfo**” type) - see code snippets below
- *method* - method type (it’s set to 1, which means “**get**” method) - see code snippets below
- *uuid* - unique payload id
- *fileList* - indicates the type of diagnostic data to be listed - see below

```c++
enum class DiagnosticsFileList
{
    LOGS = 0,
    CRASH_DUMPS,
    TDB
}
```

**Response Payload Structure**  
List of available log files

```json
{
  "endpoint": 1,
  "status": 200,
  "uuid": 123,
  "body": {
    "files": [
      "/sys/user/MuditaOS.log",
      "/sys/user/MuditaOS.log.1",
      "/sys/user/MuditaOS.log.2"
    ]
  }
}
```

Empty response, no log/crash dump files available on a device

```json
#000000036
{
"endpoint": 1,
"status": 204,
"uuid": 123
}
```
\ No newline at end of file

M doc/os_api/endpoints/pure/device_info_endpoint.md => doc/os_api/endpoints/pure/device_info_endpoint.md +131 -102
@@ 1,35 1,39 @@
Device Info endpoint (1)
=============================

* [Parameters explanation](#parameters-explanation)
* [Usage examples](#usage-examples)
  * [Get Device Information](#get-device-information)
  * [Get a List of logs and crash dumps](#get-a-list-of-logs-and-crash-dumps)

    * [Get Device Information](#get-device-information)
    * [Get a List of logs and crash dumps](#get-a-list-of-logs-and-crash-dumps)

## Parameters explanation

[Common parameters explanation](../../protocol_description/common_parameters_explanation.md)

## Usage examples

### Get Device Information

**Request Payload Structure**
```

```json
#000000036
{
   "endpoint":1,
   "method":1,
   "uuid":123
"endpoint": 1,
"method": 1,
"uuid": 123
}
```

 Parameters:
Parameters:

 - *endpoint* - endpoint type (it’s set to 1, which means **“deviceInfo”** type) - see code snippets below
 - *method* - method type (it’s set to 1, which means **“get”** method) - see code snippets below
 - *uuid* - unique payload id
- *endpoint* - endpoint type (it’s set to 1, which means **“deviceInfo”** type) - see code snippets below
- *method* - method type (it’s set to 1, which means **“get”** method) - see code snippets below
- *uuid* - unique payload id

 “*body*” parameter is not needed in this case.
“*body*” parameter is not needed in this case.

```
```c++
enum class EndpointType
{
    invalid = 0,


@@ 45,7 49,8 @@ enum class EndpointType
    developerMode,
};
```
```

```c++
enum class Method
{
    get = 1,


@@ 56,72 61,75 @@ enum class Method
```

**Response Payload Structure**
```

```json
{
   "body":{
      "accessTechnology":"7",
      "batteryLevel":"68",
      "batteryState":"2",
      "caseColour":"gray",
      "currentRTCTime":"1626085629",
      "deviceToken":"<32-character string"
      "deviceSpaceTotal":"14945",
      "systemReservedSpace":"2042",
      "usedUserSpace":"440",
      "gitBranch":"master",
      "gitRevision":"58e3688f6",
      "gitTag":"release-0.73.1-rc1-11-g58e3688f6",
      "networkOperatorName":"Play",
      "networkStatus":"1",
      "selectedSim":"0",
      "signalStrength":"2",
      "trayState":"1",
      "version": "0.73.1",
      "serialNumber": "12345678901234",
      "recoveryStatusFilePath": "path/to/recovery_status",
      "updateFilePath": "path/to/update_package",
      "backupFilePath": "path/to/backup_package",
      "syncFilePath": "path/to/sync_package",
      "mtpPath": "/path/to/music/assets/or/other/available/from/MTP"
   },
   "endpoint":1,
   "status":200,
   "uuid":123
  "body": {
    "accessTechnology": "7",
    "batteryLevel": "68",
    "batteryState": "2",
    "caseColour": "gray",
    "currentRTCTime": "1626085629",
    "deviceToken": "<32-character string"
    "deviceSpaceTotal": "14945",
    "systemReservedSpace": "2042",
    "usedUserSpace": "440",
    "gitBranch": "master",
    "gitRevision": "58e3688f6",
    "gitTag": "release-0.73.1-rc1-11-g58e3688f6",
    "networkOperatorName": "Play",
    "networkStatus": "1",
    "selectedSim": "0",
    "signalStrength": "2",
    "trayState": "1",
    "version": "0.73.1",
    "serialNumber": "12345678901234",
    "recoveryStatusFilePath": "path/to/recovery_status",
    "updateFilePath": "path/to/update_package",
    "backupFilePath": "path/to/backup_package",
    "syncFilePath": "path/to/sync_package",
    "mtpPath": "/path/to/music/assets/or/other/available/from/MTP",
    "onboardingState": "1"
  },
  "endpoint": 1,
  "status": 200,
  "uuid": 123
}
```

 Parameters:
 
 - *body*  - actual response from endpoint in response message
 - *accessTechnology* - network access technology - see code snippets below
 - *batteryLevel* - battery level (in percentage)
 - *batteryState* - battery state - see code snippets below
 - *caseColour* - colour of the Pure’s case (gray or black)
 - *currentRTCTime* - current timestamp from RTC (in seconds)
 - *deviceToken* - unique device token
 - *deviceSpaceTotal* - total storage space on the device (in Mebibytes)
 - *systemReservedSpace* - storage space on the device reserved for the OS (in Mebibytes)
 - *usedUserSpace* - storage space on the device used for user files on the user partition (in Mebibytes)
 - *gitBranch* - git branch from which the system was built 
 - *gitRevision* - git commit sha from which the system was built
 - *gitTag* - git tag from which the system was built
 - *networkOperatorName* - current network operator name
 - *networkStatus* - current status of network - see code snippets below
 - *selectedSim* - selected SIM status - see code snippets below
 - *signalStrength* - number of signal strength indicator bars - from 0 to 4
 - *trayState* - state of SIM tray - see code snippets below
 - *endpoint* - endpoint type (it’s set to 1, which means “deviceInfo” type)
 - *status* - http like status code - see code snippets below
 - *uuid* - unique payload id, same as in request message
 - *version* - os version string
 - *serialNumber* - device serial number (14 digits)
 - *recoveryStatusFilePath* - location of the PureRecovery status file
 - *updateFilePath* - location of the update package
 - *backupFilePath* - location of the backup package
 - *syncFilePath* - location of the sync package
 - *mtpPath* - path to the catalog available via MTP

```
Parameters:

- *body*  - actual response from endpoint in response message
- *accessTechnology* - network access technology - see code snippets below
- *batteryLevel* - battery level (in percentage)
- *batteryState* - battery state - see code snippets below
- *caseColour* - colour of the Pure’s case (gray or black)
- *currentRTCTime* - current timestamp from RTC (in seconds)
- *deviceToken* - unique device token
- *deviceSpaceTotal* - total storage space on the device (in Mebibytes)
- *systemReservedSpace* - storage space on the device reserved for the OS (in Mebibytes)
- *usedUserSpace* - storage space on the device used for user files on the user partition (in Mebibytes)
- *gitBranch* - git branch from which the system was built
- *gitRevision* - git commit sha from which the system was built
- *gitTag* - git tag from which the system was built
- *networkOperatorName* - current network operator name
- *networkStatus* - current status of network - see code snippets below
- *selectedSim* - selected SIM status - see code snippets below
- *signalStrength* - number of signal strength indicator bars - from 0 to 4
- *trayState* - state of SIM tray - see code snippets below
- *endpoint* - endpoint type (it’s set to 1, which means “deviceInfo” type)
- *status* - http like status code - see code snippets below
- *uuid* - unique payload id, same as in request message
- *version* - os version string
- *serialNumber* - device serial number (14 digits)
- *recoveryStatusFilePath* - location of the PureRecovery status file
- *updateFilePath* - location of the update package
- *backupFilePath* - location of the backup package
- *syncFilePath* - location of the sync package
- *mtpPath* - path to the catalog available via MTP
- *onboardingState* - information about current onboarding state

```c++
struct Network
{
    enum class Status


@@ 147,7 155,8 @@ struct Network
    }
};
```
```

```c++
struct Battery
{
    enum class State


@@ 158,7 167,8 @@ struct Battery
    }
};
```
```

```c++
enum class SIM
{
    SIM1 = 0,


@@ 168,7 178,8 @@ enum class SIM
    NONE,
}
```
```

```c++
enum class Tray
{
    OUT = 0,


@@ 176,25 187,36 @@ enum class Tray
}
```

```c++
enum class OnboardingState{
    InProgress,
    Finished
};
```

### Get a List of logs and crash dumps

### Get a List of diagnostics files
**Request Payload Structure**
```

```json
{
   "endpoint":1,
   "method":1,
   "uuid":123,
   "body": { "fileList":0 }
  "endpoint": 1,
  "method": 1,
  "uuid": 123,
  "body": {
    "fileList": 0
  }
}
```

 Parameters:
 - *endpoint* - endpoint type (it’s set to 1, which means “**deviceInfo**” type) - see code snippets below
 - *method* - method type (it’s set to 1, which means “**get**” method) - see code snippets below
 - *uuid* - unique payload id
 - *fileList* - indicates the type of diagnostic data to be listed - see below
Parameters:

```
- *endpoint* - endpoint type (it’s set to 1, which means “**deviceInfo**” type) - see code snippets below
- *method* - method type (it’s set to 1, which means “**get**” method) - see code snippets below
- *uuid* - unique payload id
- *fileList* - indicates the type of diagnostic data to be listed - see below

```c++
enum class DiagnosticsFileList
{
    LOGS = 0,


@@ 205,22 227,29 @@ enum class DiagnosticsFileList

**Response Payload Structure**  
List of available log files
```

```json
{
   "endpoint":1,
   "status":200,
   "uuid":123,
   "body": {"files":[ "/sys/user/MuditaOS.log",
                      "/sys/user/MuditaOS.log.1",
                      "/sys/user/MuditaOS.log.2" ] }
  "endpoint": 1,
  "status": 200,
  "uuid": 123,
  "body": {
    "files": [
      "/sys/user/MuditaOS.log",
      "/sys/user/MuditaOS.log.1",
      "/sys/user/MuditaOS.log.2"
    ]
  }
}
```

Empty response, no log/crash dump files available on a device
```

```json
#000000036
{
   "endpoint":1,
   "status":204,
   "uuid":123
"endpoint": 1,
"status": 204,
"uuid": 123
}
```
\ No newline at end of file

M harmony_changelog.md => harmony_changelog.md +1 -0
@@ 18,6 18,7 @@
### Changed

* Added serial number and timestamp to crashdump filename
* Added new field to deviceInfo endpoint

## [1.8.0 2022-12-14]


M module-services/service-appmgr/model/ApplicationManagerCommon.cpp => module-services/service-appmgr/model/ApplicationManagerCommon.cpp +5 -3
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ApplicationManagerCommon.hpp"


@@ 481,14 481,16 @@ namespace app::manager

    auto ApplicationManagerCommon::handleOnBoardingFinalize() -> sys::MessagePointer
    {
        settings->setValue(settings::SystemProperties::onboardingDone, utils::to_string(true));
        settings->setValue(
            settings::SystemProperties::onboardingDone, utils::to_string(true), settings::SettingsScope::Global);
        app::manager::Controller::sendAction(this, app::manager::actions::Home);
        return sys::msgHandled();
    }

    auto ApplicationManagerCommon::checkOnBoarding() -> bool
    {
        return not utils::getNumericValue<bool>(settings->getValue(settings::SystemProperties::onboardingDone));
        return not utils::getNumericValue<bool>(
            settings->getValue(settings::SystemProperties::onboardingDone, settings::SettingsScope::Global));
    }

    auto ApplicationManagerCommon::handleLaunchAction(ActionEntry &action) -> ActionProcessStatus

M module-services/service-desktop/ServiceDesktop.cpp => module-services/service-desktop/ServiceDesktop.cpp +7 -0
@@ 10,6 10,7 @@
#include <service-evtmgr/EVMessages.hpp>
#include <system/messages/TetheringStateRequest.hpp>
#include <Timers/TimerFactory.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>

ServiceDesktop::ServiceDesktop(const std::filesystem::path &mtpRootPath)
    : sys::Service(service::name::service_desktop, "", sdesktop::service_stack),


@@ 367,3 368,9 @@ auto ServiceDesktop::getMtpPath() const noexcept -> std::filesystem::path
{
    return mtpRootPath;
}

auto ServiceDesktop::getOnboardingState() const -> sdesktop::endpoints::OnboardingState
{
    return static_cast<sdesktop::endpoints::OnboardingState>(utils::getNumericValue<int>(
        settings->getValue(settings::SystemProperties::onboardingDone, settings::SettingsScope::Global)));
}

M module-services/service-desktop/USBSecurityModel.cpp => module-services/service-desktop/USBSecurityModel.cpp +1 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "service-desktop/USBSecurityModel.hpp"

M module-services/service-desktop/endpoints/include/endpoints/Endpoint.hpp => module-services/service-desktop/endpoints/include/endpoints/Endpoint.hpp +7 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 23,6 23,12 @@ namespace sdesktop::endpoints
        EulaNotAccepted
    };

    enum class OnboardingState
    {
        InProgress,
        Finished
    };

    class Endpoint
    {
      public:

M module-services/service-desktop/endpoints/include/endpoints/JsonKeyNames.hpp => module-services/service-desktop/endpoints/include/endpoints/JsonKeyNames.hpp +1 -0
@@ 56,6 56,7 @@ namespace sdesktop::endpoints::json
    inline constexpr auto syncFilePath           = "syncFilePath";
    inline constexpr auto mtpPath                = "mtpPath";
    inline constexpr auto deviceToken            = "deviceToken";
    inline constexpr auto onboardingState        = "onboardingState";

    namespace updateprocess
    {

M module-services/service-desktop/endpoints/security/SecurityEndpointHelper.cpp => module-services/service-desktop/endpoints/security/SecurityEndpointHelper.cpp +1 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <endpoints/security/SecurityEndpointHelper.hpp>

M module-services/service-desktop/include/service-desktop/ServiceDesktop.hpp => module-services/service-desktop/include/service-desktop/ServiceDesktop.hpp +1 -0
@@ 81,6 81,7 @@ class ServiceDesktop : public sys::Service
    auto getNotificationEntries() const -> std::vector<Outbox::NotificationEntry>;
    void removeNotificationEntries(const std::vector<uint32_t> &);
    auto getMtpPath() const noexcept -> std::filesystem::path;
    auto getOnboardingState() const -> sdesktop::endpoints::OnboardingState;

  private:
    std::unique_ptr<sdesktop::USBSecurityModel> usbSecurityModel;

M module-services/service-desktop/include/service-desktop/USBSecurityModel.hpp => module-services/service-desktop/include/service-desktop/USBSecurityModel.hpp +1 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

M products/BellHybrid/services/appmgr/ApplicationManager.cpp => products/BellHybrid/services/appmgr/ApplicationManager.cpp +1 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <appmgr/ApplicationManager.hpp>

M products/BellHybrid/services/db/databases/migration/settings_bell/0/up.sql => products/BellHybrid/services/db/databases/migration/settings_bell/0/up.sql +1 -1
@@ 1,4 1,4 @@
-- Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
-- Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
-- For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

--

A products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/.meta => products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/.meta +6 -0
@@ 0,0 1,6 @@
{
 "id": "34a5f438-a1fe-4818-af74-d084dc67ddf2",
 "date": "2023-03-02 12:44:53",
 "message": "Move gs_onboarding_done to global scope",
 "parent": 0
}

A products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/down.sql => products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/down.sql +10 -0
@@ 0,0 1,10 @@
-- Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
-- For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

-- Message: Move gs_onboarding_done to global scope
-- Revision: 34a5f438-a1fe-4818-af74-d084dc67ddf2
-- Create Date: 2023-03-02 12:44:53

UPDATE OR IGNORE settings_tab
SET path = '\ApplicationManager\\gs_onboarding_done'
WHERE path='gs_onboarding_done';

A products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/up.sql => products/BellHybrid/services/db/databases/migration/settings_bell/current/34a5f438_Move_gs_onboarding_done_to_global_scope/up.sql +10 -0
@@ 0,0 1,10 @@
-- Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
-- For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

-- Message: Move gs_onboarding_done to global scope
-- Revision: 34a5f438-a1fe-4818-af74-d084dc67ddf2
-- Create Date: 2023-03-02 12:44:53

UPDATE OR IGNORE settings_tab
SET path = 'gs_onboarding_done'
WHERE path='\ApplicationManager\\gs_onboarding_done';

M products/BellHybrid/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp => products/BellHybrid/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp +7 -4
@@ 11,10 11,7 @@

#include <cstdint>
#include <string>
#include <vector>
#include <sys/statvfs.h>
#include <purefs/filesystem_paths.hpp>
#include <purefs/vfs_subsystem.hpp>
#include <serial-number-reader/SerialNumberReader.hpp>

#include <ctime>


@@ 27,6 24,11 @@ namespace sdesktop::endpoints
        return serial_number_reader::readSerialNumber();
    }

    auto DeviceInfoEndpoint::getOnboardingState() -> OnboardingState
    {
        return static_cast<ServiceDesktop *>(ownerServicePtr)->getOnboardingState();
    }

    auto DeviceInfoEndpoint::getDeviceInfo(Context &context) -> http::Code
    {
        auto [totalDeviceSpaceMiB, reservedSystemSpaceMiB, usedUserSpaceMiB] = getStorageInfo();


@@ 47,7 49,8 @@ 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, getMtpPath().string()}}));
             {json::mtpPath, getMtpPath().string()},
             {json::onboardingState, std::to_string(static_cast<int>(getOnboardingState()))}}));

        return http::Code::OK;
    }

M products/BellHybrid/services/desktop/endpoints/include/endpoints/deviceInfo/DeviceInfoEndpoint.hpp => products/BellHybrid/services/desktop/endpoints/include/endpoints/deviceInfo/DeviceInfoEndpoint.hpp +2 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 15,6 15,7 @@ namespace sdesktop::endpoints
        {}

        auto getSerialNumber() -> std::string;
        auto getOnboardingState() -> OnboardingState;
        auto getDeviceInfo(Context &context) -> http::Code override;
    };


A products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/.meta => products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/.meta +6 -0
@@ 0,0 1,6 @@
{
 "id": "06e96a01-c32c-49b7-8909-43b310f181ff",
 "date": "2023-03-02 13:41:10",
 "message": "Move gs_onboarding_done to global scope",
 "parent": 0
}

A products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/down.sql => products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/down.sql +10 -0
@@ 0,0 1,10 @@
-- Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
-- For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

-- Message: Move gs_onboarding_done to global scope
-- Revision: 06e96a01-c32c-49b7-8909-43b310f181ff
-- Create Date: 2023-03-02 13:41:10

UPDATE OR IGNORE settings_tab
SET path = '\ApplicationManager\\gs_onboarding_done'
WHERE path='gs_onboarding_done';

A products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/up.sql => products/PurePhone/services/db/databases/migration/settings_v2/current/06e96a01_Move_gs_onboarding_done_to_global_scope/up.sql +10 -0
@@ 0,0 1,10 @@
-- Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
-- For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

-- Message: Move gs_onboarding_done to global scope
-- Revision: 06e96a01-c32c-49b7-8909-43b310f181ff
-- Create Date: 2023-03-02 13:41:10

UPDATE OR IGNORE settings_tab
SET path = 'gs_onboarding_done'
WHERE path='\ApplicationManager\\gs_onboarding_done';

M products/PurePhone/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp => products/PurePhone/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp +7 -3
@@ 11,8 11,6 @@

#include <cstdint>
#include <string>
#include <vector>
#include <sys/statvfs.h>
#include <purefs/filesystem_paths.hpp>

#include <ctime>


@@ 34,6 32,11 @@ namespace sdesktop::endpoints
        return static_cast<ServiceDesktop *>(ownerServicePtr)->getDeviceToken();
    }

    auto DeviceInfoEndpoint::getOnboardingState() -> OnboardingState
    {
        return static_cast<ServiceDesktop *>(ownerServicePtr)->getOnboardingState();
    }

    auto DeviceInfoEndpoint::getDeviceInfo(Context &context) -> http::Code
    {
        auto [totalDeviceSpaceMiB, reservedSystemSpaceMiB, usedUserSpaceMiB] = getStorageInfo();


@@ 71,7 74,8 @@ namespace sdesktop::endpoints
             {json::backupFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::backupFilename).string()},
             {json::syncFilePath, (purefs::dir::getTemporaryPath() / sdesktop::paths::syncFilename).string()},
             {json::mtpPath, getMtpPath().string()},
             {json::deviceToken, getDeviceToken()}}));
             {json::deviceToken, getDeviceToken()},
             {json::onboardingState, std::to_string(static_cast<int>(getOnboardingState()))}}));

        return http::Code::OK;
    }

M products/PurePhone/services/desktop/endpoints/include/endpoints/deviceInfo/DeviceInfoEndpoint.hpp => products/PurePhone/services/desktop/endpoints/include/endpoints/deviceInfo/DeviceInfoEndpoint.hpp +2 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 22,6 22,7 @@ namespace sdesktop::endpoints
        auto getSerialNumber() -> std::string;
        auto getCaseColour() -> std::string;
        auto getDeviceToken() -> std::string;
        auto getOnboardingState() -> OnboardingState;

        auto getDeviceInfo(Context &context) -> http::Code override;
    };

M pure_changelog.md => pure_changelog.md +6 -0
@@ 19,6 19,7 @@
* Changed tethering icon on status bar
* Unified grey color tones used while displaying texts
* Replaced English labels occuring in French translation with French ones
* Added new field to deviceInfo endpoint

### Fixed



@@ 69,13 70,16 @@
## [1.6.0 2023-02-27]

### Changed / Improved

* Changed filesystem to ext4
* Improved update/restore/backup processes
* Changed updater utility
* Improved dialog with network via USSD
* Added serial number and timestamp to crashdump filename
* Changed order of starting services, ServiceDesktop moved to the back

### Fixed

* Fixed disappearing "confirm" button in PIN entering screen
* Fixed looping on the SIM card selection screen
* Fixed notes paste option showing for empty clipboard


@@ 105,7 109,9 @@
* Fixed navigation through the ringtone preview list to automatically switch playback to the currently selected option

## [1.5.1 2023-02-27]

### Added

* Added bootstrapped utilities to allow performing next (1.6.0) update

## [1.5.0 2022-12-20]

M test/pytest/service-desktop/test_device_info.py => test/pytest/service-desktop/test_device_info.py +5 -4
@@ 9,7 9,6 @@ from harness.api.device_info import GetDeviceInfo, GetDiagnosticFilesList, Diagn
@pytest.mark.usefixtures("phone_unlocked")
def test_get_device_information(harness):
    ret = GetDeviceInfo().run(harness)

    assert int(ret.diag_info["batteryLevel"]) <= 100
    assert ret.diag_info["batteryState"] in ['1', '2']
    assert ret.diag_info["selectedSim"] in ['0', '1', '4']


@@ 19,8 18,8 @@ def test_get_device_information(harness):
    assert 0 <= int(ret.diag_info["networkStatus"]) < 7
    assert ret.diag_info["networkOperatorName"] is not None
    assert 0 < int(ret.diag_info["usedUserSpace"]) <= 12903
    assert int(ret.diag_info["systemReservedSpace"]) == 1024
    assert int(ret.diag_info["deviceSpaceTotal"]) == (12903 + 1024)  # User + system partitions sizes
    assert int(ret.diag_info["systemReservedSpace"]) == 2048
    assert int(ret.diag_info["deviceSpaceTotal"]) == (12903 + 2048)  # User + system partitions sizes
    assert re.match(r"^(\d|[a-z]){8,40}$", ret.diag_info["gitRevision"])
    assert ret.diag_info["gitBranch"] is not None
    assert int(ret.diag_info["currentRTCTime"]) > 1641991996


@@ 32,6 31,7 @@ def test_get_device_information(harness):
    assert ret.diag_info["backupFilePath"] == "/user/temp/backup.tar"
    assert ret.diag_info["syncFilePath"] == "/user/temp/sync.tar"
    assert re.match(r"^(\d|[a-zA-Z]){32}$", ret.diag_info["deviceToken"])
    assert ret.diag_info["onboardingState"] in ["0", "1"]


@pytest.mark.service_desktop_test


@@ 40,7 40,8 @@ def test_get_list_of_log_files(harness):
    ret = GetDiagnosticFilesList(DiagnosticsFileList.LOGS).run(harness)
    assert "/system/log/MuditaOS.log" in ret.files

@pytest.mark.skip(reason = "Deactivated until we have possibility to generate crash dumps on demand [CP-690]")

@pytest.mark.skip(reason="Deactivated until we have possibility to generate crash dumps on demand [CP-690]")
@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("phone_unlocked")
def test_get_list_of_crash_dump_files(harness):