update new sdk
This commit is contained in:
parent
f33907443a
commit
744c72c133
1643 changed files with 83006 additions and 28021 deletions
5
android/frameworks/opt/net/lowpan/.gitattributes
vendored
Executable file
5
android/frameworks/opt/net/lowpan/.gitattributes
vendored
Executable file
|
@ -0,0 +1,5 @@
|
|||
*.java text whitespace=trailing-space,tab-in-indent,tabwidth=4,blank-at-eol,blank-at-eof
|
||||
*.cpp text whitespace=trailing-space,tab-in-indent,tabwidth=4,blank-at-eol,blank-at-eof
|
||||
*.h text whitespace=trailing-space,tab-in-indent,tabwidth=4,blank-at-eol,blank-at-eof
|
||||
*.aidl text whitespace=trailing-space,tab-in-indent,tabwidth=4,blank-at-eol,blank-at-eof
|
||||
*.xml text whitespace=trailing-space,tab-in-indent,tabwidth=4,blank-at-eol,blank-at-eof
|
|
@ -103,7 +103,7 @@ int wifi_change_driver_state(const char *state) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int is_wifi_driver_loaded(const char* wifi_driver_name) {
|
||||
int is_wifi_driver_loaded(const char *wifi_driver_module_name) {
|
||||
char driver_status[PROPERTY_VALUE_MAX];
|
||||
#ifdef WIFI_DRIVER_MODULE_PATH
|
||||
FILE *proc;
|
||||
|
@ -127,7 +127,7 @@ int is_wifi_driver_loaded(const char* wifi_driver_name) {
|
|||
return 0;
|
||||
}
|
||||
while ((fgets(line, sizeof(line), proc)) != NULL) {
|
||||
if (strncmp(line, wifi_driver_name, strlen(wifi_driver_name)) == 0) {
|
||||
if (strncmp(line, wifi_driver_module_name, strlen(wifi_driver_module_name)) == 0) {
|
||||
fclose(proc);
|
||||
return 1;
|
||||
}
|
||||
|
@ -145,7 +145,8 @@ int wifi_load_driver(int mode) {
|
|||
char module_path[128] = {0};
|
||||
char module_arg[128] = {0};
|
||||
const char *wifi_driver_name = get_wifi_driver_name();
|
||||
if (is_wifi_driver_loaded(wifi_driver_name)) {
|
||||
const char *wifi_driver_module_name = get_wifi_driver_module_name();
|
||||
if (is_wifi_driver_loaded(wifi_driver_module_name)) {
|
||||
return 0;
|
||||
}
|
||||
LOG(ERROR) << "wifi_load_driver: Start to insmod " << wifi_driver_name << ".ko";
|
||||
|
@ -171,7 +172,7 @@ int wifi_load_driver(int mode) {
|
|||
if (!fp) {
|
||||
LOG(INFO) << "Failed to fopen file: /proc/net/dev";
|
||||
property_set(DRIVER_PROP_NAME, "failed");
|
||||
rmmod(wifi_driver_name);
|
||||
rmmod(wifi_driver_module_name);
|
||||
return -1;
|
||||
}
|
||||
fread(tmp_buf, sizeof(tmp_buf), 1, fp);
|
||||
|
@ -187,13 +188,13 @@ int wifi_load_driver(int mode) {
|
|||
|
||||
LOG(INFO) << "Timeout, register net device wlan0 failed.";
|
||||
property_set(DRIVER_PROP_NAME, "timeout");
|
||||
rmmod(wifi_driver_name);
|
||||
rmmod(wifi_driver_module_name);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
Success:
|
||||
#ifdef WIFI_DRIVER_STATE_CTRL_PARAM
|
||||
if (is_wifi_driver_loaded(wifi_driver_name)) {
|
||||
if (is_wifi_driver_loaded(wifi_driver_module_name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -204,16 +205,16 @@ Success:
|
|||
}
|
||||
|
||||
int wifi_unload_driver() {
|
||||
const char* wifi_driver_name = get_wifi_driver_name();
|
||||
if (!is_wifi_driver_loaded(wifi_driver_name)) {
|
||||
const char* wifi_driver_module_name = get_wifi_driver_module_name();
|
||||
if (!is_wifi_driver_loaded(wifi_driver_module_name)) {
|
||||
return 0;
|
||||
}
|
||||
usleep(200000); /* allow to finish interface down */
|
||||
#ifdef WIFI_DRIVER_MODULE_PATH
|
||||
if (rmmod(wifi_driver_name) == 0) {
|
||||
if (rmmod(wifi_driver_module_name) == 0) {
|
||||
int count = 20; /* wait at most 10 seconds for completion */
|
||||
while (count-- > 0) {
|
||||
if (!is_wifi_driver_loaded(wifi_driver_name)) break;
|
||||
if (!is_wifi_driver_loaded(wifi_driver_module_name)) break;
|
||||
usleep(500000);
|
||||
}
|
||||
usleep(500000); /* allow card removal */
|
||||
|
@ -225,7 +226,7 @@ int wifi_unload_driver() {
|
|||
return -1;
|
||||
#else
|
||||
#ifdef WIFI_DRIVER_STATE_CTRL_PARAM
|
||||
if (is_wifi_driver_loaded(wifi_driver_name)) {
|
||||
if (is_wifi_driver_loaded(wifi_driver_module_name)) {
|
||||
if (wifi_change_driver_state(WIFI_DRIVER_STATE_OFF) < 0) return -1;
|
||||
}
|
||||
#endif
|
||||
|
|
29
android/frameworks/opt/telephony/src/java/com/android/internal/telephony/InboundSmsHandler.java
Normal file → Executable file
29
android/frameworks/opt/telephony/src/java/com/android/internal/telephony/InboundSmsHandler.java
Normal file → Executable file
|
@ -74,6 +74,7 @@ import java.util.Arrays;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import android.util.EventLog;
|
||||
|
||||
/**
|
||||
* This class broadcasts incoming SMS messages to interested apps after storing them in
|
||||
|
@ -803,6 +804,19 @@ public abstract class InboundSmsHandler extends StateMachine {
|
|||
int destPort = tracker.getDestPort();
|
||||
boolean block = false;
|
||||
|
||||
// Do not process when the message count is invalid.
|
||||
if (messageCount <= 0) {
|
||||
EventLog.writeEvent(
|
||||
0x534e4554 /* snetTagId */,
|
||||
"72298611" /* buganizer id */,
|
||||
-1 /* uid */,
|
||||
String.format(
|
||||
"processMessagePart: invalid messageCount = %d",
|
||||
messageCount));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (messageCount == 1) {
|
||||
// single-part message
|
||||
pdus = new byte[][]{tracker.getPdu()};
|
||||
|
@ -838,6 +852,21 @@ public abstract class InboundSmsHandler extends StateMachine {
|
|||
int index = cursor.getInt(PDU_SEQUENCE_PORT_PROJECTION_INDEX_MAPPING
|
||||
.get(SEQUENCE_COLUMN)) - tracker.getIndexOffset();
|
||||
|
||||
// The invalid PDUs can be received and stored in the raw table. The range
|
||||
// check ensures the process not crash even if the seqNumber in the
|
||||
// UserDataHeader is invalid.
|
||||
if (index >= pdus.length || index < 0) {
|
||||
EventLog.writeEvent(
|
||||
0x534e4554 /* snetTagId */,
|
||||
"72298611" /* buganizer id */,
|
||||
-1 /* uid */,
|
||||
String.format(
|
||||
"processMessagePart: invalid seqNumber = %d, messageCount = %d",
|
||||
index + tracker.getIndexOffset(),
|
||||
messageCount));
|
||||
continue;
|
||||
}
|
||||
|
||||
pdus[index] = HexDump.hexStringToByteArray(cursor.getString(
|
||||
PDU_SEQUENCE_PORT_PROJECTION_INDEX_MAPPING.get(PDU_COLUMN)));
|
||||
|
||||
|
|
5
android/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/mocks/ConnectivityServiceMock.java
Normal file → Executable file
5
android/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/mocks/ConnectivityServiceMock.java
Normal file → Executable file
|
@ -499,6 +499,11 @@ public class ConnectivityServiceMock extends IConnectivityManager.Stub
|
|||
throw new RuntimeException("not implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActiveNetworkMeteredForUid(int uid) {
|
||||
throw new RuntimeException("not implemented");
|
||||
}
|
||||
|
||||
public boolean requestRouteToHostAddress(int networkType, byte[] hostAddress) {
|
||||
throw new RuntimeException("not implemented");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue