blob: bc7d084aae986613c168e557020449beebd9cbda [file] [log] [blame]
// chromeos/crosapi/mojom/app_service_types.mojom.js is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
(function() {
var mojomId = 'chromeos/crosapi/mojom/app_service_types.mojom';
if (mojo.internal.isMojomLoaded(mojomId)) {
console.warn('The following mojom is loaded multiple times: ' + mojomId);
return;
}
mojo.internal.markMojomLoaded(mojomId);
var bindings = mojo;
var associatedBindings = mojo;
var codec = mojo.internal;
var validator = mojo.internal;
var exports = mojo.internal.exposeNamespace('crosapi.mojom');
var file_path$ =
mojo.internal.exposeNamespace('mojoBase.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'mojo/public/mojom/base/file_path.mojom', '../../../mojo/public/mojom/base/file_path.mojom.js');
}
var time$ =
mojo.internal.exposeNamespace('mojoBase.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'mojo/public/mojom/base/time.mojom', '../../../mojo/public/mojom/base/time.mojom.js');
}
var unguessable_token$ =
mojo.internal.exposeNamespace('mojoBase.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'mojo/public/mojom/base/unguessable_token.mojom', '../../../mojo/public/mojom/base/unguessable_token.mojom.js');
}
var image$ =
mojo.internal.exposeNamespace('gfx.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'ui/gfx/image/mojom/image.mojom', '../../../ui/gfx/image/mojom/image.mojom.js');
}
var url$ =
mojo.internal.exposeNamespace('url.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'url/mojom/url.mojom', '../../../url/mojom/url.mojom.js');
}
var AppType = {};
AppType.kUnknown = 0;
AppType.kArc = 1;
AppType.kWeb = 2;
AppType.kSystemWeb = 3;
AppType.kStandaloneBrowserChromeApp = 4;
AppType.kStandaloneBrowserExtension = 5;
AppType.MIN_VALUE = 0;
AppType.MAX_VALUE = 5;
AppType.DEFAULT_VALUE = 0;
AppType.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return true;
}
return false;
};
AppType.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
AppType.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var Readiness = {};
Readiness.kUnknown = 0;
Readiness.kReady = 1;
Readiness.kDisabledByBlocklist = 2;
Readiness.kDisabledByPolicy = 3;
Readiness.kDisabledByUser = 4;
Readiness.kTerminated = 5;
Readiness.kUninstalledByUser = 6;
Readiness.kRemoved = 7;
Readiness.kUninstalledByMigration = 8;
Readiness.MIN_VALUE = 0;
Readiness.MAX_VALUE = 8;
Readiness.DEFAULT_VALUE = 0;
Readiness.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
return true;
}
return false;
};
Readiness.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
Readiness.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var InstallReason = {};
InstallReason.kUnknown = 0;
InstallReason.kSystem = 1;
InstallReason.kPolicy = 2;
InstallReason.kOem = 3;
InstallReason.kDefault = 4;
InstallReason.kSync = 5;
InstallReason.kUser = 6;
InstallReason.kSubApp = 7;
InstallReason.MIN_VALUE = 0;
InstallReason.MAX_VALUE = 7;
InstallReason.DEFAULT_VALUE = 0;
InstallReason.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
return true;
}
return false;
};
InstallReason.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
InstallReason.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var OptionalBool = {};
OptionalBool.kUnknown = 0;
OptionalBool.kFalse = 1;
OptionalBool.kTrue = 2;
OptionalBool.MIN_VALUE = 0;
OptionalBool.MAX_VALUE = 2;
OptionalBool.DEFAULT_VALUE = 0;
OptionalBool.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
}
return false;
};
OptionalBool.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
OptionalBool.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var ConditionType = {};
ConditionType.kScheme = 0;
ConditionType.kHost = 1;
ConditionType.kPattern = 2;
ConditionType.kAction = 3;
ConditionType.kMimeType = 4;
ConditionType.kFileExtension = 5;
ConditionType.kFile = 6;
ConditionType.MIN_VALUE = 0;
ConditionType.MAX_VALUE = 6;
ConditionType.DEFAULT_VALUE = 0;
ConditionType.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return true;
}
return false;
};
ConditionType.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
ConditionType.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var PatternMatchType = {};
PatternMatchType.kNone = 0;
PatternMatchType.kLiteral = 1;
PatternMatchType.kPrefix = 2;
PatternMatchType.kGlob = 3;
PatternMatchType.kMimeType = 4;
PatternMatchType.kFileExtension = 5;
PatternMatchType.kIsDirectory = 6;
PatternMatchType.kSuffix = 7;
PatternMatchType.MIN_VALUE = 0;
PatternMatchType.MAX_VALUE = 7;
PatternMatchType.DEFAULT_VALUE = 0;
PatternMatchType.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
return true;
}
return false;
};
PatternMatchType.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
PatternMatchType.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var UninstallSource = {};
UninstallSource.kUnknown = 0;
UninstallSource.kAppList = 1;
UninstallSource.kAppManagement = 2;
UninstallSource.kShelf = 3;
UninstallSource.kMigration = 4;
UninstallSource.MIN_VALUE = 0;
UninstallSource.MAX_VALUE = 4;
UninstallSource.DEFAULT_VALUE = 0;
UninstallSource.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
return true;
}
return false;
};
UninstallSource.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
UninstallSource.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var IconType = {};
IconType.kUnknown = 0;
IconType.kUncompressed = 1;
IconType.kCompressed = 2;
IconType.kStandard = 3;
IconType.MIN_VALUE = 0;
IconType.MAX_VALUE = 3;
IconType.DEFAULT_VALUE = 0;
IconType.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
return true;
}
return false;
};
IconType.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
IconType.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var WindowMode = {};
WindowMode.kUnknown = 0;
WindowMode.kWindow = 1;
WindowMode.kBrowser = 2;
WindowMode.kTabbedWindow = 3;
WindowMode.MIN_VALUE = 0;
WindowMode.MAX_VALUE = 3;
WindowMode.DEFAULT_VALUE = 0;
WindowMode.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
return true;
}
return false;
};
WindowMode.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
WindowMode.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var LaunchSource = {};
LaunchSource.kUnknown = 0;
LaunchSource.kFromAppListGrid = 1;
LaunchSource.kFromAppListGridContextMenu = 2;
LaunchSource.kFromAppListQuery = 3;
LaunchSource.kFromAppListQueryContextMenu = 4;
LaunchSource.kFromAppListRecommendation = 5;
LaunchSource.kFromParentalControls = 6;
LaunchSource.kFromShelf = 7;
LaunchSource.kFromFileManager = 8;
LaunchSource.kFromLink = 9;
LaunchSource.kFromOmnibox = 10;
LaunchSource.kFromChromeInternal = 11;
LaunchSource.kFromKeyboard = 12;
LaunchSource.kFromOtherApp = 13;
LaunchSource.kFromMenu = 14;
LaunchSource.kFromInstalledNotification = 15;
LaunchSource.kFromTest = 16;
LaunchSource.kFromArc = 17;
LaunchSource.kFromSharesheet = 18;
LaunchSource.kFromReleaseNotesNotification = 19;
LaunchSource.kFromFullRestore = 20;
LaunchSource.kFromSmartTextContextMenu = 21;
LaunchSource.kFromDiscoverTabNotification = 22;
LaunchSource.kFromManagementApi = 23;
LaunchSource.kFromKiosk = 24;
LaunchSource.kFromNewTabPage = 25;
LaunchSource.kFromIntentUrl = 26;
LaunchSource.kFromOsLogin = 27;
LaunchSource.kFromProtocolHandler = 28;
LaunchSource.kFromUrlHandler = 29;
LaunchSource.MIN_VALUE = 0;
LaunchSource.MAX_VALUE = 29;
LaunchSource.DEFAULT_VALUE = 0;
LaunchSource.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
return true;
}
return false;
};
LaunchSource.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
LaunchSource.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var LaunchContainer = {};
LaunchContainer.kLaunchContainerNone = 0;
LaunchContainer.kLaunchContainerWindow = 1;
LaunchContainer.kLaunchContainerTab = 2;
LaunchContainer.MIN_VALUE = 0;
LaunchContainer.MAX_VALUE = 2;
LaunchContainer.DEFAULT_VALUE = 0;
LaunchContainer.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
}
return false;
};
LaunchContainer.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
LaunchContainer.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var WindowOpenDisposition = {};
WindowOpenDisposition.kUnknown = 0;
WindowOpenDisposition.kCurrentTab = 1;
WindowOpenDisposition.kNewForegroundTab = 2;
WindowOpenDisposition.kNewBackgroundTab = 3;
WindowOpenDisposition.kNewWindow = 4;
WindowOpenDisposition.MIN_VALUE = 0;
WindowOpenDisposition.MAX_VALUE = 4;
WindowOpenDisposition.DEFAULT_VALUE = 0;
WindowOpenDisposition.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
return true;
}
return false;
};
WindowOpenDisposition.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
WindowOpenDisposition.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var PermissionType = {};
PermissionType.kUnknown = 0;
PermissionType.kCamera = 1;
PermissionType.kLocation = 2;
PermissionType.kMicrophone = 3;
PermissionType.kNotifications = 4;
PermissionType.kContacts = 5;
PermissionType.kStorage = 6;
PermissionType.kFileHandling = 7;
PermissionType.MIN_VALUE = 0;
PermissionType.MAX_VALUE = 7;
PermissionType.DEFAULT_VALUE = 0;
PermissionType.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
return true;
}
return false;
};
PermissionType.toKnownEnumValue = function(value) {
if (this.isKnownEnumValue(value))
return value;
return this.DEFAULT_VALUE;
};
PermissionType.validate = function(enumValue) {
const isExtensible = true;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
var TriState = {};
TriState.kAllow = 0;
TriState.kBlock = 1;
TriState.kAsk = 2;
TriState.MIN_VALUE = 0;
TriState.MAX_VALUE = 2;
TriState.isKnownEnumValue = function(value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
}
return false;
};
TriState.toKnownEnumValue = function(value) {
return value;
};
TriState.validate = function(enumValue) {
const isExtensible = false;
if (isExtensible || this.isKnownEnumValue(enumValue))
return validator.validationError.NONE;
return validator.validationError.UNKNOWN_ENUM_VALUE;
};
function App(values) {
this.initDefaults_();
this.initFields_(values);
}
App.prototype.initDefaults_ = function() {
this.appType = 0;
this.readiness = 0;
this.appId = null;
this.name = null;
this.shortName = null;
this.publisherId = null;
this.description = null;
this.version = null;
this.additionalSearchTerms = null;
this.iconKey = null;
this.lastLaunchTime = null;
this.installTime = null;
this.installReason = 0;
this.recommendable = 0;
this.searchable = 0;
this.showInLauncher = 0;
this.showInShelf = 0;
this.showInSearch = 0;
this.showInManagement = 0;
this.hasBadge = 0;
this.paused = 0;
this.windowMode = 0;
this.intentFilters = null;
this.policyId = null;
this.permissions = null;
this.allowUninstall = 0;
this.handlesIntents = 0;
this.shortcuts = null;
this.isPlatformApp = 0;
};
App.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
App.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 144},
{version: 2, numBytes: 144},
{version: 7, numBytes: 152},
{version: 8, numBytes: 160},
{version: 11, numBytes: 168},
{version: 12, numBytes: 168},
{version: 18, numBytes: 176},
{version: 19, numBytes: 184}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate App.appType
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, AppType);
if (err !== validator.validationError.NONE)
return err;
// validate App.appId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false)
if (err !== validator.validationError.NONE)
return err;
// validate App.readiness
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 4, Readiness);
if (err !== validator.validationError.NONE)
return err;
// validate App.name
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, true)
if (err !== validator.validationError.NONE)
return err;
// validate App.shortName
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, true)
if (err !== validator.validationError.NONE)
return err;
// validate App.publisherId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 32, true)
if (err !== validator.validationError.NONE)
return err;
// validate App.description
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 40, true)
if (err !== validator.validationError.NONE)
return err;
// validate App.version
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 48, true)
if (err !== validator.validationError.NONE)
return err;
// validate App.additionalSearchTerms
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 56, 8, codec.String, false, [0, 0], 0);
if (err !== validator.validationError.NONE)
return err;
// validate App.iconKey
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 64, IconKey, true);
if (err !== validator.validationError.NONE)
return err;
// validate App.lastLaunchTime
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 72, time$.Time, true);
if (err !== validator.validationError.NONE)
return err;
// validate App.installTime
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 80, time$.Time, true);
if (err !== validator.validationError.NONE)
return err;
// validate App.installReason
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 88, InstallReason);
if (err !== validator.validationError.NONE)
return err;
// validate App.recommendable
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 92, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate App.searchable
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 96, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate App.showInLauncher
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 100, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate App.showInShelf
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 104, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate App.showInSearch
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 108, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate App.showInManagement
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 112, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate App.hasBadge
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 116, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate App.paused
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 120, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate App.intentFilters
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 128, 8, new codec.PointerTo(IntentFilter), false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
// version check App.windowMode
if (!messageValidator.isFieldInStructVersion(offset, 2))
return validator.validationError.NONE;
// validate App.windowMode
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 124, WindowMode);
if (err !== validator.validationError.NONE)
return err;
// version check App.policyId
if (!messageValidator.isFieldInStructVersion(offset, 7))
return validator.validationError.NONE;
// validate App.policyId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 136, true)
if (err !== validator.validationError.NONE)
return err;
// version check App.permissions
if (!messageValidator.isFieldInStructVersion(offset, 8))
return validator.validationError.NONE;
// validate App.permissions
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 144, 8, new codec.PointerTo(Permission), true, [0], 0);
if (err !== validator.validationError.NONE)
return err;
// version check App.allowUninstall
if (!messageValidator.isFieldInStructVersion(offset, 11))
return validator.validationError.NONE;
// validate App.allowUninstall
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 152, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// version check App.handlesIntents
if (!messageValidator.isFieldInStructVersion(offset, 12))
return validator.validationError.NONE;
// validate App.handlesIntents
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 156, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// version check App.shortcuts
if (!messageValidator.isFieldInStructVersion(offset, 18))
return validator.validationError.NONE;
// validate App.shortcuts
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 160, 8, new codec.PointerTo(Shortcut), true, [0], 0);
if (err !== validator.validationError.NONE)
return err;
// version check App.isPlatformApp
if (!messageValidator.isFieldInStructVersion(offset, 19))
return validator.validationError.NONE;
// validate App.isPlatformApp
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 168, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
App.encodedSize = codec.kStructHeaderSize + 176;
App.decode = function(decoder) {
var packed;
var val = new App();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.appType =
decoder.decodeStruct(new codec.Enum(AppType));
val.readiness =
decoder.decodeStruct(new codec.Enum(Readiness));
val.appId =
decoder.decodeStruct(codec.String);
val.name =
decoder.decodeStruct(codec.NullableString);
val.shortName =
decoder.decodeStruct(codec.NullableString);
val.publisherId =
decoder.decodeStruct(codec.NullableString);
val.description =
decoder.decodeStruct(codec.NullableString);
val.version =
decoder.decodeStruct(codec.NullableString);
val.additionalSearchTerms =
decoder.decodeArrayPointer(codec.String);
val.iconKey =
decoder.decodeStructPointer(IconKey);
val.lastLaunchTime =
decoder.decodeStructPointer(time$.Time);
val.installTime =
decoder.decodeStructPointer(time$.Time);
val.installReason =
decoder.decodeStruct(new codec.Enum(InstallReason));
val.recommendable =
decoder.decodeStruct(new codec.Enum(OptionalBool));
val.searchable =
decoder.decodeStruct(new codec.Enum(OptionalBool));
val.showInLauncher =
decoder.decodeStruct(new codec.Enum(OptionalBool));
val.showInShelf =
decoder.decodeStruct(new codec.Enum(OptionalBool));
val.showInSearch =
decoder.decodeStruct(new codec.Enum(OptionalBool));
val.showInManagement =
decoder.decodeStruct(new codec.Enum(OptionalBool));
val.hasBadge =
decoder.decodeStruct(new codec.Enum(OptionalBool));
val.paused =
decoder.decodeStruct(new codec.Enum(OptionalBool));
if (version >= 2) {
val.windowMode =
decoder.decodeStruct(new codec.Enum(WindowMode));
} else {
val.windowMode = null;
}
val.intentFilters =
decoder.decodeArrayPointer(new codec.PointerTo(IntentFilter));
if (version >= 7) {
val.policyId =
decoder.decodeStruct(codec.NullableString);
} else {
val.policyId = null;
}
if (version >= 8) {
val.permissions =
decoder.decodeArrayPointer(new codec.PointerTo(Permission));
} else {
val.permissions = null;
}
if (version >= 11) {
val.allowUninstall =
decoder.decodeStruct(new codec.Enum(OptionalBool));
} else {
val.allowUninstall = null;
}
if (version >= 12) {
val.handlesIntents =
decoder.decodeStruct(new codec.Enum(OptionalBool));
} else {
val.handlesIntents = null;
}
if (version >= 18) {
val.shortcuts =
decoder.decodeArrayPointer(new codec.PointerTo(Shortcut));
} else {
val.shortcuts = null;
}
if (version >= 19) {
val.isPlatformApp =
decoder.decodeStruct(new codec.Enum(OptionalBool));
} else {
val.isPlatformApp = null;
}
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
return val;
};
App.encode = function(encoder, val) {
var packed;
encoder.writeUint32(App.encodedSize);
encoder.writeUint32(19);
encoder.encodeStruct(codec.Int32, val.appType);
encoder.encodeStruct(codec.Int32, val.readiness);
encoder.encodeStruct(codec.String, val.appId);
encoder.encodeStruct(codec.NullableString, val.name);
encoder.encodeStruct(codec.NullableString, val.shortName);
encoder.encodeStruct(codec.NullableString, val.publisherId);
encoder.encodeStruct(codec.NullableString, val.description);
encoder.encodeStruct(codec.NullableString, val.version);
encoder.encodeArrayPointer(codec.String, val.additionalSearchTerms);
encoder.encodeStructPointer(IconKey, val.iconKey);
encoder.encodeStructPointer(time$.Time, val.lastLaunchTime);
encoder.encodeStructPointer(time$.Time, val.installTime);
encoder.encodeStruct(codec.Int32, val.installReason);
encoder.encodeStruct(codec.Int32, val.recommendable);
encoder.encodeStruct(codec.Int32, val.searchable);
encoder.encodeStruct(codec.Int32, val.showInLauncher);
encoder.encodeStruct(codec.Int32, val.showInShelf);
encoder.encodeStruct(codec.Int32, val.showInSearch);
encoder.encodeStruct(codec.Int32, val.showInManagement);
encoder.encodeStruct(codec.Int32, val.hasBadge);
encoder.encodeStruct(codec.Int32, val.paused);
encoder.encodeStruct(codec.Int32, val.windowMode);
encoder.encodeArrayPointer(new codec.PointerTo(IntentFilter), val.intentFilters);
encoder.encodeStruct(codec.NullableString, val.policyId);
encoder.encodeArrayPointer(new codec.PointerTo(Permission), val.permissions);
encoder.encodeStruct(codec.Int32, val.allowUninstall);
encoder.encodeStruct(codec.Int32, val.handlesIntents);
encoder.encodeArrayPointer(new codec.PointerTo(Shortcut), val.shortcuts);
encoder.encodeStruct(codec.Int32, val.isPlatformApp);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
};
function IconKey(values) {
this.initDefaults_();
this.initFields_(values);
}
IconKey.DOES_NOT_CHANGE_OVER_TIME = 0;
IconKey.prototype.initDefaults_ = function() {
this.timeline = 0;
this.iconEffects = 0;
};
IconKey.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
IconKey.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
IconKey.encodedSize = codec.kStructHeaderSize + 16;
IconKey.decode = function(decoder) {
var packed;
var val = new IconKey();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.timeline =
decoder.decodeStruct(codec.Uint64);
val.iconEffects =
decoder.decodeStruct(codec.Uint32);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
return val;
};
IconKey.encode = function(encoder, val) {
var packed;
encoder.writeUint32(IconKey.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.Uint64, val.timeline);
encoder.encodeStruct(codec.Uint32, val.iconEffects);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
};
function ConditionValue(values) {
this.initDefaults_();
this.initFields_(values);
}
ConditionValue.prototype.initDefaults_ = function() {
this.value = null;
this.matchType = 0;
};
ConditionValue.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
ConditionValue.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate ConditionValue.value
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
// validate ConditionValue.matchType
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, PatternMatchType);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
ConditionValue.encodedSize = codec.kStructHeaderSize + 16;
ConditionValue.decode = function(decoder) {
var packed;
var val = new ConditionValue();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.value =
decoder.decodeStruct(codec.String);
val.matchType =
decoder.decodeStruct(new codec.Enum(PatternMatchType));
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
return val;
};
ConditionValue.encode = function(encoder, val) {
var packed;
encoder.writeUint32(ConditionValue.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.String, val.value);
encoder.encodeStruct(codec.Int32, val.matchType);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
};
function Condition(values) {
this.initDefaults_();
this.initFields_(values);
}
Condition.prototype.initDefaults_ = function() {
this.conditionType = 0;
this.conditionValues = null;
};
Condition.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
Condition.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate Condition.conditionType
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, ConditionType);
if (err !== validator.validationError.NONE)
return err;
// validate Condition.conditionValues
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 8, new codec.PointerTo(ConditionValue), false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
Condition.encodedSize = codec.kStructHeaderSize + 16;
Condition.decode = function(decoder) {
var packed;
var val = new Condition();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.conditionType =
decoder.decodeStruct(new codec.Enum(ConditionType));
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
val.conditionValues =
decoder.decodeArrayPointer(new codec.PointerTo(ConditionValue));
return val;
};
Condition.encode = function(encoder, val) {
var packed;
encoder.writeUint32(Condition.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.Int32, val.conditionType);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.encodeArrayPointer(new codec.PointerTo(ConditionValue), val.conditionValues);
};
function IntentFilter(values) {
this.initDefaults_();
this.initFields_(values);
}
IntentFilter.prototype.initDefaults_ = function() {
this.conditions = null;
this.activityName = null;
this.activityLabel = null;
};
IntentFilter.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
IntentFilter.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 32}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate IntentFilter.conditions
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(Condition), false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
// validate IntentFilter.activityName
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, true)
if (err !== validator.validationError.NONE)
return err;
// validate IntentFilter.activityLabel
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, true)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
IntentFilter.encodedSize = codec.kStructHeaderSize + 24;
IntentFilter.decode = function(decoder) {
var packed;
var val = new IntentFilter();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.conditions =
decoder.decodeArrayPointer(new codec.PointerTo(Condition));
val.activityName =
decoder.decodeStruct(codec.NullableString);
val.activityLabel =
decoder.decodeStruct(codec.NullableString);
return val;
};
IntentFilter.encode = function(encoder, val) {
var packed;
encoder.writeUint32(IntentFilter.encodedSize);
encoder.writeUint32(0);
encoder.encodeArrayPointer(new codec.PointerTo(Condition), val.conditions);
encoder.encodeStruct(codec.NullableString, val.activityName);
encoder.encodeStruct(codec.NullableString, val.activityLabel);
};
function CapabilityAccess(values) {
this.initDefaults_();
this.initFields_(values);
}
CapabilityAccess.prototype.initDefaults_ = function() {
this.appId = null;
this.camera = 0;
this.microphone = 0;
};
CapabilityAccess.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
CapabilityAccess.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate CapabilityAccess.appId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
// validate CapabilityAccess.camera
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
// validate CapabilityAccess.microphone
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 12, OptionalBool);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
CapabilityAccess.encodedSize = codec.kStructHeaderSize + 16;
CapabilityAccess.decode = function(decoder) {
var packed;
var val = new CapabilityAccess();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.appId =
decoder.decodeStruct(codec.String);
val.camera =
decoder.decodeStruct(new codec.Enum(OptionalBool));
val.microphone =
decoder.decodeStruct(new codec.Enum(OptionalBool));
return val;
};
CapabilityAccess.encode = function(encoder, val) {
var packed;
encoder.writeUint32(CapabilityAccess.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.String, val.appId);
encoder.encodeStruct(codec.Int32, val.camera);
encoder.encodeStruct(codec.Int32, val.microphone);
};
function IconValue(values) {
this.initDefaults_();
this.initFields_(values);
}
IconValue.prototype.initDefaults_ = function() {
this.iconType = 0;
this.isPlaceholderIcon = false;
this.uncompressed = null;
this.compressed = null;
};
IconValue.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
IconValue.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 32}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate IconValue.iconType
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, IconType);
if (err !== validator.validationError.NONE)
return err;
// validate IconValue.uncompressed
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, image$.ImageSkia, true);
if (err !== validator.validationError.NONE)
return err;
// validate IconValue.compressed
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 16, 1, codec.Uint8, true, [0], 0);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
IconValue.encodedSize = codec.kStructHeaderSize + 24;
IconValue.decode = function(decoder) {
var packed;
var val = new IconValue();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.iconType =
decoder.decodeStruct(new codec.Enum(IconType));
packed = decoder.readUint8();
val.isPlaceholderIcon = (packed >> 0) & 1 ? true : false;
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
val.uncompressed =
decoder.decodeStructPointer(image$.ImageSkia);
val.compressed =
decoder.decodeArrayPointer(codec.Uint8);
return val;
};
IconValue.encode = function(encoder, val) {
var packed;
encoder.writeUint32(IconValue.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.Int32, val.iconType);
packed = 0;
packed |= (val.isPlaceholderIcon & 1) << 0
encoder.writeUint8(packed);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.encodeStructPointer(image$.ImageSkia, val.uncompressed);
encoder.encodeArrayPointer(codec.Uint8, val.compressed);
};
function MenuItems(values) {
this.initDefaults_();
this.initFields_(values);
}
MenuItems.prototype.initDefaults_ = function() {
this.items = null;
};
MenuItems.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
MenuItems.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate MenuItems.items
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(MenuItem), false, [0], 0);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
MenuItems.encodedSize = codec.kStructHeaderSize + 8;
MenuItems.decode = function(decoder) {
var packed;
var val = new MenuItems();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.items =
decoder.decodeArrayPointer(new codec.PointerTo(MenuItem));
return val;
};
MenuItems.encode = function(encoder, val) {
var packed;
encoder.writeUint32(MenuItems.encodedSize);
encoder.writeUint32(0);
encoder.encodeArrayPointer(new codec.PointerTo(MenuItem), val.items);
};
function MenuItem(values) {
this.initDefaults_();
this.initFields_(values);
}
MenuItem.prototype.initDefaults_ = function() {
this.label = null;
this.image = null;
this.id = null;
};
MenuItem.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
MenuItem.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24},
{version: 3, numBytes: 32}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate MenuItem.label
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
// validate MenuItem.image
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, image$.ImageSkia, true);
if (err !== validator.validationError.NONE)
return err;
// version check MenuItem.id
if (!messageValidator.isFieldInStructVersion(offset, 3))
return validator.validationError.NONE;
// validate MenuItem.id
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, true)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
MenuItem.encodedSize = codec.kStructHeaderSize + 24;
MenuItem.decode = function(decoder) {
var packed;
var val = new MenuItem();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.label =
decoder.decodeStruct(codec.String);
val.image =
decoder.decodeStructPointer(image$.ImageSkia);
if (version >= 3) {
val.id =
decoder.decodeStruct(codec.NullableString);
} else {
val.id = null;
}
return val;
};
MenuItem.encode = function(encoder, val) {
var packed;
encoder.writeUint32(MenuItem.encodedSize);
encoder.writeUint32(3);
encoder.encodeStruct(codec.String, val.label);
encoder.encodeStructPointer(image$.ImageSkia, val.image);
encoder.encodeStruct(codec.NullableString, val.id);
};
function IntentFile(values) {
this.initDefaults_();
this.initFields_(values);
}
IntentFile.prototype.initDefaults_ = function() {
this.filePath = null;
this.mimeType = null;
};
IntentFile.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
IntentFile.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16},
{version: 15, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate IntentFile.filePath
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, file_path$.FilePath, false);
if (err !== validator.validationError.NONE)
return err;
// version check IntentFile.mimeType
if (!messageValidator.isFieldInStructVersion(offset, 15))
return validator.validationError.NONE;
// validate IntentFile.mimeType
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, true)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
IntentFile.encodedSize = codec.kStructHeaderSize + 16;
IntentFile.decode = function(decoder) {
var packed;
var val = new IntentFile();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.filePath =
decoder.decodeStructPointer(file_path$.FilePath);
if (version >= 15) {
val.mimeType =
decoder.decodeStruct(codec.NullableString);
} else {
val.mimeType = null;
}
return val;
};
IntentFile.encode = function(encoder, val) {
var packed;
encoder.writeUint32(IntentFile.encodedSize);
encoder.writeUint32(15);
encoder.encodeStructPointer(file_path$.FilePath, val.filePath);
encoder.encodeStruct(codec.NullableString, val.mimeType);
};
function Intent(values) {
this.initDefaults_();
this.initFields_(values);
}
Intent.prototype.initDefaults_ = function() {
this.action = null;
this.url = null;
this.mimeType = null;
this.shareText = null;
this.shareTitle = null;
this.files = null;
this.activityName = null;
this.data = null;
};
Intent.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
Intent.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 48},
{version: 5, numBytes: 56},
{version: 13, numBytes: 64},
{version: 14, numBytes: 72}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate Intent.action
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
// validate Intent.url
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, url$.Url, true);
if (err !== validator.validationError.NONE)
return err;
// validate Intent.mimeType
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 16, true)
if (err !== validator.validationError.NONE)
return err;
// validate Intent.shareText
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 24, true)
if (err !== validator.validationError.NONE)
return err;
// validate Intent.shareTitle
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 32, true)
if (err !== validator.validationError.NONE)
return err;
// version check Intent.files
if (!messageValidator.isFieldInStructVersion(offset, 5))
return validator.validationError.NONE;
// validate Intent.files
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 40, 8, new codec.PointerTo(IntentFile), true, [0], 0);
if (err !== validator.validationError.NONE)
return err;
// version check Intent.activityName
if (!messageValidator.isFieldInStructVersion(offset, 13))
return validator.validationError.NONE;
// validate Intent.activityName
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 48, true)
if (err !== validator.validationError.NONE)
return err;
// version check Intent.data
if (!messageValidator.isFieldInStructVersion(offset, 14))
return validator.validationError.NONE;
// validate Intent.data
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 56, true)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
Intent.encodedSize = codec.kStructHeaderSize + 64;
Intent.decode = function(decoder) {
var packed;
var val = new Intent();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.action =
decoder.decodeStruct(codec.String);
val.url =
decoder.decodeStructPointer(url$.Url);
val.mimeType =
decoder.decodeStruct(codec.NullableString);
val.shareText =
decoder.decodeStruct(codec.NullableString);
val.shareTitle =
decoder.decodeStruct(codec.NullableString);
if (version >= 5) {
val.files =
decoder.decodeArrayPointer(new codec.PointerTo(IntentFile));
} else {
val.files = null;
}
if (version >= 13) {
val.activityName =
decoder.decodeStruct(codec.NullableString);
} else {
val.activityName = null;
}
if (version >= 14) {
val.data =
decoder.decodeStruct(codec.NullableString);
} else {
val.data = null;
}
return val;
};
Intent.encode = function(encoder, val) {
var packed;
encoder.writeUint32(Intent.encodedSize);
encoder.writeUint32(14);
encoder.encodeStruct(codec.String, val.action);
encoder.encodeStructPointer(url$.Url, val.url);
encoder.encodeStruct(codec.NullableString, val.mimeType);
encoder.encodeStruct(codec.NullableString, val.shareText);
encoder.encodeStruct(codec.NullableString, val.shareTitle);
encoder.encodeArrayPointer(new codec.PointerTo(IntentFile), val.files);
encoder.encodeStruct(codec.NullableString, val.activityName);
encoder.encodeStruct(codec.NullableString, val.data);
};
function LaunchResult(values) {
this.initDefaults_();
this.initFields_(values);
}
LaunchResult.prototype.initDefaults_ = function() {
this.instanceId = null;
this.instanceIds = null;
};
LaunchResult.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
LaunchResult.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16},
{version: 1, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate LaunchResult.instanceId
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, unguessable_token$.UnguessableToken, false);
if (err !== validator.validationError.NONE)
return err;
// version check LaunchResult.instanceIds
if (!messageValidator.isFieldInStructVersion(offset, 1))
return validator.validationError.NONE;
// validate LaunchResult.instanceIds
err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 8, new codec.PointerTo(unguessable_token$.UnguessableToken), true, [0], 0);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
LaunchResult.encodedSize = codec.kStructHeaderSize + 16;
LaunchResult.decode = function(decoder) {
var packed;
var val = new LaunchResult();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.instanceId =
decoder.decodeStructPointer(unguessable_token$.UnguessableToken);
if (version >= 1) {
val.instanceIds =
decoder.decodeArrayPointer(new codec.PointerTo(unguessable_token$.UnguessableToken));
} else {
val.instanceIds = null;
}
return val;
};
LaunchResult.encode = function(encoder, val) {
var packed;
encoder.writeUint32(LaunchResult.encodedSize);
encoder.writeUint32(1);
encoder.encodeStructPointer(unguessable_token$.UnguessableToken, val.instanceId);
encoder.encodeArrayPointer(new codec.PointerTo(unguessable_token$.UnguessableToken), val.instanceIds);
};
function LaunchParams(values) {
this.initDefaults_();
this.initFields_(values);
}
LaunchParams.prototype.initDefaults_ = function() {
this.appId = null;
this.launchSource = 0;
this.container = 0;
this.intent = null;
this.disposition = 0;
this.displayId = 0;
};
LaunchParams.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
LaunchParams.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 32},
{version: 14, numBytes: 40},
{version: 15, numBytes: 48}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate LaunchParams.appId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
// validate LaunchParams.launchSource
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 8, LaunchSource);
if (err !== validator.validationError.NONE)
return err;
// validate LaunchParams.intent
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, Intent, true);
if (err !== validator.validationError.NONE)
return err;
// version check LaunchParams.container
if (!messageValidator.isFieldInStructVersion(offset, 14))
return validator.validationError.NONE;
// validate LaunchParams.container
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 12, LaunchContainer);
if (err !== validator.validationError.NONE)
return err;
// version check LaunchParams.disposition
if (!messageValidator.isFieldInStructVersion(offset, 14))
return validator.validationError.NONE;
// validate LaunchParams.disposition
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 24, WindowOpenDisposition);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
LaunchParams.encodedSize = codec.kStructHeaderSize + 40;
LaunchParams.decode = function(decoder) {
var packed;
var val = new LaunchParams();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.appId =
decoder.decodeStruct(codec.String);
val.launchSource =
decoder.decodeStruct(new codec.Enum(LaunchSource));
if (version >= 14) {
val.container =
decoder.decodeStruct(new codec.Enum(LaunchContainer));
} else {
val.container = null;
}
val.intent =
decoder.decodeStructPointer(Intent);
if (version >= 14) {
val.disposition =
decoder.decodeStruct(new codec.Enum(WindowOpenDisposition));
} else {
val.disposition = null;
}
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
if (version >= 15) {
val.displayId =
decoder.decodeStruct(codec.Int64);
} else {
val.displayId = null;
}
return val;
};
LaunchParams.encode = function(encoder, val) {
var packed;
encoder.writeUint32(LaunchParams.encodedSize);
encoder.writeUint32(15);
encoder.encodeStruct(codec.String, val.appId);
encoder.encodeStruct(codec.Int32, val.launchSource);
encoder.encodeStruct(codec.Int32, val.container);
encoder.encodeStructPointer(Intent, val.intent);
encoder.encodeStruct(codec.Int32, val.disposition);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.encodeStruct(codec.Int64, val.displayId);
};
function Permission(values) {
this.initDefaults_();
this.initFields_(values);
}
Permission.prototype.initDefaults_ = function() {
this.permissionType = 0;
this.isManaged = false;
this.value = null;
};
Permission.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
Permission.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 32}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate Permission.permissionType
err = messageValidator.validateEnum(offset + codec.kStructHeaderSize + 0, PermissionType);
if (err !== validator.validationError.NONE)
return err;
// validate Permission.value
err = messageValidator.validateUnion(offset + codec.kStructHeaderSize + 8, PermissionValue, false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
Permission.encodedSize = codec.kStructHeaderSize + 24;
Permission.decode = function(decoder) {
var packed;
var val = new Permission();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.permissionType =
decoder.decodeStruct(new codec.Enum(PermissionType));
packed = decoder.readUint8();
val.isManaged = (packed >> 0) & 1 ? true : false;
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
val.value =
decoder.decodeStruct(PermissionValue);
return val;
};
Permission.encode = function(encoder, val) {
var packed;
encoder.writeUint32(Permission.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.Int32, val.permissionType);
packed = 0;
packed |= (val.isManaged & 1) << 0
encoder.writeUint8(packed);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.encodeStruct(PermissionValue, val.value);
};
function PreferredAppChanges(values) {
this.initDefaults_();
this.initFields_(values);
}
PreferredAppChanges.prototype.initDefaults_ = function() {
this.addedFilters = null;
this.removedFilters = null;
};
PreferredAppChanges.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
PreferredAppChanges.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate PreferredAppChanges.addedFilters
err = messageValidator.validateMapPointer(offset + codec.kStructHeaderSize + 0, false, codec.String, new codec.ArrayOf(new codec.PointerTo(IntentFilter)), false);
if (err !== validator.validationError.NONE)
return err;
// validate PreferredAppChanges.removedFilters
err = messageValidator.validateMapPointer(offset + codec.kStructHeaderSize + 8, false, codec.String, new codec.ArrayOf(new codec.PointerTo(IntentFilter)), false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
PreferredAppChanges.encodedSize = codec.kStructHeaderSize + 16;
PreferredAppChanges.decode = function(decoder) {
var packed;
var val = new PreferredAppChanges();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.addedFilters =
decoder.decodeMapPointer(codec.String, new codec.ArrayOf(new codec.PointerTo(IntentFilter)));
val.removedFilters =
decoder.decodeMapPointer(codec.String, new codec.ArrayOf(new codec.PointerTo(IntentFilter)));
return val;
};
PreferredAppChanges.encode = function(encoder, val) {
var packed;
encoder.writeUint32(PreferredAppChanges.encodedSize);
encoder.writeUint32(0);
encoder.encodeMapPointer(codec.String, new codec.ArrayOf(new codec.PointerTo(IntentFilter)), val.addedFilters);
encoder.encodeMapPointer(codec.String, new codec.ArrayOf(new codec.PointerTo(IntentFilter)), val.removedFilters);
};
function PreferredApp(values) {
this.initDefaults_();
this.initFields_(values);
}
PreferredApp.prototype.initDefaults_ = function() {
this.intentFilter = null;
this.appId = null;
};
PreferredApp.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
PreferredApp.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate PreferredApp.intentFilter
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, IntentFilter, false);
if (err !== validator.validationError.NONE)
return err;
// validate PreferredApp.appId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
PreferredApp.encodedSize = codec.kStructHeaderSize + 16;
PreferredApp.decode = function(decoder) {
var packed;
var val = new PreferredApp();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.intentFilter =
decoder.decodeStructPointer(IntentFilter);
val.appId =
decoder.decodeStruct(codec.String);
return val;
};
PreferredApp.encode = function(encoder, val) {
var packed;
encoder.writeUint32(PreferredApp.encodedSize);
encoder.writeUint32(0);
encoder.encodeStructPointer(IntentFilter, val.intentFilter);
encoder.encodeStruct(codec.String, val.appId);
};
function Shortcut(values) {
this.initDefaults_();
this.initFields_(values);
}
Shortcut.prototype.initDefaults_ = function() {
this.shortcutId = null;
this.name = null;
this.position = 0;
};
Shortcut.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
Shortcut.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 32}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate Shortcut.shortcutId
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
// validate Shortcut.name
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
Shortcut.encodedSize = codec.kStructHeaderSize + 24;
Shortcut.decode = function(decoder) {
var packed;
var val = new Shortcut();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.shortcutId =
decoder.decodeStruct(codec.String);
val.name =
decoder.decodeStruct(codec.String);
val.position =
decoder.decodeStruct(codec.Uint8);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
return val;
};
Shortcut.encode = function(encoder, val) {
var packed;
encoder.writeUint32(Shortcut.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.String, val.shortcutId);
encoder.encodeStruct(codec.String, val.name);
encoder.encodeStruct(codec.Uint8, val.position);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
};
function PermissionValue(value) {
this.initDefault_();
this.initValue_(value);
}
PermissionValue.Tags = {
boolValue: 0,
tristateValue: 1,
};
PermissionValue.prototype.initDefault_ = function() {
this.$data = null;
this.$tag = undefined;
}
PermissionValue.prototype.initValue_ = function(value) {
if (value == undefined) {
return;
}
var keys = Object.keys(value);
if (keys.length == 0) {
return;
}
if (keys.length > 1) {
throw new TypeError("You may set only one member on a union.");
}
var fields = [
"boolValue",
"tristateValue",
];
if (fields.indexOf(keys[0]) < 0) {
throw new ReferenceError(keys[0] + " is not a PermissionValue member.");
}
this[keys[0]] = value[keys[0]];
}
Object.defineProperty(PermissionValue.prototype, "boolValue", {
get: function() {
if (this.$tag != PermissionValue.Tags.boolValue) {
throw new ReferenceError(
"PermissionValue.boolValue is not currently set.");
}
return this.$data;
},
set: function(value) {
this.$tag = PermissionValue.Tags.boolValue;
this.$data = value;
}
});
Object.defineProperty(PermissionValue.prototype, "tristateValue", {
get: function() {
if (this.$tag != PermissionValue.Tags.tristateValue) {
throw new ReferenceError(
"PermissionValue.tristateValue is not currently set.");
}
return this.$data;
},
set: function(value) {
this.$tag = PermissionValue.Tags.tristateValue;
this.$data = value;
}
});
PermissionValue.encode = function(encoder, val) {
if (val == null) {
encoder.writeUint64(0);
encoder.writeUint64(0);
return;
}
if (val.$tag == undefined) {
throw new TypeError("Cannot encode unions with an unknown member set.");
}
encoder.writeUint32(16);
encoder.writeUint32(val.$tag);
switch (val.$tag) {
case PermissionValue.Tags.boolValue:
encoder.writeUint8(val.boolValue ? 1 : 0);
break;
case PermissionValue.Tags.tristateValue:
encoder.encodeStruct(codec.Int32, val.tristateValue);
break;
}
encoder.align();
};
PermissionValue.decode = function(decoder) {
var size = decoder.readUint32();
if (size == 0) {
decoder.readUint32();
decoder.readUint64();
return null;
}
var result = new PermissionValue();
var tag = decoder.readUint32();
switch (tag) {
case PermissionValue.Tags.boolValue:
result.boolValue = decoder.readUint8() ? true : false;
break;
case PermissionValue.Tags.tristateValue:
result.tristateValue = decoder.decodeStruct(new codec.Enum(TriState));
break;
}
decoder.align();
return result;
};
PermissionValue.validate = function(messageValidator, offset) {
var size = messageValidator.decodeUnionSize(offset);
if (size != 16) {
return validator.validationError.INVALID_UNION_SIZE;
}
var tag = messageValidator.decodeUnionTag(offset);
var data_offset = offset + 8;
var err;
switch (tag) {
case PermissionValue.Tags.boolValue:
break;
case PermissionValue.Tags.tristateValue:
// validate PermissionValue.tristateValue
err = messageValidator.validateEnum(data_offset, TriState);
if (err !== validator.validationError.NONE)
return err;
break;
}
return validator.validationError.NONE;
};
PermissionValue.encodedSize = 16;
exports.AppType = AppType;
exports.Readiness = Readiness;
exports.InstallReason = InstallReason;
exports.OptionalBool = OptionalBool;
exports.ConditionType = ConditionType;
exports.PatternMatchType = PatternMatchType;
exports.UninstallSource = UninstallSource;
exports.IconType = IconType;
exports.WindowMode = WindowMode;
exports.LaunchSource = LaunchSource;
exports.LaunchContainer = LaunchContainer;
exports.WindowOpenDisposition = WindowOpenDisposition;
exports.PermissionType = PermissionType;
exports.TriState = TriState;
exports.App = App;
exports.IconKey = IconKey;
exports.ConditionValue = ConditionValue;
exports.Condition = Condition;
exports.IntentFilter = IntentFilter;
exports.CapabilityAccess = CapabilityAccess;
exports.IconValue = IconValue;
exports.MenuItems = MenuItems;
exports.MenuItem = MenuItem;
exports.IntentFile = IntentFile;
exports.Intent = Intent;
exports.LaunchResult = LaunchResult;
exports.LaunchParams = LaunchParams;
exports.Permission = Permission;
exports.PreferredAppChanges = PreferredAppChanges;
exports.PreferredApp = PreferredApp;
exports.Shortcut = Shortcut;
exports.PermissionValue = PermissionValue;
})();