Loading core/java/android/net/http/AndroidHttpClient.java +5 −0 Original line number Diff line number Diff line Loading @@ -254,6 +254,11 @@ public final class AndroidHttpClient implements HttpClient { private boolean isMmsRequest() { if(delegate.getParams() == null || delegate.getParams().getParameter(CoreProtocolPNames.USER_AGENT) == null) { return false; } if(delegate.getParams().getParameter(CoreProtocolPNames.USER_AGENT).toString().contains("Android-Mms")) return true; Loading core/java/android/provider/CallLog.java +31 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.provider.ContactsContract.DataUsageFeedback; import android.text.TextUtils; import com.android.internal.telephony.CallerInfo; import com.android.internal.telephony.MSimConstants; import com.android.internal.telephony.PhoneConstants; /** Loading Loading @@ -286,6 +287,13 @@ public class CallLog { */ public static final String CACHED_FORMATTED_NUMBER = "formatted_number"; /** * The subscription id. * <P>Type: Integer</P> * @hide */ public static final String SUBSCRIPTION = MSimConstants.SUBSCRIPTION_KEY; /** * Adds a call to the call log. * Loading @@ -304,6 +312,28 @@ public class CallLog { */ public static Uri addCall(CallerInfo ci, Context context, String number, int presentation, int callType, long start, int duration) { return addCall(ci, context, number, presentation, callType, start, duration, MSimConstants.DEFAULT_SUBSCRIPTION); } /** * Add a call to the call log for multi sim, and it can be used in TSTS. * * @param ci the CallerInfo object to get the target contact from. Can be null * if the contact is unknown. * @param context the context used to get the ContentResolver * @param number the phone number to be added to the calls db * @param presentation the number presenting rules set by the network for * "allowed", "payphone", "restricted" or "unknown" * @param callType enumerated values for "incoming", "outgoing", or "missed" * @param start time stamp for the call in milliseconds * @param duration call duration in seconds * @param subscription valid value is 0,1 or 2 * * {@hide} */ public static Uri addCall(CallerInfo ci, Context context, String number, int presentation, int callType, long start, int duration, int subscription) { final ContentResolver resolver = context.getContentResolver(); int numberPresentation = PRESENTATION_ALLOWED; Loading Loading @@ -335,6 +365,7 @@ public class CallLog { values.put(DATE, Long.valueOf(start)); values.put(DURATION, Long.valueOf(duration)); values.put(NEW, Integer.valueOf(1)); values.put(SUBSCRIPTION, Integer.valueOf(subscription)); if (callType == MISSED_TYPE) { values.put(IS_READ, Integer.valueOf(0)); } Loading core/java/android/provider/ContactsContract.java +25 −0 Original line number Diff line number Diff line Loading @@ -5172,6 +5172,31 @@ public final class ContactsContract { public static final String LABEL = DataColumns.DATA3; } /** @hide */ public static final class LocalGroup implements DataColumnsWithJoins { /** @hide */ private LocalGroup() { } /** @hide */ public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/local-groups"; /** @hide */ public static final String GROUP = DATA1; /** @hide */ public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI, "local-groups"); /** @hide */ public static final Uri CONTENT_LOOKUP_URI = Uri .withAppendedPath(CONTENT_URI, "lookup"); /** @hide */ public static final Uri CONTENT_FILTER_URI = Uri .withAppendedPath(CONTENT_URI, "filter"); } /** * A data kind representing the contact's proper name. You can use all * columns defined for {@link ContactsContract.Data} as well as the following aliases. Loading core/java/android/provider/LocalGroups.java 0 → 100644 +155 −0 Original line number Diff line number Diff line /* * Copyright (C) 2013, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of The Linux Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package android.provider; import android.content.ContentResolver; import android.content.ContentUris; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds; import android.provider.ContactsContract.Data; /** * @hide */ public class LocalGroups { public static final String AUTHORITY = "com.android.contacts.groups"; public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY); public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "local-groups"); public static interface GroupColumns { public static final String _ID = "_id"; public static final String TITLE = "title"; public static final String COUNT = "count"; } public static class Group { private long id = -1; private String title = ""; private int count; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getCount() { return count; } public void setCount(int count) { this.count = count; } public static Group restoreGroup(Cursor cursor) { if (cursor == null && cursor.getCount() == 0) { return null; } Group group = new Group(); group.setId(cursor.getLong(cursor.getColumnIndex(GroupColumns._ID))); group.setTitle(cursor.getString(cursor.getColumnIndex(GroupColumns.TITLE))); group.setCount(cursor.getInt(cursor.getColumnIndex(GroupColumns.COUNT))); return group; } public ContentValues toContentValues() { ContentValues values = new ContentValues(); values.put(GroupColumns.TITLE, getTitle()); values.put(GroupColumns.COUNT, getCount()); return values; } public boolean save(ContentResolver cr) { if (cr == null) { return false; } Uri uri = cr.insert(CONTENT_URI, toContentValues()); if (uri != null) { setId(ContentUris.parseId(uri)); return true; } else { return false; } } public boolean update(ContentResolver cr) { if (cr == null) { return false; } return cr.update(CONTENT_URI, toContentValues(), GroupColumns._ID + "=?", new String[] { String.valueOf(id) }) > 0; } public boolean delete(ContentResolver cr) { cr.delete(Data.CONTENT_URI, Data.MIMETYPE + "=? and " + CommonDataKinds.LocalGroup.DATA1 + "=?", new String[] { CommonDataKinds.LocalGroup.CONTENT_ITEM_TYPE, String.valueOf(getId()) }); return cr.delete(CONTENT_URI, GroupColumns._ID + "=?", new String[] { String.valueOf(id) }) > 0; } public static Group restoreGroupById(ContentResolver cr, long groupId) { Uri uri = ContentUris.withAppendedId(LocalGroups.CONTENT_URI, groupId); Cursor c = null; try { c = cr.query(uri, null, null, null, null); if (c != null && c.moveToNext()) return restoreGroup(c); } finally { if (c != null) c.close(); } return null; } } } core/vendor-jars.mk 0 → 100644 +14 −0 Original line number Diff line number Diff line # This file contains list of vendor framework jars # Make sure this file inclusion is added after # LOCAL_JAVA_LIBRARIES defined in your module # Add vendor jars here VENDOR_FRAMEWORKS_CORE_JARS := \ org.codeaurora.Performance #Update the LOCAL_JAVA_LIBRARIES ifneq ($(strip $(VENDOR_FRAMEWORKS_CORE_JARS)),) LOCAL_JAVA_LIBRARIES += $(VENDOR_FRAMEWORKS_CORE_JARS) endif Loading
core/java/android/net/http/AndroidHttpClient.java +5 −0 Original line number Diff line number Diff line Loading @@ -254,6 +254,11 @@ public final class AndroidHttpClient implements HttpClient { private boolean isMmsRequest() { if(delegate.getParams() == null || delegate.getParams().getParameter(CoreProtocolPNames.USER_AGENT) == null) { return false; } if(delegate.getParams().getParameter(CoreProtocolPNames.USER_AGENT).toString().contains("Android-Mms")) return true; Loading
core/java/android/provider/CallLog.java +31 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.provider.ContactsContract.DataUsageFeedback; import android.text.TextUtils; import com.android.internal.telephony.CallerInfo; import com.android.internal.telephony.MSimConstants; import com.android.internal.telephony.PhoneConstants; /** Loading Loading @@ -286,6 +287,13 @@ public class CallLog { */ public static final String CACHED_FORMATTED_NUMBER = "formatted_number"; /** * The subscription id. * <P>Type: Integer</P> * @hide */ public static final String SUBSCRIPTION = MSimConstants.SUBSCRIPTION_KEY; /** * Adds a call to the call log. * Loading @@ -304,6 +312,28 @@ public class CallLog { */ public static Uri addCall(CallerInfo ci, Context context, String number, int presentation, int callType, long start, int duration) { return addCall(ci, context, number, presentation, callType, start, duration, MSimConstants.DEFAULT_SUBSCRIPTION); } /** * Add a call to the call log for multi sim, and it can be used in TSTS. * * @param ci the CallerInfo object to get the target contact from. Can be null * if the contact is unknown. * @param context the context used to get the ContentResolver * @param number the phone number to be added to the calls db * @param presentation the number presenting rules set by the network for * "allowed", "payphone", "restricted" or "unknown" * @param callType enumerated values for "incoming", "outgoing", or "missed" * @param start time stamp for the call in milliseconds * @param duration call duration in seconds * @param subscription valid value is 0,1 or 2 * * {@hide} */ public static Uri addCall(CallerInfo ci, Context context, String number, int presentation, int callType, long start, int duration, int subscription) { final ContentResolver resolver = context.getContentResolver(); int numberPresentation = PRESENTATION_ALLOWED; Loading Loading @@ -335,6 +365,7 @@ public class CallLog { values.put(DATE, Long.valueOf(start)); values.put(DURATION, Long.valueOf(duration)); values.put(NEW, Integer.valueOf(1)); values.put(SUBSCRIPTION, Integer.valueOf(subscription)); if (callType == MISSED_TYPE) { values.put(IS_READ, Integer.valueOf(0)); } Loading
core/java/android/provider/ContactsContract.java +25 −0 Original line number Diff line number Diff line Loading @@ -5172,6 +5172,31 @@ public final class ContactsContract { public static final String LABEL = DataColumns.DATA3; } /** @hide */ public static final class LocalGroup implements DataColumnsWithJoins { /** @hide */ private LocalGroup() { } /** @hide */ public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/local-groups"; /** @hide */ public static final String GROUP = DATA1; /** @hide */ public static final Uri CONTENT_URI = Uri.withAppendedPath(Data.CONTENT_URI, "local-groups"); /** @hide */ public static final Uri CONTENT_LOOKUP_URI = Uri .withAppendedPath(CONTENT_URI, "lookup"); /** @hide */ public static final Uri CONTENT_FILTER_URI = Uri .withAppendedPath(CONTENT_URI, "filter"); } /** * A data kind representing the contact's proper name. You can use all * columns defined for {@link ContactsContract.Data} as well as the following aliases. Loading
core/java/android/provider/LocalGroups.java 0 → 100644 +155 −0 Original line number Diff line number Diff line /* * Copyright (C) 2013, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of The Linux Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package android.provider; import android.content.ContentResolver; import android.content.ContentUris; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds; import android.provider.ContactsContract.Data; /** * @hide */ public class LocalGroups { public static final String AUTHORITY = "com.android.contacts.groups"; public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY); public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "local-groups"); public static interface GroupColumns { public static final String _ID = "_id"; public static final String TITLE = "title"; public static final String COUNT = "count"; } public static class Group { private long id = -1; private String title = ""; private int count; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getCount() { return count; } public void setCount(int count) { this.count = count; } public static Group restoreGroup(Cursor cursor) { if (cursor == null && cursor.getCount() == 0) { return null; } Group group = new Group(); group.setId(cursor.getLong(cursor.getColumnIndex(GroupColumns._ID))); group.setTitle(cursor.getString(cursor.getColumnIndex(GroupColumns.TITLE))); group.setCount(cursor.getInt(cursor.getColumnIndex(GroupColumns.COUNT))); return group; } public ContentValues toContentValues() { ContentValues values = new ContentValues(); values.put(GroupColumns.TITLE, getTitle()); values.put(GroupColumns.COUNT, getCount()); return values; } public boolean save(ContentResolver cr) { if (cr == null) { return false; } Uri uri = cr.insert(CONTENT_URI, toContentValues()); if (uri != null) { setId(ContentUris.parseId(uri)); return true; } else { return false; } } public boolean update(ContentResolver cr) { if (cr == null) { return false; } return cr.update(CONTENT_URI, toContentValues(), GroupColumns._ID + "=?", new String[] { String.valueOf(id) }) > 0; } public boolean delete(ContentResolver cr) { cr.delete(Data.CONTENT_URI, Data.MIMETYPE + "=? and " + CommonDataKinds.LocalGroup.DATA1 + "=?", new String[] { CommonDataKinds.LocalGroup.CONTENT_ITEM_TYPE, String.valueOf(getId()) }); return cr.delete(CONTENT_URI, GroupColumns._ID + "=?", new String[] { String.valueOf(id) }) > 0; } public static Group restoreGroupById(ContentResolver cr, long groupId) { Uri uri = ContentUris.withAppendedId(LocalGroups.CONTENT_URI, groupId); Cursor c = null; try { c = cr.query(uri, null, null, null, null); if (c != null && c.moveToNext()) return restoreGroup(c); } finally { if (c != null) c.close(); } return null; } } }
core/vendor-jars.mk 0 → 100644 +14 −0 Original line number Diff line number Diff line # This file contains list of vendor framework jars # Make sure this file inclusion is added after # LOCAL_JAVA_LIBRARIES defined in your module # Add vendor jars here VENDOR_FRAMEWORKS_CORE_JARS := \ org.codeaurora.Performance #Update the LOCAL_JAVA_LIBRARIES ifneq ($(strip $(VENDOR_FRAMEWORKS_CORE_JARS)),) LOCAL_JAVA_LIBRARIES += $(VENDOR_FRAMEWORKS_CORE_JARS) endif