• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 Google Inc. All Rights Reserved.
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.example.android.wearable.runtimepermissions.common;
18 
19 import java.util.concurrent.TimeUnit;
20 
21 /**
22  * A collection of constants that is shared between the wearable and handset apps.
23  */
24 public class Constants {
25 
26     // Shared
27     public static final long CONNECTION_TIME_OUT_MS = TimeUnit.SECONDS.toMillis(5);
28 
29     public static final String KEY_COMM_TYPE = "communicationType";
30     public static final String KEY_PAYLOAD = "payload";
31 
32     // Requests
33     public static final int COMM_TYPE_REQUEST_PROMPT_PERMISSION = 1;
34     public static final int COMM_TYPE_REQUEST_DATA = 2;
35 
36     // Responses
37     public static final int COMM_TYPE_RESPONSE_PERMISSION_REQUIRED = 1001;
38     public static final int COMM_TYPE_RESPONSE_USER_APPROVED_PERMISSION = 1002;
39     public static final int COMM_TYPE_RESPONSE_USER_DENIED_PERMISSION = 1003;
40     public static final int COMM_TYPE_RESPONSE_DATA = 1004;
41 
42     // Phone
43     public static final String CAPABILITY_PHONE_APP = "phone_app_runtime_permissions";
44     public static final String MESSAGE_PATH_PHONE = "/phone_message_path";
45 
46     // Wear
47     public static final String CAPABILITY_WEAR_APP = "wear_app_runtime_permissions";
48     public static final String MESSAGE_PATH_WEAR = "/wear_message_path";
49 
Constants()50     private Constants() {}
51 }