service

package
v0.0.0-...-0342304 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package servicer is a container for the AndroidProvision state machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndroidOS

type AndroidOS struct {
	ImagePath        *ImagePath
	BuildInfo        *OsBuildInfo
	UpdatedBuildInfo *OsBuildInfo
}

AndroidOS contains information about Android OS to install.

type AndroidPackage

type AndroidPackage struct {
	PackageName        string
	VersionCode        string
	UpdatedVersionCode string
}

AndroidPackage contains information about installed Android package.

type AndroidService

type AndroidService struct {
	DUT               *DUTConnection
	OS                *AndroidOS
	ProvisionPackages []*ProvisionPackage
	ProvisionDir      string
}

AndroidService inherits ServiceInterface

func NewAndroidService

func NewAndroidService(dut *lab_api.Dut, dutClient api.DutServiceClient, req *api.InstallRequest) (*AndroidService, error)

func NewAndroidServiceFromAndroidProvisionRequest

func NewAndroidServiceFromAndroidProvisionRequest(dutClient api.DutServiceClient, req *api.AndroidProvisionRequest) (*AndroidService, error)

func NewAndroidServiceFromExistingConnection

func NewAndroidServiceFromExistingConnection(conn common_utils.ServiceAdapterInterface, dutSerialNumber string, osImage *api.AndroidOsImage, pkgProtos []*api.CIPDPackage) (*AndroidService, error)

NewAndroidServiceFromExistingConnection utilizes a given ServiceAdapter. Generally useful for tests.

func (*AndroidService) CleanupOnFailure

func (svc *AndroidService) CleanupOnFailure(states []common_utils.ServiceState, executionErr error) error

CleanupOnFailure is called if one of service's states failes to Execute() and should clean up the temporary files, and undo the execution, if feasible.

func (*AndroidService) MarshalResponseMetadata

func (svc *AndroidService) MarshalResponseMetadata() (*anypb.Any, error)

MarshalResponseMetadata packs AndroidProvisionResponseMetadata into the Any message type.

func (*AndroidService) UnmarshalRequestMetadata

func (svc *AndroidService) UnmarshalRequestMetadata(req *api.InstallRequest) error

UnmarshalRequestMetadata unpacks the Any metadata field into AndroidProvisionRequestMetadata

type CIPDPackage

type CIPDPackage struct {
	PackageProto *api.CIPDPackage
	FilePath     string
	PackageName  string
	InstanceId   string
	VersionCode  string
}

CIPDPackage wraps CIPD package proto and contains the resolved CIPD package info.

type DUTConnection

type DUTConnection struct {
	AssociatedHost common_utils.ServiceAdapterInterface
	SerialNumber   string
	Board          string
}

DUTConnection has information about CrosDUT connection and DUT serial number.

type ImagePath

type ImagePath struct {
	GsPath         string
	BoardToBuildID map[string]string
	Files          []string
	// DUT directory containing the binary images.
	DutAndroidProductOut string
}

ImagePath defines OS image file(s) to flash.

type OsBuildInfo

type OsBuildInfo struct {
	Id                 string
	OsVersion          string
	IncrementalVersion string
}

OsBuildInfo contains information about Android OS build.

type PkgFile

type PkgFile struct {
	Name    string
	GsPath  string
	DutPath string
}

PkgFile defines package file to install.

type ProvisionPackage

type ProvisionPackage struct {
	AndroidPackage *AndroidPackage
	CIPDPackage    *CIPDPackage
	APKFile        *PkgFile
}

ProvisionPackage contains information about provision package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL