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

Commit 930b8ba6 authored by Tej Singh's avatar Tej Singh Committed by Automerger Merge Worker
Browse files

Move service/enums.proto to proto_logging am: 51cffe52

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13894163

Change-Id: I813dc5462990d55d39a2c322d26b9337335cebda
parents f4a60cf2 51cffe52
Loading
Loading
Loading
Loading
+0 −40
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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 = "proto2";
package android.service;

option java_outer_classname = "ServiceProtoEnums";
option java_multiple_files = true;

enum UsbEndPointType {
    USB_ENDPOINT_TYPE_XFER_CONTROL = 0;
    USB_ENDPOINT_TYPE_XFER_ISOC = 1;
    USB_ENDPOINT_TYPE_XFER_BULK = 2;
    USB_ENDPOINT_TYPE_XFER_INT = 3;
}

enum UsbEndPointDirection {
    USB_ENDPOINT_DIR_OUT = 0;
    USB_ENDPOINT_DIR_IN = 0x80;
}

enum UsbConnectionRecordMode {
    USB_CONNECTION_RECORD_MODE_CONNECT = 0;
    USB_CONNECTION_RECORD_MODE_CONNECT_BADPARSE = 1;
    USB_CONNECTION_RECORD_MODE_CONNECT_BADDEVICE = 2;
    USB_CONNECTION_RECORD_MODE_DISCONNECT = -1;
}
 No newline at end of file
+2 −11
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@ option java_multiple_files = true;
option java_outer_classname = "UsbServiceProto";

import "frameworks/base/core/proto/android/content/component_name.proto";
import "frameworks/base/core/proto/android/service/enums.proto";
import "frameworks/base/core/proto/android/privacy.proto";
import "frameworks/proto_logging/stats/enums/service/enums.proto";

message UsbServiceDumpProto {
    option (android.msg_privacy).dest = DEST_AUTOMATIC;
@@ -230,15 +230,6 @@ message UsbPortProto {
    repeated Mode supported_modes = 2;
}

/* Same as android.hardware.usb.V1_2.Constants.ContaminantPresenceStatus */
enum ContaminantPresenceStatus {
    CONTAMINANT_STATUS_UNKNOWN = 0;
    CONTAMINANT_STATUS_NOT_SUPPORTED = 1;
    CONTAMINANT_STATUS_DISABLED = 2;
    CONTAMINANT_STATUS_NOT_DETECTED = 3;
    CONTAMINANT_STATUS_DETECTED = 4;
}

message UsbPortStatusProto {
    option (android.msg_privacy).dest = DEST_AUTOMATIC;

@@ -261,7 +252,7 @@ message UsbPortStatusProto {
    optional PowerRole power_role = 3;
    optional DataRole data_role = 4;
    repeated UsbPortStatusRoleCombinationProto role_combinations = 5;
    optional ContaminantPresenceStatus contaminant_presence_status = 6;
    optional android.service.ContaminantPresenceStatus contaminant_presence_status = 6;
}

message UsbPortStatusRoleCombinationProto {
+6 −6
Original line number Diff line number Diff line
@@ -60,9 +60,9 @@ import android.os.Parcelable;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.UserHandle;
import android.service.ServiceProtoEnums;
import android.service.usb.UsbPortInfoProto;
import android.service.usb.UsbPortManagerProto;
import android.service.usb.UsbServiceProto;
import android.util.ArrayMap;
import android.util.Log;
import android.util.Slog;
@@ -1061,15 +1061,15 @@ public class UsbPortManager {
    private static int convertContaminantDetectionStatusToProto(int contaminantDetectionStatus) {
        switch (contaminantDetectionStatus) {
            case UsbPortStatus.CONTAMINANT_DETECTION_NOT_SUPPORTED:
                return UsbServiceProto.CONTAMINANT_STATUS_NOT_SUPPORTED;
                return ServiceProtoEnums.CONTAMINANT_STATUS_NOT_SUPPORTED;
            case UsbPortStatus.CONTAMINANT_DETECTION_DISABLED:
                return UsbServiceProto.CONTAMINANT_STATUS_DISABLED;
                return ServiceProtoEnums.CONTAMINANT_STATUS_DISABLED;
            case UsbPortStatus.CONTAMINANT_DETECTION_NOT_DETECTED:
                return UsbServiceProto.CONTAMINANT_STATUS_NOT_DETECTED;
                return ServiceProtoEnums.CONTAMINANT_STATUS_NOT_DETECTED;
            case UsbPortStatus.CONTAMINANT_DETECTION_DETECTED:
                return UsbServiceProto.CONTAMINANT_STATUS_DETECTED;
                return ServiceProtoEnums.CONTAMINANT_STATUS_DETECTED;
            default:
                return UsbServiceProto.CONTAMINANT_STATUS_UNKNOWN;
                return ServiceProtoEnums.CONTAMINANT_STATUS_UNKNOWN;
        }
    }