1 /************************************************************************************
2  *
3  *  Copyright (C) 2009-2012 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ************************************************************************************/
18 package com.android.bluetooth.pbap;
19 
20 import android.content.Context;
21 import android.content.res.Resources;
22 import android.util.Log;
23 
24 import com.android.bluetooth.R;
25 
26 public class BluetoothPbapConfig {
27     private static boolean sUseProfileForOwnerVcard = true;
28     private static boolean sIncludePhotosInVcard = false;
29 
init(Context ctx)30     public static void init(Context ctx) {
31         Resources r = ctx.getResources();
32         if (r != null) {
33             try {
34                 sUseProfileForOwnerVcard = r.getBoolean(R.bool.pbap_use_profile_for_owner_vcard);
35             } catch (Exception e) {
36                 Log.e("BluetoothPbapConfig", "", e);
37             }
38             try {
39                 sIncludePhotosInVcard = r.getBoolean(R.bool.pbap_include_photos_in_vcard);
40             } catch (Exception e) {
41                 Log.e("BluetoothPbapConfig", "", e);
42             }
43         }
44     }
45 
46     /**
47      * If true, owner vcard will be generated from the "Me" profile
48      */
useProfileForOwnerVcard()49     public static boolean useProfileForOwnerVcard() {
50         return sUseProfileForOwnerVcard;
51     }
52 
53     /**
54      * If true, include photos in contact information returned to PCE
55      * @return
56      */
includePhotosInVcard()57     public static boolean includePhotosInVcard() {
58         return sIncludePhotosInVcard;
59     }
60 }
61