blob: aa1397aeba173b19c8817d484880618b13d3e9f7 [file] [log] [blame]
Dmitri Plotnikovf049ff02010-11-29 10:15:24 -08001/*
2 * Copyright (C) 2010 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
17package com.android.contacts;
18
Dmitri Plotnikov169ff2a2010-11-29 16:58:31 -080019import com.android.contacts.model.AccountTypes;
20
Dmitri Plotnikovf049ff02010-11-29 10:15:24 -080021import android.app.Application;
Dmitri Plotnikov3b7dedd2010-11-29 14:46:10 -080022import android.content.Context;
Dmitri Plotnikovf049ff02010-11-29 10:15:24 -080023import android.os.StrictMode;
Dmitri Plotnikov3b7dedd2010-11-29 14:46:10 -080024import android.preference.PreferenceManager;
25
Dmitri Plotnikovf049ff02010-11-29 10:15:24 -080026public final class ContactsApplication extends Application {
27
28 @Override
29 public void onCreate() {
30 super.onCreate();
31
Dmitri Plotnikov3b7dedd2010-11-29 14:46:10 -080032 // Priming caches to placate the StrictMode police
33 Context context = getApplicationContext();
34 PreferenceManager.getDefaultSharedPreferences(context);
Dmitri Plotnikov3b7dedd2010-11-29 14:46:10 -080035 AccountTypes.getInstance(context);
36
Dmitri Plotnikovf049ff02010-11-29 10:15:24 -080037 StrictMode.setThreadPolicy(
38 new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
39 }
40}