Skip to content

Commit 33034b1

Browse files
Wink SavilleJean-Baptiste Queru
authored andcommitted
Create telephony-common and mms-common - DO NOT MERGE
These have been created to reduce the size and complexity of frameworks/base. mms-common was created by moving all of frameworks/base/core/java/com/google/android/mms to: frameworks/opt/mms telephony-common was created by moving some of frameworks/base/telephony to: frameworks/opt/telephony Change-Id: If6cb3c6ff952767fc10210f923dc0e4b343cd4ad
1 parent 3c04cc4 commit 33034b1

File tree

300 files changed

+866
-98796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+866
-98796
lines changed

Android.mk

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ LOCAL_SRC_FILES += \
3838
core/java/android/content/EventLogTags.logtags \
3939
core/java/android/speech/tts/EventLogTags.logtags \
4040
core/java/android/webkit/EventLogTags.logtags \
41-
telephony/java/com/android/internal/telephony/EventLogTags.logtags \
4241

4342
# The following filters out code we are temporarily not including at all.
4443
# TODO: Move AWT and beans (and associated harmony code) back into libcore.
@@ -204,12 +203,10 @@ LOCAL_SRC_FILES += \
204203
telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
205204
telephony/java/com/android/internal/telephony/ITelephony.aidl \
206205
telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
207-
telephony/java/com/android/internal/telephony/IIccPhoneBook.aidl \
208-
telephony/java/com/android/internal/telephony/ISms.aidl \
209206
telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
207+
telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl \
210208
wifi/java/android/net/wifi/IWifiManager.aidl \
211209
wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \
212-
telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl \
213210
voip/java/android/net/sip/ISipSession.aidl \
214211
voip/java/android/net/sip/ISipSessionListener.aidl \
215212
voip/java/android/net/sip/ISipService.aidl
@@ -339,7 +336,9 @@ include libcore/Docs.mk
339336
include external/junit/Common.mk
340337

341338
non_base_dirs := \
342-
../../external/apache-http/src/org/apache/http
339+
../../external/apache-http/src/org/apache/http \
340+
../opt/telephony/src/java/android/telephony \
341+
../opt/telephony/src/java/android/telephony/gsm \
343342

344343
# These are relative to frameworks/base
345344
dirs_to_check_apis := \
@@ -390,6 +389,8 @@ framework_docs_LOCAL_JAVA_LIBRARIES := \
390389
core \
391390
ext \
392391
framework \
392+
mms-common \
393+
telephony-common \
393394

394395
framework_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
395396
framework_docs_LOCAL_DROIDDOC_HTML_DIR := docs/html

core/java/android/net/MobileDataStateTracker.java

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
package android.net;
1818

19-
import static com.android.internal.telephony.DataConnectionTracker.CMD_SET_POLICY_DATA_ENABLE;
20-
import static com.android.internal.telephony.DataConnectionTracker.CMD_SET_USER_DATA_ENABLE;
21-
import static com.android.internal.telephony.DataConnectionTracker.DISABLED;
22-
import static com.android.internal.telephony.DataConnectionTracker.ENABLED;
23-
2419
import android.content.BroadcastReceiver;
2520
import android.content.Context;
2621
import android.content.Intent;
@@ -37,9 +32,9 @@
3732
import android.text.TextUtils;
3833
import android.util.Slog;
3934

40-
import com.android.internal.telephony.DataConnectionTracker;
35+
import com.android.internal.telephony.DctConstants;
4136
import com.android.internal.telephony.ITelephony;
42-
import com.android.internal.telephony.Phone;
37+
import com.android.internal.telephony.PhoneConstants;
4338
import com.android.internal.telephony.TelephonyIntents;
4439
import com.android.internal.util.AsyncChannel;
4540

@@ -59,7 +54,7 @@ public class MobileDataStateTracker implements NetworkStateTracker {
5954
private static final boolean DBG = false;
6055
private static final boolean VDBG = false;
6156

62-
private Phone.DataState mMobileDataState;
57+
private PhoneConstants.DataState mMobileDataState;
6358
private ITelephony mPhoneService;
6459

6560
private String mApnType;
@@ -108,10 +103,10 @@ public void startMonitoring(Context context, Handler target) {
108103
IntentFilter filter = new IntentFilter();
109104
filter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
110105
filter.addAction(TelephonyIntents.ACTION_DATA_CONNECTION_FAILED);
111-
filter.addAction(DataConnectionTracker.ACTION_DATA_CONNECTION_TRACKER_MESSENGER);
106+
filter.addAction(DctConstants.ACTION_DATA_CONNECTION_TRACKER_MESSENGER);
112107

113108
mContext.registerReceiver(new MobileDataStateReceiver(), filter);
114-
mMobileDataState = Phone.DataState.DISCONNECTED;
109+
mMobileDataState = PhoneConstants.DataState.DISCONNECTED;
115110
}
116111

117112
static class MdstHandler extends Handler {
@@ -180,7 +175,7 @@ private class MobileDataStateReceiver extends BroadcastReceiver {
180175
public void onReceive(Context context, Intent intent) {
181176
if (intent.getAction().equals(TelephonyIntents.
182177
ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
183-
String apnType = intent.getStringExtra(Phone.DATA_APN_TYPE_KEY);
178+
String apnType = intent.getStringExtra(PhoneConstants.DATA_APN_TYPE_KEY);
184179
if (VDBG) {
185180
log(String.format("Broadcast received: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED"
186181
+ "mApnType=%s %s received apnType=%s", mApnType,
@@ -191,18 +186,18 @@ public void onReceive(Context context, Intent intent) {
191186
}
192187
mNetworkInfo.setSubtype(TelephonyManager.getDefault().getNetworkType(),
193188
TelephonyManager.getDefault().getNetworkTypeName());
194-
Phone.DataState state = Enum.valueOf(Phone.DataState.class,
195-
intent.getStringExtra(Phone.STATE_KEY));
196-
String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
197-
String apnName = intent.getStringExtra(Phone.DATA_APN_KEY);
198-
mNetworkInfo.setRoaming(intent.getBooleanExtra(Phone.DATA_NETWORK_ROAMING_KEY,
199-
false));
189+
PhoneConstants.DataState state = Enum.valueOf(PhoneConstants.DataState.class,
190+
intent.getStringExtra(PhoneConstants.STATE_KEY));
191+
String reason = intent.getStringExtra(PhoneConstants.STATE_CHANGE_REASON_KEY);
192+
String apnName = intent.getStringExtra(PhoneConstants.DATA_APN_KEY);
193+
mNetworkInfo.setRoaming(intent.getBooleanExtra(
194+
PhoneConstants.DATA_NETWORK_ROAMING_KEY, false));
200195
if (VDBG) {
201196
log(mApnType + " setting isAvailable to " +
202-
intent.getBooleanExtra(Phone.NETWORK_UNAVAILABLE_KEY,false));
197+
intent.getBooleanExtra(PhoneConstants.NETWORK_UNAVAILABLE_KEY,false));
203198
}
204-
mNetworkInfo.setIsAvailable(!intent.getBooleanExtra(Phone.NETWORK_UNAVAILABLE_KEY,
205-
false));
199+
mNetworkInfo.setIsAvailable(!intent.getBooleanExtra(
200+
PhoneConstants.NETWORK_UNAVAILABLE_KEY, false));
206201

207202
if (DBG) {
208203
log("Received state=" + state + ", old=" + mMobileDataState +
@@ -232,13 +227,13 @@ public void onReceive(Context context, Intent intent) {
232227
break;
233228
case CONNECTED:
234229
mLinkProperties = intent.getParcelableExtra(
235-
Phone.DATA_LINK_PROPERTIES_KEY);
230+
PhoneConstants.DATA_LINK_PROPERTIES_KEY);
236231
if (mLinkProperties == null) {
237232
loge("CONNECTED event did not supply link properties.");
238233
mLinkProperties = new LinkProperties();
239234
}
240235
mLinkCapabilities = intent.getParcelableExtra(
241-
Phone.DATA_LINK_CAPABILITIES_KEY);
236+
PhoneConstants.DATA_LINK_CAPABILITIES_KEY);
242237
if (mLinkCapabilities == null) {
243238
loge("CONNECTED event did not supply link capabilities.");
244239
mLinkCapabilities = new LinkCapabilities();
@@ -248,8 +243,9 @@ public void onReceive(Context context, Intent intent) {
248243
}
249244
} else {
250245
// There was no state change. Check if LinkProperties has been updated.
251-
if (TextUtils.equals(reason, Phone.REASON_LINK_PROPERTIES_CHANGED)) {
252-
mLinkProperties = intent.getParcelableExtra(Phone.DATA_LINK_PROPERTIES_KEY);
246+
if (TextUtils.equals(reason, PhoneConstants.REASON_LINK_PROPERTIES_CHANGED)) {
247+
mLinkProperties = intent.getParcelableExtra(
248+
PhoneConstants.DATA_LINK_PROPERTIES_KEY);
253249
if (mLinkProperties == null) {
254250
loge("No link property in LINK_PROPERTIES change event.");
255251
mLinkProperties = new LinkProperties();
@@ -264,7 +260,7 @@ public void onReceive(Context context, Intent intent) {
264260
}
265261
} else if (intent.getAction().
266262
equals(TelephonyIntents.ACTION_DATA_CONNECTION_FAILED)) {
267-
String apnType = intent.getStringExtra(Phone.DATA_APN_TYPE_KEY);
263+
String apnType = intent.getStringExtra(PhoneConstants.DATA_APN_TYPE_KEY);
268264
if (!TextUtils.equals(apnType, mApnType)) {
269265
if (DBG) {
270266
log(String.format(
@@ -273,17 +269,18 @@ public void onReceive(Context context, Intent intent) {
273269
}
274270
return;
275271
}
276-
String reason = intent.getStringExtra(Phone.FAILURE_REASON_KEY);
277-
String apnName = intent.getStringExtra(Phone.DATA_APN_KEY);
272+
String reason = intent.getStringExtra(PhoneConstants.FAILURE_REASON_KEY);
273+
String apnName = intent.getStringExtra(PhoneConstants.DATA_APN_KEY);
278274
if (DBG) {
279275
log("Received " + intent.getAction() +
280276
" broadcast" + reason == null ? "" : "(" + reason + ")");
281277
}
282278
setDetailedState(DetailedState.FAILED, reason, apnName);
283-
} else if (intent.getAction().
284-
equals(DataConnectionTracker.ACTION_DATA_CONNECTION_TRACKER_MESSENGER)) {
279+
} else if (intent.getAction().equals(DctConstants
280+
.ACTION_DATA_CONNECTION_TRACKER_MESSENGER)) {
285281
if (VDBG) log(mApnType + " got ACTION_DATA_CONNECTION_TRACKER_MESSENGER");
286-
mMessenger = intent.getParcelableExtra(DataConnectionTracker.EXTRA_MESSENGER);
282+
mMessenger =
283+
intent.getParcelableExtra(DctConstants.EXTRA_MESSENGER);
287284
AsyncChannel ac = new AsyncChannel();
288285
ac.connect(mContext, MobileDataStateTracker.this.mHandler, mMessenger);
289286
} else {
@@ -369,7 +366,7 @@ public String getTcpBufferSizesPropName() {
369366
*/
370367
public boolean teardown() {
371368
setTeardownRequested(true);
372-
return (setEnableApn(mApnType, false) != Phone.APN_REQUEST_FAILED);
369+
return (setEnableApn(mApnType, false) != PhoneConstants.APN_REQUEST_FAILED);
373370
}
374371

375372
/**
@@ -418,17 +415,17 @@ public boolean reconnect() {
418415
boolean retValue = false; //connected or expect to be?
419416
setTeardownRequested(false);
420417
switch (setEnableApn(mApnType, true)) {
421-
case Phone.APN_ALREADY_ACTIVE:
418+
case PhoneConstants.APN_ALREADY_ACTIVE:
422419
// need to set self to CONNECTING so the below message is handled.
423420
retValue = true;
424421
break;
425-
case Phone.APN_REQUEST_STARTED:
422+
case PhoneConstants.APN_REQUEST_STARTED:
426423
// set IDLE here , avoid the following second FAILED not sent out
427424
mNetworkInfo.setDetailedState(DetailedState.IDLE, null, null);
428425
retValue = true;
429426
break;
430-
case Phone.APN_REQUEST_FAILED:
431-
case Phone.APN_TYPE_NOT_AVAILABLE:
427+
case PhoneConstants.APN_REQUEST_FAILED:
428+
case PhoneConstants.APN_TYPE_NOT_AVAILABLE:
432429
break;
433430
default:
434431
loge("Error in reconnect - unexpected response.");
@@ -470,7 +467,8 @@ public void setUserDataEnable(boolean enabled) {
470467
if (DBG) log("setUserDataEnable: E enabled=" + enabled);
471468
final AsyncChannel channel = mDataConnectionTrackerAc;
472469
if (channel != null) {
473-
channel.sendMessage(CMD_SET_USER_DATA_ENABLE, enabled ? ENABLED : DISABLED);
470+
channel.sendMessage(DctConstants.CMD_SET_USER_DATA_ENABLE,
471+
enabled ? DctConstants.ENABLED : DctConstants.DISABLED);
474472
mUserDataEnabled = enabled;
475473
}
476474
if (VDBG) log("setUserDataEnable: X enabled=" + enabled);
@@ -481,7 +479,8 @@ public void setPolicyDataEnable(boolean enabled) {
481479
if (DBG) log("setPolicyDataEnable(enabled=" + enabled + ")");
482480
final AsyncChannel channel = mDataConnectionTrackerAc;
483481
if (channel != null) {
484-
channel.sendMessage(CMD_SET_POLICY_DATA_ENABLE, enabled ? ENABLED : DISABLED);
482+
channel.sendMessage(DctConstants.CMD_SET_POLICY_DATA_ENABLE,
483+
enabled ? DctConstants.ENABLED : DctConstants.DISABLED);
485484
mPolicyDataEnabled = enabled;
486485
}
487486
}
@@ -491,12 +490,12 @@ public void setPolicyDataEnable(boolean enabled) {
491490
* @param met
492491
*/
493492
public void setDependencyMet(boolean met) {
494-
Bundle bundle = Bundle.forPair(DataConnectionTracker.APN_TYPE_KEY, mApnType);
493+
Bundle bundle = Bundle.forPair(DctConstants.APN_TYPE_KEY, mApnType);
495494
try {
496495
if (DBG) log("setDependencyMet: E met=" + met);
497496
Message msg = Message.obtain();
498-
msg.what = DataConnectionTracker.CMD_SET_DEPENDENCY_MET;
499-
msg.arg1 = (met ? DataConnectionTracker.ENABLED : DataConnectionTracker.DISABLED);
497+
msg.what = DctConstants.CMD_SET_DEPENDENCY_MET;
498+
msg.arg1 = (met ? DctConstants.ENABLED : DctConstants.DISABLED);
500499
msg.setData(bundle);
501500
mDataConnectionTrackerAc.sendMessage(msg);
502501
if (VDBG) log("setDependencyMet: X met=" + met);
@@ -546,27 +545,27 @@ private int setEnableApn(String apnType, boolean enable) {
546545
}
547546

548547
loge("Could not " + (enable ? "enable" : "disable") + " APN type \"" + apnType + "\"");
549-
return Phone.APN_REQUEST_FAILED;
548+
return PhoneConstants.APN_REQUEST_FAILED;
550549
}
551550

552551
public static String networkTypeToApnType(int netType) {
553552
switch(netType) {
554553
case ConnectivityManager.TYPE_MOBILE:
555-
return Phone.APN_TYPE_DEFAULT; // TODO - use just one of these
554+
return PhoneConstants.APN_TYPE_DEFAULT; // TODO - use just one of these
556555
case ConnectivityManager.TYPE_MOBILE_MMS:
557-
return Phone.APN_TYPE_MMS;
556+
return PhoneConstants.APN_TYPE_MMS;
558557
case ConnectivityManager.TYPE_MOBILE_SUPL:
559-
return Phone.APN_TYPE_SUPL;
558+
return PhoneConstants.APN_TYPE_SUPL;
560559
case ConnectivityManager.TYPE_MOBILE_DUN:
561-
return Phone.APN_TYPE_DUN;
560+
return PhoneConstants.APN_TYPE_DUN;
562561
case ConnectivityManager.TYPE_MOBILE_HIPRI:
563-
return Phone.APN_TYPE_HIPRI;
562+
return PhoneConstants.APN_TYPE_HIPRI;
564563
case ConnectivityManager.TYPE_MOBILE_FOTA:
565-
return Phone.APN_TYPE_FOTA;
564+
return PhoneConstants.APN_TYPE_FOTA;
566565
case ConnectivityManager.TYPE_MOBILE_IMS:
567-
return Phone.APN_TYPE_IMS;
566+
return PhoneConstants.APN_TYPE_IMS;
568567
case ConnectivityManager.TYPE_MOBILE_CBS:
569-
return Phone.APN_TYPE_CBS;
568+
return PhoneConstants.APN_TYPE_CBS;
570569
default:
571570
sloge("Error mapping networkType " + netType + " to apnType.");
572571
return null;

core/java/android/provider/CallLog.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package android.provider;
1919

2020
import com.android.internal.telephony.CallerInfo;
21-
import com.android.internal.telephony.Connection;
21+
import com.android.internal.telephony.PhoneConstants;
2222

2323
import android.content.ContentResolver;
2424
import android.content.ContentValues;
@@ -267,14 +267,14 @@ public static Uri addCall(CallerInfo ci, Context context, String number,
267267

268268
// If this is a private number then set the number to Private, otherwise check
269269
// if the number field is empty and set the number to Unavailable
270-
if (presentation == Connection.PRESENTATION_RESTRICTED) {
270+
if (presentation == PhoneConstants.PRESENTATION_RESTRICTED) {
271271
number = CallerInfo.PRIVATE_NUMBER;
272272
if (ci != null) ci.name = "";
273-
} else if (presentation == Connection.PRESENTATION_PAYPHONE) {
273+
} else if (presentation == PhoneConstants.PRESENTATION_PAYPHONE) {
274274
number = CallerInfo.PAYPHONE_NUMBER;
275275
if (ci != null) ci.name = "";
276276
} else if (TextUtils.isEmpty(number)
277-
|| presentation == Connection.PRESENTATION_UNKNOWN) {
277+
|| presentation == PhoneConstants.PRESENTATION_UNKNOWN) {
278278
number = CallerInfo.UNKNOWN_NUMBER;
279279
if (ci != null) ci.name = "";
280280
}

0 commit comments

Comments
 (0)