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);
|
ei.inputType != InputType.TYPE_NULL);
|
||||||
if (hasAction) {
|
if (hasAction) {
|
||||||
mExtractAccessories.setVisibility(View.VISIBLE);
|
mExtractAccessories.setVisibility(View.VISIBLE);
|
||||||
if (ei.actionLabel != null) {
|
if (mExtractAction != null) {
|
||||||
mExtractAction.setText(ei.actionLabel);
|
if (ei.actionLabel != null) {
|
||||||
} else {
|
mExtractAction.setText(ei.actionLabel);
|
||||||
mExtractAction.setText(getTextForImeAction(ei.imeOptions));
|
} else {
|
||||||
|
mExtractAction.setText(getTextForImeAction(ei.imeOptions));
|
||||||
|
}
|
||||||
|
mExtractAction.setOnClickListener(mActionClickListener);
|
||||||
}
|
}
|
||||||
mExtractAction.setOnClickListener(mActionClickListener);
|
|
||||||
} else {
|
} else {
|
||||||
mExtractAccessories.setVisibility(View.GONE);
|
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 MMS_GENERIC = "application/vnd.wap.mms-generic";
|
||||||
public static final String MULTIPART_MIXED = "application/vnd.wap.multipart.mixed";
|
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_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_PLAIN = "text/plain";
|
||||||
public static final String TEXT_HTML = "text/html";
|
public static final String TEXT_HTML = "text/html";
|
||||||
|
|||||||
@@ -200,7 +200,18 @@ public class PduParser {
|
|||||||
PduHeaders headers = new PduHeaders();
|
PduHeaders headers = new PduHeaders();
|
||||||
|
|
||||||
while (keepParsing && (pduDataStream.available() > 0)) {
|
while (keepParsing && (pduDataStream.available() > 0)) {
|
||||||
|
pduDataStream.mark(1);
|
||||||
int headerField = extractByteValue(pduDataStream);
|
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) {
|
switch (headerField) {
|
||||||
case PduHeaders.MESSAGE_TYPE:
|
case PduHeaders.MESSAGE_TYPE:
|
||||||
{
|
{
|
||||||
@@ -778,26 +789,34 @@ public class PduParser {
|
|||||||
/* get part's data */
|
/* get part's data */
|
||||||
if (dataLength > 0) {
|
if (dataLength > 0) {
|
||||||
byte[] partData = new byte[dataLength];
|
byte[] partData = new byte[dataLength];
|
||||||
|
String partContentType = new String(part.getContentType());
|
||||||
pduDataStream.read(partData, 0, dataLength);
|
pduDataStream.read(partData, 0, dataLength);
|
||||||
// Check Content-Transfer-Encoding.
|
if (partContentType.equalsIgnoreCase(ContentType.MULTIPART_ALTERNATIVE)) {
|
||||||
byte[] partDataEncoding = part.getContentTransferEncoding();
|
// parse "multipart/vnd.wap.multipart.alternative".
|
||||||
if (null != partDataEncoding) {
|
PduBody childBody = parseParts(new ByteArrayInputStream(partData));
|
||||||
String encoding = new String(partDataEncoding);
|
// take the first part of children.
|
||||||
if (encoding.equalsIgnoreCase(PduPart.P_BASE64)) {
|
part = childBody.getPart(0);
|
||||||
// Decode "base64" into "binary".
|
} else {
|
||||||
partData = Base64.decodeBase64(partData);
|
// Check Content-Transfer-Encoding.
|
||||||
} else if (encoding.equalsIgnoreCase(PduPart.P_QUOTED_PRINTABLE)) {
|
byte[] partDataEncoding = part.getContentTransferEncoding();
|
||||||
// Decode "quoted-printable" into "binary".
|
if (null != partDataEncoding) {
|
||||||
partData = QuotedPrintable.decodeQuotedPrintable(partData);
|
String encoding = new String(partDataEncoding);
|
||||||
} else {
|
if (encoding.equalsIgnoreCase(PduPart.P_BASE64)) {
|
||||||
// "binary" is the default encoding.
|
// 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 */
|
/* add this part to body */
|
||||||
|
|||||||
@@ -2363,7 +2363,7 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
&& (p.applicationInfo.flags&ApplicationInfo.FLAG_PERSISTENT) != 0
|
&& (p.applicationInfo.flags&ApplicationInfo.FLAG_PERSISTENT) != 0
|
||||||
&& (!mSafeMode || (p.applicationInfo.flags
|
&& (!mSafeMode || (p.applicationInfo.flags
|
||||||
&ApplicationInfo.FLAG_SYSTEM) != 0)) {
|
&ApplicationInfo.FLAG_SYSTEM) != 0)) {
|
||||||
finalList.add(p.applicationInfo);
|
finalList.add(PackageParser.generateApplicationInfo(p, flags));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user