1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ondevicepersonalization.services.data.vendor; 18 19 import android.provider.BaseColumns; 20 21 /** Contract for the vendor_settings tables. Defines the table. */ 22 public class VendorSettingsContract { VendorSettingsContract()23 private VendorSettingsContract() { 24 } 25 26 /** 27 * Table containing the settings for vendors 28 */ 29 public static class VendorSettingsEntry implements BaseColumns { 30 public static final String TABLE_NAME = "vendor_settings"; 31 /** Name of the vendor package that owns the setting */ 32 public static final String OWNER = "owner"; 33 /** Certificate digest of the vendor package that owns the setting */ 34 public static final String CERT_DIGEST = "certDigest"; 35 /** The syncToken represented as a timestamp */ 36 public static final String SYNC_TOKEN = "syncToken"; 37 public static final String CREATE_TABLE_STATEMENT = "CREATE TABLE IF NOT EXISTS " 38 + TABLE_NAME + " (" 39 + OWNER + " TEXT NOT NULL," 40 + CERT_DIGEST + " TEXT NOT NULL," 41 + SYNC_TOKEN + " INTEGER NOT NULL," 42 + "PRIMARY KEY(" + OWNER + "," + CERT_DIGEST + "))"; 43 VendorSettingsEntry()44 private VendorSettingsEntry() { 45 } 46 } 47 } 48