Add permission sync message protos.

Bug: 199427116

Test: N/A
Change-Id: I16da4aa282100ba1bd3f897e2311e0cb11abf7ff
This commit is contained in:
Guojing Yuan
2021-09-27 20:06:58 +00:00
parent df46115c3b
commit f1196eeaed
3 changed files with 87 additions and 1 deletions

View File

@@ -9,7 +9,10 @@ package {
filegroup {
name: "services.companion-sources",
srcs: ["java/**/*.java"],
srcs: [
"java/**/*.java",
"java/**/*.proto",
],
path: "java",
visibility: ["//frameworks/base/services"],
}
@@ -17,6 +20,9 @@ filegroup {
java_library_static {
name: "services.companion",
defaults: ["platform_service_defaults"],
proto: {
type: "stream",
},
srcs: [":services.companion-sources"],
libs: ["services.core"],
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
option java_multiple_files = true;
/* Represents granted permissions of a list of apps */
message CompanionAppsPermissions {
// granted permissions of apps
repeated AppPermissions appPermissions = 1;
/* Represents the granted permissions of an app */
message AppPermissions {
// package name of the app
string packageName = 1;
// signing certificates used to sign the APK contents of this app
bytes certificates = 2;
// granted permissions
repeated string permission = 3;
}
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
option java_multiple_files = true;
/* Represents a message between companion devices */
message CompanionMessage {
// id of the message
int32 messageId = 1;
// type of the message
CompanionMessageType type = 2;
// data contained in the message
bytes data = 3;
// types of CompanionMessage
enum CompanionMessageType {
// default value for proto3
UNKNOWN = 0;
// handshake message to establish secure channel
SECURE_CHANNEL_HANDSHAKE = 1;
// permission sync
PERMISSION_SYNC = 2;
}
}