/*
 * Copyright (C) 2017 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 com.android.permissioncontroller.incident;

option java_multiple_files = true;


/*
 * Everything in this file is a subset of the platform incident.proto.
 */

/**
 * This message has the same fields in an incident report that we care about
 * but none of the ones we don't.  So when we receive one, we attempt to parse
 * it using this proto, which will result in the rest of the fields being dropped.
 *
 * From frameworks/base/core/proto/android/os/incident.proto
 */
message IncidentMinimal {
    repeated IncidentHeaderProto header = 1;
    optional RestrictedImagesDumpProto restricted_images_section = 3025;
}

/**
 * From frameworks/base/core/proto/android/os/header.proto
 */
message IncidentHeaderProto {
    // A human readable reason why an incident report is requested.
    optional string reason = 2;
}

/**
 * From frameworks/base/core/proto/android/service/restricted_image.proto
 */
message RestrictedImagesDumpProto {
    repeated RestrictedImageSetProto sets = 1;
}

/**
 * From frameworks/base/core/proto/android/service/restricted_image.proto
 */
message RestrictedImageSetProto {
    // Name of the service producing the data.
    optional string category = 1;

    // The images
    repeated RestrictedImageProto images = 2;

    // Additional metadata
    optional bytes metadata = 3;
}

/**
 * From frameworks/base/core/proto/android/service/restricted_image.proto
 */
message RestrictedImageProto {
    // Type of image data
    optional string mime_type = 1;

    // The image data
    optional bytes image_data = 2;

    // Metadata about the image.  Typically this has another proto schema,
    // but it is undefined exactly what that is in AOSP code.
    optional bytes metadata = 3;
}

