Merge "Add all possible flags to the front end." am: 2f5326c0d6

Original change: https://android-review.googlesource.com/c/platform/development/+/1771648

Change-Id: Iddf63cf0216470053ed8ae03dab364379b4072b2
This commit is contained in:
Treehugger Robot
2021-07-20 19:48:25 +00:00
committed by Automerger Merge Worker
3 changed files with 230 additions and 42 deletions

View File

@@ -176,6 +176,10 @@ class ProcessesManagement:
args['output'] = os.path.join('output', str(id) + '.zip')
if args['verbose']:
command.append('-v')
if args['extra_keys']:
args['extra'] += '--' + ' --'.join(args['extra_keys'])
if args['extra']:
command.append(args['extra'])
command.append('-k')
command.append(
'../../../build/make/target/product/security/testkey')

View File

@@ -13,43 +13,45 @@
/>
<v-row>
<v-col
v-for="flag in basicFlags"
:key="flag.key"
cols="12"
md="4"
align="center"
>
<BaseCheckbox
v-model="input.verbose"
:label="'Verbose'"
/>
</v-col>
<v-col
cols="12"
md="4"
align="center"
>
<BaseCheckbox
v-model="input.isIncremental"
:label="'Incremental'"
/>
</v-col>
<v-col
cols="12"
md="4"
align="center"
>
<BaseCheckbox
v-model="input.isPartial"
:label="'Partial'"
v-model="input[flag.key]"
:label="flag.label"
/>
</v-col>
</v-row>
<div>
<div v-if="input.isPartial">
<v-divider />
<h3>Select Partitions</h3>
<PartialCheckbox
v-if="input.isPartial"
v-model="input.partial"
:labels="updatablePartitions"
/>
<v-divider />
</div>
<v-btn
block
@click="moreOptions = !moreOptions"
>
More Options
</v-btn>
<v-row v-if="moreOptions">
<v-col
v-for="flag in extraFlags"
:key="flag.key"
cols="12"
md="4"
>
<BaseCheckbox
v-model="input[flag.key]"
:label="flag.label"
/>
</v-col>
</v-row>
<v-divider class="my-5" />
<BaseInput
v-model="input.extra"
@@ -70,10 +72,10 @@ import BaseInput from '@/components/BaseInput.vue'
import BaseCheckbox from '@/components/BaseCheckbox.vue'
import FileSelect from '@/components/FileSelect.vue'
import PartialCheckbox from '@/components/PartialCheckbox.vue'
import { OTAConfiguration } from '@/services/JobSubmission.js'
import { OTAConfiguration, OTABasicFlags, OTAExtraFlags } from '@/services/JobSubmission.js'
export default {
components:{
components: {
BaseInput,
BaseCheckbox,
FileSelect,
@@ -82,20 +84,23 @@ export default {
props: {
targetDetails: {
type: Array,
default: () => []
default: () => [],
},
incrementalSource: {
type: String,
default: ''
default: '',
},
targetBuild: {
type: String,
default: ''
}
default: '',
},
},
data () {
data() {
return {
input: new OTAConfiguration()
input: new OTAConfiguration(),
moreOptions: false,
basicFlags: OTABasicFlags,
extraFlags: OTAExtraFlags
}
},
computed: {
@@ -112,25 +117,25 @@ export default {
},
checkIncremental() {
return this.input.isIncremental
}
},
},
watch: {
incrementalSource: {
handler: function () {
this.input.isIncremental = true
this.input.incremental = this.incrementalSource
}
},
},
targetBuild: {
handler: function () {
this.input.target = this.targetBuild
}
},
},
checkIncremental: {
handler: function () {
this.$emit('update:isIncremental', this.checkIncremental)
}
}
},
},
},
methods: {
/**
@@ -141,10 +146,12 @@ export default {
let response_message = await this.input.sendForm()
alert(response_message)
} catch (err) {
alert('Job cannot be started properly for the following reasons: ' + err)
alert(
'Job cannot be started properly for the following reasons: ' + err
)
}
this.input = new OTAInput()
}
}
},
},
}
</script>

View File

@@ -12,12 +12,21 @@ export class OTAConfiguration {
* Initialize the input for the api /run/<id>
*/
constructor() {
/**
* Please refer to:
* https://source.corp.google.com/android/build/make/tools/releasetools/ota_from_target_files.py
* for the complete and up-to-date configurations that can be set for
* the OTA package generation.
* TODO (lishutong): there are dependencies on this flags,
* disable checkboxes of which dependencies are not fulfilled.
*/
this.verbose = false,
this.target = '',
this.incremental = '',
this.isIncremental = false,
this.partial = [],
this.isPartial = false,
this.extra_keys = [],
this.extra = '',
this.id = uuid.v1()
}
@@ -26,6 +35,11 @@ export class OTAConfiguration {
* Start the generation process, will throw an error if not succeed
*/
async sendForm() {
for (let flag of OTAExtraFlags.slice(3, OTAflags.length)) {
if (this[flag.key]) {
this.extra_keys.push(flag.key)
}
}
try {
let response = await ApiServices.postInput(JSON.stringify(this), this.id)
return response.data
@@ -33,4 +47,167 @@ export class OTAConfiguration {
throw err
}
}
}
}
export const OTABasicFlags = [
{
key: 'isIncremental',
label: 'Incremental OTA',
requireArg: 'incremental'
},
{
key: 'isPartial',
label: 'Partial OTA',
requireArg: 'partial'
},
{
key: 'verbose',
label: 'Verbose'
},]
export const OTAExtraFlags = [
{
key: 'downgrade',
label: 'Downgrade',
depend: ['isIncremental']
},
{
key: 'override_timestamp',
label: 'Override time stamp'
},
{
key: 'wipe_user_data',
label: 'Wipe User data'
},
//{
// key: 'retrofit_dynamic_partitions',
// label: 'Support dynamic partition'
//},
{
key: 'skip_compatibility_check',
label: 'Skip compatibility check'
},
//{
// key: 'output_metadata_path',
// label: 'Output metadata path'
//},
{
key: 'force_non_ab',
label: 'Generate non-A/B package'
},
/** TODO(lishutong): the following comments are flags
* that requires file operation, will add these functions later.
*/
//{key: 'oem_settings', label: 'Specify the OEM properties',
// requireArg: 'oem_settings_files'},
//{key: 'binary', label: 'Use given binary', requireArg: 'binary_file',
// depend: ['force_non_ab']},
{
key: 'block',
label: 'Block-based OTA',
depend: ['force_non_ab']
},
//{key: 'extra_script', label: 'Extra script', requireArg: 'script_file',
// depend: ['force_non_ab']},
{
key: 'full_bootloader',
label: 'Full bootloader',
depend: ['force_non_ab', 'isIncremental']
},
{
key: 'full_radio',
label: 'Full radio',
depend: ['force_non_ab', 'isIncremental']
},
//{key: 'log_diff', label: 'Log difference',
// requireArg: 'log_diff_path',depend: ['force_non_ab', 'isIncremental']},
//{key: 'oem_no_mount', label: 'Do not mount OEM partition',
// depend: ['force_non_ab', 'oem_settings']},
//{
// key: 'stash_threshold',
// label: 'Threshold for maximum stash size',
// requireArg: 'stash_threshold_float',
// depend: ['force_non_ab']
//},
//{
// key: 'worker_threads',
// label: 'Number of worker threads',
// requireArg: 'worker_threads_int',
// depend: ['force_non_ab', 'isIncremental']
//},
//{
// key: 'verify',
// label: 'Verify the checksum',
// depend: ['force_non_ab', 'isIncremental']
//},
{
key: 'two_step',
label: 'Generate two-step OTA',
depend: ['force_non_ab']
},
{
key: 'disable_fec_computation',
label: 'Disable the on device FEC computation',
depend: ['isIncremental'],
exclude: ['force_non_ab']
},
{
key: 'include_secondary',
label: 'Include secondary slot images',
exclude: ['force_non_ab', 'isIncremental']
},
//{key: 'payload_signer', label: 'Specify the signer',
// requireArg: ['payload_signer_singer'], exclude: ['force_non_ab']},
//{key: 'payload_singer_args', label: 'Specify the args for signer',
// requireArg: ['payload_signer_args_args], exclude: ['force_non_ab']},
//{
// key: 'payload_signer_maximum_signature_size',
// label: 'The maximum signature size (in bytes)',
// requireArg: ['payload_signer_maximum_signature_size_int'],
// exclude: ['force_non_ab']
//},
//{key: 'boot_variable_file', label: 'Specify values of ro.boot.*',
// requireArg: ['boot_variable_file_file'], exclude: ['force_non_ab']},
{
key: 'skip_postinstall',
label: 'Skip the postinstall',
exclude: ['force_non_ab']
},
//{key: 'custom_image', label: 'Use custom image',
// requireArg: ['custom_image_files'], exclude: ['force_non_ab]},
{
key: 'disable_vabc',
label: 'Disable Virtual A/B compression',
exclude: ['force_non_ab']
},
{
key: 'vabc_downgrade',
label: "Don't disable VABC for downgrading",
depend: ['isIncremental', 'downgrade'],
exclude: ['force_non_ab']
},
]
/** export const requireArgs = new Map([
[
"stash_threshold_float",
{
type: "BaseInput",
label: "Threshold for maximum stash size"
}
],
[
"worker_threads",
{
type: "BaseInput",
label: "Number of worker threads"
}
],
[
"payload_signer_maximum_signature_size",
{
type: "BaseInput",
label: "The maximum signature size (in bytes)"
}
],
]) */