/*
 * 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";

import "android.proto";
import "app.proto";

package android_common.content;
option java_multiple_files = true;

message ActivityInfoProto {
    enum ScreenOrientation {
        SCREEN_ORIENTATION_UNSET = -2;
        SCREEN_ORIENTATION_UNSPECIFIED = -1;
        SCREEN_ORIENTATION_LANDSCAPE = 0;
        SCREEN_ORIENTATION_PORTRAIT = 1;
        SCREEN_ORIENTATION_USER = 2;
        SCREEN_ORIENTATION_BEHIND = 3;
        SCREEN_ORIENTATION_SENSOR = 4;
        SCREEN_ORIENTATION_NOSENSOR = 5;
        SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 6;
        SCREEN_ORIENTATION_SENSOR_PORTRAIT = 7;
        SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 8;
        SCREEN_ORIENTATION_REVERSE_PORTRAIT = 9;
        SCREEN_ORIENTATION_FULL_SENSOR = 10;
        SCREEN_ORIENTATION_USER_LANDSCAPE = 11;
        SCREEN_ORIENTATION_USER_PORTRAIT = 12;
        SCREEN_ORIENTATION_FULL_USER = 13;
        SCREEN_ORIENTATION_LOCKED = 14;
    }
}

/**
 * An android Configuration object.
 */
message ConfigurationProto {
    option (.android_common.msg_privacy).dest = DEST_AUTOMATIC;

    optional float font_scale = 1;
    optional uint32 mcc = 2;
    optional uint32 mnc = 3 [ (.android_common.privacy).dest = DEST_EXPLICIT ];
    repeated LocaleProto locales = 4 [deprecated = true];
    optional uint32 screen_layout = 5;
    optional uint32 color_mode = 6;
    optional uint32 touchscreen = 7;
    optional uint32 keyboard = 8;
    optional uint32 keyboard_hidden = 9;
    optional uint32 hard_keyboard_hidden = 10;
    optional uint32 navigation = 11;
    optional uint32 navigation_hidden = 12;
    optional uint32 orientation = 13;
    optional uint32 ui_mode = 14;
    optional uint32 screen_width_dp = 15;
    optional uint32 screen_height_dp = 16;
    optional uint32 smallest_screen_width_dp = 17;
    optional uint32 density_dpi = 18;
    optional .android_common.app.WindowConfigurationProto window_configuration = 19;
    optional string locale_list = 20;
    optional uint32 font_weight_adjustment = 21;
    optional uint32 grammatical_gender = 22;
}

/**
 * All current configuration data used to select resources.
 */
message ResourcesConfigurationProto {
    option (.android_common.msg_privacy).dest = DEST_AUTOMATIC;

    required ConfigurationProto configuration = 1;

    optional uint32 sdk_version = 2;
    optional uint32 screen_width_px = 3;
    optional uint32 screen_height_px = 4;
}

/**
 * Overall device configuration data.
 */
message DeviceConfigurationProto {
    option (.android_common.msg_privacy).dest = DEST_AUTOMATIC;

    optional uint32 stable_screen_width_px = 1;
    optional uint32 stable_screen_height_px = 2;
    optional uint32 stable_density_dpi = 3;

    optional uint64 total_ram = 4;
    optional bool low_ram = 5;
    optional uint32 max_cores = 6;
    optional bool has_secure_screen_lock = 7;

    optional uint32 opengl_version = 8;
    repeated string opengl_extensions = 9;

    repeated string shared_libraries = 10;
    repeated string features = 11;
    repeated string cpu_architectures = 12;
}

/**
 * All current configuration data device is running with, everything used
 * to filter and target apps.
 */
message GlobalConfigurationProto {
    option (.android_common.msg_privacy).dest = DEST_AUTOMATIC;

    optional ResourcesConfigurationProto resources = 1;
    optional DeviceConfigurationProto device = 2;
}

message LocaleProto {
    option deprecated = true;
    option (.android_common.msg_privacy).dest = DEST_AUTOMATIC;

    optional string language = 1;
    optional string country = 2;
    optional string variant = 3;
    optional string script = 4;
}

