Add a TelephonyGlobals class.
Change-Id: I6ef31dee75fb97e35f411c6415d9b838ae717994
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index 6b5aa11..c5f69bf 100644
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -20,11 +20,14 @@
import android.content.res.Configuration;
import android.os.UserHandle;
+import com.android.services.telephony.TelephonyGlobals;
+
/**
* Top-level Application class for the Phone app.
*/
public class PhoneApp extends Application {
PhoneGlobals mPhoneGlobals;
+ TelephonyGlobals mTelephonyGlobals;
public PhoneApp() {
}
@@ -36,6 +39,9 @@
// global phone state.
mPhoneGlobals = new PhoneGlobals(this);
mPhoneGlobals.onCreate();
+
+ mTelephonyGlobals = new TelephonyGlobals();
+ mTelephonyGlobals.onCreate();
}
}
}
diff --git a/src/com/android/services/telephony/TelephonyGlobals.java b/src/com/android/services/telephony/TelephonyGlobals.java
new file mode 100644
index 0000000..e86a40e
--- /dev/null
+++ b/src/com/android/services/telephony/TelephonyGlobals.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.services.telephony;
+
+/**
+ * Singleton entry point for the telephony-services app. Initializes ongoing systems relating to
+ * PSTN and SIP calls. This is started when the device starts and will be restarted automatically
+ * if it goes away for any reason (e.g., crashes).
+ * This is separate from the actual Application class because we only support one instance of this
+ * app - running as the default user. {@link com.android.phone.PhoneApp} determines whether or not
+ * we are running as the default user and if we are, then initializes and runs this class's
+ * {@link #onCreate}.
+ */
+public class TelephonyGlobals {
+
+ public void onCreate() {
+ // TODO(santoscordon): Start incoming-call listeners.
+ }
+}