Home | History | Annotate | Download | only in common
      1 /*
      2  * Copyright (C) 2017 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 android.inputmethodservice.cts.common;
     18 
     19 /**
     20  * Constants of CtsInputMethodServiceEventProvider.apk that keeps IME event records.
     21  */
     22 public final class EventProviderConstants {
     23 
     24     // This is constants holding class, can't instantiate.
     25     private EventProviderConstants() {}
     26 
     27     /** Package name of the IME event provider. */
     28     public static final String PACKAGE = "android.inputmethodservice.cts.provider";
     29 
     30     /** Class name of IME event provider. */
     31     public static final String CLASS =
     32             "android.inputmethodservice.cts.provider.EventProviderConstants";
     33 
     34     /** APK file name. */
     35     public static final String APK = "CtsInputMethodServiceEventProvider.apk";
     36 
     37     /** The authority of IME event provider. */
     38     public static final String AUTHORITY = "android.inputmethodservice.cts.provider";
     39 
     40     /** The base URI of IME event provider. */
     41     private static final String BASE_URI = "content://" + AUTHORITY;
     42 
     43     /**
     44      * The Android platform's base MIME type for a content: URI containing a Cursor of a single
     45      * item. Copied from android.content.ContentResolver.CURSOR_ITEM_BASE_TYPE.
     46      */
     47     private static final String CURSOR_ITEM_BASE_TYPE = "vnd.android.cursor.item";
     48 
     49     /**
     50      * The Android platform's base MIME type for a content: URI containing a Cursor of zero or more
     51      * items. Copied from android.content.ContentResolver.CURSOR_DIR_BASE_TYPE.
     52      */
     53     private static final String CURSOR_DIR_BASE_TYPE = "vnd.android.cursor.dir";
     54 
     55     /** Constants of Events table of IME event provider. */
     56     public static final class EventTableConstants {
     57 
     58         // This is constants holding class, can't instantiate.
     59         private EventTableConstants() {}
     60 
     61         /** Name of the table in content provider and database. */
     62         public static final String NAME = "events";
     63 
     64         /** Column name of the table that holds who sends an event. */
     65         public static final String SENDER = "sender";
     66 
     67         /** Column name of the table that holds what type of event is. */
     68         public static final String TYPE = "type";
     69 
     70         /** Column name of the table that holds when an event happens. */
     71         public static final String TIME = "time";
     72 
     73         /** Content URI of the table. */
     74         public static final String CONTENT_URI = BASE_URI + "/" + NAME;
     75 
     76         /** MIME type of a cursor of zero or more items of the table. */
     77         public static final String TYPE_DIR =
     78                 CURSOR_DIR_BASE_TYPE + "/" + AUTHORITY + ".ime_event";
     79 
     80         /** MIME tye of a cursor of a single item of the table. */
     81         public static final String TYPE_ITEM =
     82                 CURSOR_ITEM_BASE_TYPE + "/" + AUTHORITY + ".ime_event";
     83     }
     84 }
     85