Skip to content

Most visited

Recently visited

navigation
RuntimePermissionsWear / Shared / src / com.example.android.wearable.runtimepermissions.common /

Constants.java

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
 
50
    private Constants() {}
51
}
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)