Merge "Split out emailcommon/Android.mk"
This commit is contained in:
commit
39919cb5e0
21
Android.mk
21
Android.mk
|
@ -43,27 +43,6 @@ include $(BUILD_PACKAGE)
|
|||
|
||||
# only include rules to build other stuff for the original package, not derived package.
|
||||
ifeq ($(strip $(LOCAL_PACKAGE_OVERRIDES)),)
|
||||
|
||||
# Build the com.android.emailcommon static library. At the moment, this includes
|
||||
# the emailcommon files themselves plus everything under src/org (apache code). All of our
|
||||
# AIDL files are also compiled into the static library
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := com.android.emailcommon
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/emailcommon)
|
||||
LOCAL_SRC_FILES += $(call all-java-files-under, src/org)
|
||||
LOCAL_SRC_FILES += \
|
||||
src/com/android/emailcommon/service/IEmailService.aidl \
|
||||
src/com/android/emailcommon/service/IEmailServiceCallback.aidl \
|
||||
src/com/android/emailcommon/service/IPolicyService.aidl \
|
||||
src/com/android/emailcommon/service/IAccountService.aidl
|
||||
|
||||
LOCAL_SDK_VERSION := current
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
||||
|
||||
# additionally, build unit tests in a separate .apk
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
|
||||
endif
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# Copyright 2011, 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.
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# Build the com.android.emailcommon static library. At the moment, this includes
|
||||
# the emailcommon files themselves plus everything under src/org (apache code). All of our
|
||||
# AIDL files are also compiled into the static library
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := com.android.emailcommon
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/emailcommon)
|
||||
LOCAL_SRC_FILES += $(call all-java-files-under, src/org)
|
||||
LOCAL_SRC_FILES += \
|
||||
src/com/android/emailcommon/service/IEmailServiceCallback.aidl \
|
||||
src/com/android/emailcommon/service/IEmailService.aidl \
|
||||
src/com/android/emailcommon/service/IPolicyService.aidl \
|
||||
src/com/android/emailcommon/service/IAccountService.aidl
|
||||
|
||||
LOCAL_SDK_VERSION := current
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
|
@ -62,7 +62,7 @@ public class Rfc822Output {
|
|||
Attachment.FLAG_SMART_FORWARD + ")=0";
|
||||
|
||||
/*package*/ static String buildBodyText(Context context, Message message,
|
||||
boolean useSmartReply) {
|
||||
boolean appendQuotedText) {
|
||||
Body body = Body.restoreBodyWithMessageId(context, message.mId);
|
||||
if (body == null) {
|
||||
return null;
|
||||
|
@ -77,8 +77,8 @@ public class Rfc822Output {
|
|||
String intro = body.mIntroText == null ? "" : body.mIntroText;
|
||||
text += intro;
|
||||
}
|
||||
if (useSmartReply) {
|
||||
// useSmartReply is set to true for use by SmartReply/SmartForward in EAS.
|
||||
if (!appendQuotedText) {
|
||||
// appendQuotedText is set to false for use by SmartReply/SmartForward in EAS.
|
||||
// SmartForward doesn't put a break between the original and new text, so we add an LF
|
||||
if (isForward) {
|
||||
text += "\n";
|
||||
|
@ -112,12 +112,12 @@ public class Rfc822Output {
|
|||
* @param context system context for accessing the provider
|
||||
* @param messageId the message to write out
|
||||
* @param out the output stream to write the message to
|
||||
* @param useSmartReply whether or not quoted text is appended to a reply/forward
|
||||
* @param appendQuotedText whether or not to append quoted text if this is a reply/forward
|
||||
*
|
||||
* TODO alternative parts (e.g. text+html) are not supported here.
|
||||
*/
|
||||
public static void writeTo(Context context, long messageId, OutputStream out,
|
||||
boolean useSmartReply, boolean sendBcc) throws IOException, MessagingException {
|
||||
boolean appendQuotedText, boolean sendBcc) throws IOException, MessagingException {
|
||||
Message message = Message.restoreMessageWithId(context, messageId);
|
||||
if (message == null) {
|
||||
// throw something?
|
||||
|
@ -149,7 +149,7 @@ public class Rfc822Output {
|
|||
writeHeader(writer, "MIME-Version", "1.0");
|
||||
|
||||
// Analyze message and determine if we have multiparts
|
||||
String text = buildBodyText(context, message, useSmartReply);
|
||||
String text = buildBodyText(context, message, appendQuotedText);
|
||||
|
||||
Uri uri = ContentUris.withAppendedId(Attachment.MESSAGE_ID_URI, messageId);
|
||||
Cursor attachmentsCursor = context.getContentResolver().query(uri,
|
|
@ -2158,8 +2158,6 @@ public abstract class EmailContent {
|
|||
public static final String SERVER_ID = "serverId";
|
||||
// The server's identifier for the parent of this mailbox (null = top-level)
|
||||
public static final String PARENT_SERVER_ID = "parentServerId";
|
||||
// A foreign key for the parent of this mailbox (-1 = top-level, 0=uninitialized)
|
||||
public static final String PARENT_KEY = "parentKey";
|
||||
// A foreign key to the Account that owns this mailbox
|
||||
public static final String ACCOUNT_KEY = "accountKey";
|
||||
// The type (role) of this mailbox
|
||||
|
@ -2198,7 +2196,6 @@ public abstract class EmailContent {
|
|||
public String mDisplayName;
|
||||
public String mServerId;
|
||||
public String mParentServerId;
|
||||
public long mParentKey;
|
||||
public long mAccountKey;
|
||||
public int mType;
|
||||
public int mDelimiter;
|
||||
|
@ -2226,14 +2223,13 @@ public abstract class EmailContent {
|
|||
public static final int CONTENT_FLAGS_COLUMN = 12;
|
||||
public static final int CONTENT_VISIBLE_LIMIT_COLUMN = 13;
|
||||
public static final int CONTENT_SYNC_STATUS_COLUMN = 14;
|
||||
public static final int CONTENT_PARENT_KEY_COLUMN = 15;
|
||||
public static final String[] CONTENT_PROJECTION = new String[] {
|
||||
RECORD_ID, MailboxColumns.DISPLAY_NAME, MailboxColumns.SERVER_ID,
|
||||
MailboxColumns.PARENT_SERVER_ID, MailboxColumns.ACCOUNT_KEY, MailboxColumns.TYPE,
|
||||
MailboxColumns.DELIMITER, MailboxColumns.SYNC_KEY, MailboxColumns.SYNC_LOOKBACK,
|
||||
MailboxColumns.SYNC_INTERVAL, MailboxColumns.SYNC_TIME,
|
||||
MailboxColumns.FLAG_VISIBLE, MailboxColumns.FLAGS, MailboxColumns.VISIBLE_LIMIT,
|
||||
MailboxColumns.SYNC_STATUS, MailboxColumns.PARENT_KEY
|
||||
MailboxColumns.SYNC_STATUS
|
||||
};
|
||||
|
||||
private static final String ACCOUNT_AND_MAILBOX_TYPE_SELECTION =
|
||||
|
@ -2365,7 +2361,6 @@ public abstract class EmailContent {
|
|||
mDisplayName = cursor.getString(CONTENT_DISPLAY_NAME_COLUMN);
|
||||
mServerId = cursor.getString(CONTENT_SERVER_ID_COLUMN);
|
||||
mParentServerId = cursor.getString(CONTENT_PARENT_SERVER_ID_COLUMN);
|
||||
mParentKey = cursor.getLong(CONTENT_PARENT_KEY_COLUMN);
|
||||
mAccountKey = cursor.getLong(CONTENT_ACCOUNT_KEY_COLUMN);
|
||||
mType = cursor.getInt(CONTENT_TYPE_COLUMN);
|
||||
mDelimiter = cursor.getInt(CONTENT_DELIMITER_COLUMN);
|
||||
|
@ -2385,7 +2380,6 @@ public abstract class EmailContent {
|
|||
values.put(MailboxColumns.DISPLAY_NAME, mDisplayName);
|
||||
values.put(MailboxColumns.SERVER_ID, mServerId);
|
||||
values.put(MailboxColumns.PARENT_SERVER_ID, mParentServerId);
|
||||
values.put(MailboxColumns.PARENT_KEY, mParentKey);
|
||||
values.put(MailboxColumns.ACCOUNT_KEY, mAccountKey);
|
||||
values.put(MailboxColumns.TYPE, mType);
|
||||
values.put(MailboxColumns.DELIMITER, mDelimiter);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue