• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 Esmertec AG.
3  * Copyright (C) 2008 The Android Open Source Project
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.mms;
19 
20 import com.android.mms.data.Contact;
21 import com.android.mms.data.Conversation;
22 import com.android.mms.drm.DrmUtils;
23 import com.android.mms.layout.LayoutManager;
24 import com.android.mms.util.ContactInfoCache;
25 import com.android.mms.util.DownloadManager;
26 import com.android.mms.util.DraftCache;
27 import com.android.mms.util.SmileyParser;
28 import com.android.mms.util.RateController;
29 import com.android.mms.MmsConfig;
30 
31 import android.app.Application;
32 import android.content.res.Configuration;
33 import android.preference.PreferenceManager;
34 
35 public class MmsApp extends Application {
36     public static final String LOG_TAG = "Mms";
37 
38     @Override
onCreate()39     public void onCreate() {
40         super.onCreate();
41 
42         // Load the default preference values
43         PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
44 
45         MmsConfig.init(this);
46         ContactInfoCache.init(this);
47         Contact.init(this);
48         DraftCache.init(this);
49         Conversation.init(this);
50         DownloadManager.init(this);
51         RateController.init(this);
52         DrmUtils.cleanupStorage(this);
53         LayoutManager.init(this);
54         SmileyParser.init(this);
55     }
56 
57     @Override
onTerminate()58     public void onTerminate() {
59         DrmUtils.cleanupStorage(this);
60     }
61 
62     @Override
onConfigurationChanged(Configuration newConfig)63     public void onConfigurationChanged(Configuration newConfig) {
64         LayoutManager.getInstance().onConfigurationChanged(newConfig);
65     }
66 }
67