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

Commit 2c71e418 authored by Guojing Yuan's avatar Guojing Yuan Committed by Android (Google) Code Review
Browse files

Merge "Add permission sync message protos."

parents f4b320a2 f1196eea
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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"],
}
+37 −0
Original line number Diff line number Diff line
/*
 * 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;
  }
}
+43 −0
Original line number Diff line number Diff line
/*
 * 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;
  }
}