Home | History | Annotate | Download | only in bluetooth
      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 com.android.settingslib.R;
     20 
     21 import android.bluetooth.BluetoothClass;
     22 import android.bluetooth.BluetoothDevice;
     23 import android.bluetooth.BluetoothProfile;
     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 
     35     public boolean isConnectable() {
     36         return false;
     37     }
     38 
     39     public boolean isAutoConnectable() {
     40         return false;
     41     }
     42 
     43     public boolean connect(BluetoothDevice device) {
     44         return false;
     45     }
     46 
     47     public boolean disconnect(BluetoothDevice device) {
     48         return false;
     49     }
     50 
     51     public int getConnectionStatus(BluetoothDevice device) {
     52         return BluetoothProfile.STATE_DISCONNECTED; // Settings app doesn't handle OPP
     53     }
     54 
     55     public boolean isPreferred(BluetoothDevice device) {
     56         return false;
     57     }
     58 
     59     public int getPreferred(BluetoothDevice device) {
     60         return BluetoothProfile.PRIORITY_OFF; // Settings app doesn't handle OPP
     61     }
     62 
     63     public void setPreferred(BluetoothDevice device, boolean preferred) {
     64     }
     65 
     66     public boolean isProfileReady() {
     67         return true;
     68     }
     69 
     70     public String toString() {
     71         return NAME;
     72     }
     73 
     74     public int getOrdinal() {
     75         return ORDINAL;
     76     }
     77 
     78     public int getNameResource(BluetoothDevice device) {
     79         return R.string.bluetooth_profile_opp;
     80     }
     81 
     82     public int getSummaryResourceForDevice(BluetoothDevice device) {
     83         return 0;   // OPP profile not displayed in UI
     84     }
     85 
     86     public int getDrawableResource(BluetoothClass btClass) {
     87         return 0;   // no icon for OPP
     88     }
     89 }
     90