Home | History | Annotate | Download | only in pbap
      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 com.android.bluetooth.R;
     21 
     22 import android.content.Context;
     23 import android.content.res.Resources;
     24 import android.util.Log;
     25 
     26 public class BluetoothPbapConfig {
     27     private static boolean sUseProfileForOwnerVcard=true;
     28     private static boolean sIncludePhotosInVcard = false;
     29     public static void init(Context ctx) {
     30         Resources r = ctx.getResources();
     31         if (r != null) {
     32             try {
     33                 sUseProfileForOwnerVcard = r.getBoolean(R.bool.pbap_use_profile_for_owner_vcard);
     34             } catch(Exception e) {
     35                 Log.e("BluetoothPbapConfig","",e);
     36             }
     37             try {
     38                 sIncludePhotosInVcard = r.getBoolean(R.bool.pbap_include_photos_in_vcard);
     39             } catch(Exception e) {
     40                 Log.e("BluetoothPbapConfig","",e);
     41             }
     42         }
     43     }
     44 
     45     /**
     46      * If true, owner vcard will be generated from the "Me" profile
     47      */
     48     public static boolean useProfileForOwnerVcard() {
     49         return sUseProfileForOwnerVcard;
     50     }
     51 
     52     /**
     53      * If true, include photos in contact information returned to PCE
     54      * @return
     55      */
     56     public static boolean includePhotosInVcard() {
     57         return sIncludePhotosInVcard;
     58     }
     59 }
     60