blob: f16d8ce9cec2ba0d3b44cbb4731fc6885f8e4cbb [file] [log] [blame]
Santos Cordon7d4ddf62013-07-10 11:58:08 -07001/*
2 * Copyright (C) 2012 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.phone;
18
19import android.app.Application;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070020import android.os.UserHandle;
21
Santos Cordona9ec9652014-03-04 11:42:23 -080022import com.android.services.telephony.TelephonyGlobals;
23
Santos Cordon7d4ddf62013-07-10 11:58:08 -070024/**
25 * Top-level Application class for the Phone app.
26 */
27public class PhoneApp extends Application {
28 PhoneGlobals mPhoneGlobals;
Santos Cordona9ec9652014-03-04 11:42:23 -080029 TelephonyGlobals mTelephonyGlobals;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070030
31 public PhoneApp() {
32 }
33
34 @Override
35 public void onCreate() {
36 if (UserHandle.myUserId() == 0) {
37 // We are running as the primary user, so should bring up the
38 // global phone state.
39 mPhoneGlobals = new PhoneGlobals(this);
40 mPhoneGlobals.onCreate();
Santos Cordona9ec9652014-03-04 11:42:23 -080041
Santos Cordon2afb2be2014-03-06 12:30:34 -080042 mTelephonyGlobals = new TelephonyGlobals(this);
Santos Cordona9ec9652014-03-04 11:42:23 -080043 mTelephonyGlobals.onCreate();
Santos Cordon7d4ddf62013-07-10 11:58:08 -070044 }
45 }
Santos Cordon7d4ddf62013-07-10 11:58:08 -070046}