Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5aa05fce authored by David Anderson's avatar David Anderson
Browse files

libsnapshot: Remove special-case code for first-stage init.

Because init needs tighter integration with how to launch snapuserd,
this code will be moved directly into init instead.

Bug: 173476209
Test: manual test
Change-Id: Ibce3bac9699620882eae44188d937d4900f022d3
parent 3fc65555
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -120,9 +120,5 @@ bool DeviceInfo::SetSlotAsUnbootable([[maybe_unused]] unsigned int slot) {
#endif
}

std::string DeviceInfo::GetSnapuserdFirstStagePidVar() const {
    return kSnapuserdFirstStagePidVar;
}

}  // namespace snapshot
}  // namespace android
+0 −1
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ class DeviceInfo final : public SnapshotManager::IDeviceInfo {
    bool SetBootControlMergeStatus(MergeStatus status) override;
    bool SetSlotAsUnbootable(unsigned int slot) override;
    bool IsRecovery() const override;
    std::string GetSnapuserdFirstStagePidVar() const override;

  private:
    bool EnsureBootHal();
+0 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ class MockDeviceInfo : public SnapshotManager::IDeviceInfo {
    MOCK_METHOD(bool, SetBootControlMergeStatus, (MergeStatus status), (override));
    MOCK_METHOD(bool, SetSlotAsUnbootable, (unsigned int slot), (override));
    MOCK_METHOD(bool, IsRecovery, (), (const, override));
    MOCK_METHOD(std::string, GetSnapuserdFirstStagePidVar, (), (const, override));
};

}  // namespace android::snapshot
+0 −1
Original line number Diff line number Diff line
@@ -107,7 +107,6 @@ class ISnapshotManager {
        virtual bool SetSlotAsUnbootable(unsigned int slot) = 0;
        virtual bool IsRecovery() const = 0;
        virtual bool IsTestDevice() const { return false; }
        virtual std::string GetSnapuserdFirstStagePidVar() const = 0;
    };
    virtual ~ISnapshotManager() = default;

+0 −5
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ namespace snapshot {

static constexpr uint32_t PACKET_SIZE = 512;

static constexpr char kSnapuserdSocketFirstStage[] = "snapuserd_first_stage";
static constexpr char kSnapuserdSocket[] = "snapuserd";

static constexpr char kSnapuserdFirstStagePidVar[] = "FIRST_STAGE_SNAPUSERD_PID";
@@ -38,10 +37,6 @@ static constexpr char kSnapuserdFirstStagePidVar[] = "FIRST_STAGE_SNAPUSERD_PID"
// Ensure that the second-stage daemon for snapuserd is running.
bool EnsureSnapuserdStarted();

// Start the first-stage version of snapuserd, returning its pid. This is used
// by first-stage init, as well as vts_libsnapshot_test. On failure, -1 is returned.
pid_t StartFirstStageSnapuserd();

class SnapuserdClient {
  private:
    android::base::unique_fd sockfd_;
Loading