chromium/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/geo/partner_location_descriptor.proto

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Protocol buffer definition for a location descriptor, used for sending
// geographical information to the Default Search Engine in omnibox queries
// when location permissions are granted.
//
// TODO(lbargu): Move over to standard Geo header once it is defined, and remove
// this proto structure from chromium code base.
//
// NOTE: This is currently using a Google-defined structure. This explains the
// jumps in values. New fields cannot be added to this proto directly. See
// https://goto.google.com/partner_location_proto

syntax = "proto2";

package org.chromium.chrome.browser.omnibox.geo;

option java_outer_classname = "PartnerLocationDescriptor";
option java_package = "org.chromium.chrome.browser.omnibox.geo";

// TODO(jkrcal): Remove when protobuf 4.0 is out, https://crbug.com/800281.
option optimize_for = LITE_RUNTIME;

enum LocationRole {
  UNKNOWN_ROLE = 0;
  CURRENT_LOCATION = 1;
}

enum LocationProducer {
  UNKNOWN_PRODUCER = 0;
  DEVICE_LOCATION = 12;
}

message LatLng {
  optional sfixed32 latitude_e7 = 1;
  optional sfixed32 longitude_e7 = 2;
}

message VisibleNetwork {

  message WiFi {
    optional string bssid = 1;
    optional int32 level_dbm = 2;
  }

  message Cell {

    enum Type {
      UNKNOWN = 0;
      GSM = 1;
      LTE = 2;
      CDMA = 3;
      WCDMA = 4;
    }

    optional Type type = 1;
    optional int32 cell_id = 2;
    optional int32 location_area_code = 3;
    optional int32 mobile_country_code = 4;
    optional int32 mobile_network_code = 5;
    optional int32 primary_scrambling_code = 6;
    optional int32 physical_cell_id = 7;
    optional int32 tracking_area_code = 8;
  }

  oneof type {
    WiFi wifi = 1;
    Cell cell = 2;
  }

  optional bool connected = 3;
  optional int64 timestamp_ms = 4;
}

message LocationDescriptor {
  optional LocationRole role = 1 [default = UNKNOWN_ROLE];
  optional LocationProducer producer = 2 [default = UNKNOWN_PRODUCER];
  optional int64 timestamp = 3;
  optional LatLng latlng = 5;
  optional float radius = 7;
  repeated VisibleNetwork visible_network = 23;
}