• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 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.settingslib.bluetooth;
18 
19 import android.bluetooth.BluetoothClass;
20 import android.bluetooth.BluetoothDevice;
21 import android.bluetooth.BluetoothProfile;
22 
23 import com.android.settingslib.R;
24 
25 /**
26  * OppProfile handles Bluetooth OPP.
27  */
28 final class OppProfile implements LocalBluetoothProfile {
29 
30     static final String NAME = "OPP";
31 
32     // Order of this profile in device profiles list
33     private static final int ORDINAL = 2;
34 
accessProfileEnabled()35     public boolean accessProfileEnabled() {
36         return false;
37     }
38 
isAutoConnectable()39     public boolean isAutoConnectable() {
40         return false;
41     }
42 
connect(BluetoothDevice device)43     public boolean connect(BluetoothDevice device) {
44         return false;
45     }
46 
disconnect(BluetoothDevice device)47     public boolean disconnect(BluetoothDevice device) {
48         return false;
49     }
50 
getConnectionStatus(BluetoothDevice device)51     public int getConnectionStatus(BluetoothDevice device) {
52         return BluetoothProfile.STATE_DISCONNECTED; // Settings app doesn't handle OPP
53     }
54 
isPreferred(BluetoothDevice device)55     public boolean isPreferred(BluetoothDevice device) {
56         return false;
57     }
58 
getPreferred(BluetoothDevice device)59     public int getPreferred(BluetoothDevice device) {
60         return BluetoothProfile.PRIORITY_OFF; // Settings app doesn't handle OPP
61     }
62 
setPreferred(BluetoothDevice device, boolean preferred)63     public void setPreferred(BluetoothDevice device, boolean preferred) {
64     }
65 
isProfileReady()66     public boolean isProfileReady() {
67         return true;
68     }
69 
70     @Override
getProfileId()71     public int getProfileId() {
72         return BluetoothProfile.OPP;
73     }
74 
toString()75     public String toString() {
76         return NAME;
77     }
78 
getOrdinal()79     public int getOrdinal() {
80         return ORDINAL;
81     }
82 
getNameResource(BluetoothDevice device)83     public int getNameResource(BluetoothDevice device) {
84         return R.string.bluetooth_profile_opp;
85     }
86 
getSummaryResourceForDevice(BluetoothDevice device)87     public int getSummaryResourceForDevice(BluetoothDevice device) {
88         return 0;   // OPP profile not displayed in UI
89     }
90 
getDrawableResource(BluetoothClass btClass)91     public int getDrawableResource(BluetoothClass btClass) {
92         return 0;   // no icon for OPP
93     }
94 }
95