merge from open-source master
Change-Id: If72ad6758c9e1bf77c38c4afec6b00ec9d5b89e4
This commit is contained in:
@@ -1988,15 +1988,19 @@ public class InputMethodService extends AbstractInputMethodService {
|
||||
ei.inputType != InputType.TYPE_NULL);
|
||||
if (hasAction) {
|
||||
mExtractAccessories.setVisibility(View.VISIBLE);
|
||||
if (ei.actionLabel != null) {
|
||||
mExtractAction.setText(ei.actionLabel);
|
||||
} else {
|
||||
mExtractAction.setText(getTextForImeAction(ei.imeOptions));
|
||||
if (mExtractAction != null) {
|
||||
if (ei.actionLabel != null) {
|
||||
mExtractAction.setText(ei.actionLabel);
|
||||
} else {
|
||||
mExtractAction.setText(getTextForImeAction(ei.imeOptions));
|
||||
}
|
||||
mExtractAction.setOnClickListener(mActionClickListener);
|
||||
}
|
||||
mExtractAction.setOnClickListener(mActionClickListener);
|
||||
} else {
|
||||
mExtractAccessories.setVisibility(View.GONE);
|
||||
mExtractAction.setOnClickListener(null);
|
||||
if (mExtractAction != null) {
|
||||
mExtractAction.setOnClickListener(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ public class ContentType {
|
||||
public static final String MMS_GENERIC = "application/vnd.wap.mms-generic";
|
||||
public static final String MULTIPART_MIXED = "application/vnd.wap.multipart.mixed";
|
||||
public static final String MULTIPART_RELATED = "application/vnd.wap.multipart.related";
|
||||
public static final String MULTIPART_ALTERNATIVE = "application/vnd.wap.multipart.alternative";
|
||||
|
||||
public static final String TEXT_PLAIN = "text/plain";
|
||||
public static final String TEXT_HTML = "text/html";
|
||||
|
||||
@@ -200,7 +200,18 @@ public class PduParser {
|
||||
PduHeaders headers = new PduHeaders();
|
||||
|
||||
while (keepParsing && (pduDataStream.available() > 0)) {
|
||||
pduDataStream.mark(1);
|
||||
int headerField = extractByteValue(pduDataStream);
|
||||
/* parse custom text header */
|
||||
if ((headerField >= TEXT_MIN) && (headerField <= TEXT_MAX)) {
|
||||
pduDataStream.reset();
|
||||
byte [] bVal = parseWapString(pduDataStream, TYPE_TEXT_STRING);
|
||||
if (LOCAL_LOGV) {
|
||||
Log.v(LOG_TAG, "TextHeader: " + new String(bVal));
|
||||
}
|
||||
/* we should ignore it at the moment */
|
||||
continue;
|
||||
}
|
||||
switch (headerField) {
|
||||
case PduHeaders.MESSAGE_TYPE:
|
||||
{
|
||||
@@ -778,26 +789,34 @@ public class PduParser {
|
||||
/* get part's data */
|
||||
if (dataLength > 0) {
|
||||
byte[] partData = new byte[dataLength];
|
||||
String partContentType = new String(part.getContentType());
|
||||
pduDataStream.read(partData, 0, dataLength);
|
||||
// Check Content-Transfer-Encoding.
|
||||
byte[] partDataEncoding = part.getContentTransferEncoding();
|
||||
if (null != partDataEncoding) {
|
||||
String encoding = new String(partDataEncoding);
|
||||
if (encoding.equalsIgnoreCase(PduPart.P_BASE64)) {
|
||||
// Decode "base64" into "binary".
|
||||
partData = Base64.decodeBase64(partData);
|
||||
} else if (encoding.equalsIgnoreCase(PduPart.P_QUOTED_PRINTABLE)) {
|
||||
// Decode "quoted-printable" into "binary".
|
||||
partData = QuotedPrintable.decodeQuotedPrintable(partData);
|
||||
} else {
|
||||
// "binary" is the default encoding.
|
||||
if (partContentType.equalsIgnoreCase(ContentType.MULTIPART_ALTERNATIVE)) {
|
||||
// parse "multipart/vnd.wap.multipart.alternative".
|
||||
PduBody childBody = parseParts(new ByteArrayInputStream(partData));
|
||||
// take the first part of children.
|
||||
part = childBody.getPart(0);
|
||||
} else {
|
||||
// Check Content-Transfer-Encoding.
|
||||
byte[] partDataEncoding = part.getContentTransferEncoding();
|
||||
if (null != partDataEncoding) {
|
||||
String encoding = new String(partDataEncoding);
|
||||
if (encoding.equalsIgnoreCase(PduPart.P_BASE64)) {
|
||||
// Decode "base64" into "binary".
|
||||
partData = Base64.decodeBase64(partData);
|
||||
} else if (encoding.equalsIgnoreCase(PduPart.P_QUOTED_PRINTABLE)) {
|
||||
// Decode "quoted-printable" into "binary".
|
||||
partData = QuotedPrintable.decodeQuotedPrintable(partData);
|
||||
} else {
|
||||
// "binary" is the default encoding.
|
||||
}
|
||||
}
|
||||
if (null == partData) {
|
||||
log("Decode part data error!");
|
||||
return null;
|
||||
}
|
||||
part.setData(partData);
|
||||
}
|
||||
if (null == partData) {
|
||||
log("Decode part data error!");
|
||||
return null;
|
||||
}
|
||||
part.setData(partData);
|
||||
}
|
||||
|
||||
/* add this part to body */
|
||||
|
||||
@@ -2363,7 +2363,7 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
&& (p.applicationInfo.flags&ApplicationInfo.FLAG_PERSISTENT) != 0
|
||||
&& (!mSafeMode || (p.applicationInfo.flags
|
||||
&ApplicationInfo.FLAG_SYSTEM) != 0)) {
|
||||
finalList.add(p.applicationInfo);
|
||||
finalList.add(PackageParser.generateApplicationInfo(p, flags));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user