bc9/Software/Android/Android-1.5r3
[
Front page
] [
New
|
List of pages
|
Search
|
Recent changes
]
Start:
[[bc9]]
-Contents
#Contents
* android-1.5r3 for bc9 (bc9-android-sdk-release20090815 ...
>
Checkout '''android-1.5r3''' and modify it.
-android-1.5r3 is a tag branch, which is created right af...
-android-1.5r3 is a tag brach, which is put fort cupcake-...
-The kernel source of android-1.5r3 is excluded from repo...
* Get Source [#k37bd4ac]
** android-1.5r3 branch [#wf45f630]
>
Following the instructions below, obtain source code of ...
$ mkdir ~/android-1.5r3
$ cd android-1.5r3
$ repo init -u git://android.git.kernel.org/platform/man...
$ repo sync
** ALSA [#v68316f0]
>
android-1.5r3 branch is a tag branch of the cupcake-relea...
cupcake-release branch. Since this is not the master brac...
information of ALSA in local_manifest.xml and ordering re...
these files at the source tree of android-1.5r3. Then, bu...
is committed later then August 2009. '''alsa_sound''' use...
ALSA is shown below.~
$ cd ~android-1.5r3/external
$ git clone git://android.git.kernel.org/platform/extern...
$ cd alsa-lib
$ git checkout 7d7fc0e
$ cd ~android-1.5r3/hardware
$ git clone git://android.git.kernel.org/hardware/alsa_s...
$ cd alsa_sound
$ git checkout a5cf8cc
* Adjust the Contents of build [#sc688863]
** Adjust alsa-lib [#d070a516]
>
Modify '''android-1.5r3/external/alsa-lib/Android.mk'''. ...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u external/a...
--- external/alsa-lib/Android.mk.orig 2009-08-30 15:00:5...
+++ external/alsa-lib/Android.mk 2009-08-30 15:01:13.000...
@@ -55,7 +55,7 @@
-fPIC -DPIC -D_POSIX_SOURCE \
-DALSA_CONFIG_DIR=\"/system/usr/share/alsa\" \
-DALSA_PLUGIN_DIR=\"/system/usr/lib/alsa-lib\" \
- -DALSA_DEVICE_DIRECTORY=\"/dev/snd/\"
+ -DALSA_DEVICE_DIRECTORY=\"/dev/\"
LOCAL_SRC_FILES := $(sort $(call all-c-files-under, src))
** Patch for power management [#fa42dac3]
>
Please apply the patch listed below before build the file...
as low level battery.
- dummy-battery.patch
>&ref(dummy-battery.patch);
>
$ cd android-sdk-1.5_r3
$ patch -b -p1 < ../dummy-battery.patch
** Adjust Wi-Fi [#pc5f1edd]
*** Modify wpa_supplicant [#wdcd7bd2]
>
Change '''android-1.5r3/external/wpa_supplicant/.config''...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u external/w...
--- external/wpa_supplicant/.config.orig 2009-08-31 20:3...
+++ external/wpa_supplicant/.config 2009-08-31 20:33:50....
@@ -19,13 +19,13 @@
CONFIG_PKCS12=y
# CONFIG_PCSC=y
CONFIG_SMARTCARD=y
-# CONFIG_WIRELESS_EXTENSION=y
+CONFIG_WIRELESS_EXTENSION=y
CONFIG_CTRL_IFACE=y
# CONFIG_DRIVER_HOSTAP=y
# CONFIG_DRIVER_HERMES=y
# CONFIG_DRIVER_MADWIFI=y
# CONFIG_DRIVER_ATMEL=y
-# CONFIG_DRIVER_WEXT=y
+CONFIG_DRIVER_WEXT=y
# CONFIG_DRIVER_NDISWRAPPER=y
# CONFIG_DRIVER_BROADCOM=y
# CONFIG_DRIVER_IPW=y
Alter '''android-1.5r3/external/wpa_supplicant/wpa_suppli...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u external/w...
--- external/wpa_supplicant/wpa_supplicant.conf.orig 200...
+++ external/wpa_supplicant/wpa_supplicant.conf 2009-08-...
@@ -72,7 +72,9 @@
# DACL (which will reject all connections). See README-...
# information about SDDL string format.
#
-ctrl_interface=tiwlan0
+#ctrl_interface=tiwlan0
+#ctrl_interface=wlan0
+ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=sy...
# IEEE 802.1X/EAPOL version
# wpa_supplicant is implemented based on IEEE Std 802.1...
*** Change wifi.c [#f74e9ef5]
>
As changing '''android-1.5r3/hardware/libhardware_legacy/...
accessible from Android's GUI. To check progress of the ...
necessary, please adjust the amount of log-outs by commen...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u hardware/l...
--- hardware/libhardware_legacy/wifi/wifi.c.orig ...
+++ hardware/libhardware_legacy/wifi/wifi.c 2009-08-...
@@ -48,17 +48,23 @@
// TODO: use new ANDROID_SOCKET mechanism, once support...
// sockets is in
-static const char IFACE_DIR[] = "/data/system...
-static const char DRIVER_MODULE_NAME[] = "wlan";
-static const char DRIVER_MODULE_TAG[] = "wlan ";
-static const char DRIVER_MODULE_PATH[] = "/system/lib/...
-static const char FIRMWARE_LOADER[] = "wlan_loader";
-static const char DRIVER_PROP_NAME[] = "wlan.driver....
-static const char SUPPLICANT_NAME[] = "wpa_supplica...
-static const char SUPP_PROP_NAME[] = "init.svc.wpa...
-static const char SUPP_CONFIG_TEMPLATE[]= "/system/etc/...
-static const char SUPP_CONFIG_FILE[] = "/data/misc/w...
-static const char MODULE_FILE[] = "/proc/module...
+static const char IFACE_DIR[] ...
+static const char DRIVER_MODULE_NAME[] ...
+static const char DRIVER_MODULE_TAG[] ...
+static const char DRIVER_MODULE_PATH[] ...
+static const char RT2X00_LIB_DRIVER_MODULE_NAME[] ...
+static const char RT2X00_LIB_DRIVER_MODULE_TAG[] ...
+static const char RT2X00_LIB_DRIVER_MODULE_PATH[] ...
+static const char RT2X00_LIB_USB_DRIVER_MODULE_NAME[] ...
+static const char RT2X00_LIB_USB_DRIVER_MODULE_TAG[] ...
+static const char RT2X00_LIB_USB_DRIVER_MODULE_PATH[] ...
+static const char FIRMWARE_LOADER[] ...
+static const char DRIVER_PROP_NAME[] ...
+static const char SUPPLICANT_NAME[] ...
+static const char SUPP_PROP_NAME[] ...
+static const char SUPP_CONFIG_TEMPLATE[] ...
+static const char SUPP_CONFIG_FILE[] ...
+static const char MODULE_FILE[] ...
static int insmod(const char *filename)
{
@@ -66,6 +72,7 @@
unsigned int size;
int ret;
+ LOGI("%s\n", __FUNCTION__);
module = load_file(filename, &size);
if (!module)
return -1;
@@ -82,6 +89,7 @@
int ret = -1;
int maxtry = 10;
+ LOGI("%s\n", __FUNCTION__);
while (maxtry-- > 0) {
ret = delete_module(modname, O_NONBLOCK | O_EXC...
if (ret < 0 && errno == EAGAIN)
@@ -91,30 +99,35 @@
}
if (ret != 0)
- LOGD("Unable to unload driver module \"%s\": %s...
+ LOGE("Unable to unload driver module \"%s\": %s...
modname, strerror(errno));
return ret;
}
int do_dhcp_request(int *ipaddr, int *gateway, int *mask,
int *dns1, int *dns2, int *server, ...
+ LOGI("1. inside %s\n", __FUNCTION__);
/* For test driver, always report success */
- if (strcmp(iface, "sta") == 0)
+ if (strcmp(iface, "wlan0") == 0)
return 0;
+ LOGI("2. inside %s\n", __FUNCTION__);
if (ifc_init() < 0)
return -1;
+ LOGI("3. inside %s\n", __FUNCTION__);
if (do_dhcp(iface) < 0) {
ifc_close();
return -1;
}
ifc_close();
get_dhcp_info(ipaddr, gateway, mask, dns1, dns2, se...
+ LOGI("4. inside %s\n", __FUNCTION__);
return 0;
}
const char *get_dhcp_error_string() {
+ LOGI("Inside %s\n", __FUNCTION__);
return dhcp_lasterror();
}
@@ -140,10 +153,12 @@
}
while ((fgets(line, sizeof(line), proc)) != NULL) {
if (strncmp(line, DRIVER_MODULE_TAG, strlen(DRI...
+ LOGI("driver %s has been installed\n",DRIVE...
fclose(proc);
return 1;
}
}
+ LOGE("Cannot find driver %s in proc",DRIVER_MODULE_...
fclose(proc);
property_set(DRIVER_PROP_NAME, "unloaded");
return 0;
@@ -154,23 +169,31 @@
char driver_status[PROPERTY_VALUE_MAX];
int count = 100; /* wait at most 20 seconds for com...
+ LOGI("Loading WiFi Modules\n");
+ sleep(1);
+
+ property_set(DRIVER_PROP_NAME, "ok");
if (check_driver_loaded()) {
return 0;
}
-
- if (insmod(DRIVER_MODULE_PATH) < 0)
- return -1;
-
+ insmod(RT2X00_LIB_DRIVER_MODULE_PATH);
+ insmod(RT2X00_LIB_USB_DRIVER_MODULE_PATH);
+ insmod(DRIVER_MODULE_PATH);
property_set("ctl.start", FIRMWARE_LOADER);
sched_yield();
while (count-- > 0) {
+ usleep(500000);
if (property_get(DRIVER_PROP_NAME, driver_statu...
- if (strcmp(driver_status, "ok") == 0)
+ if (strcmp(driver_status, "ok") == 0) {
+ property_set("ctl.start", "ifcfg_ralink...
+ usleep(1000000);
+ //property_set("ctl.start", "dhcpcd");
return 0;
- else if (strcmp(DRIVER_PROP_NAME, "failed")...
+ }
+ else if (strcmp(DRIVER_PROP_NAME, "failed")...
return -1;
+ }
}
- usleep(200000);
}
property_set(DRIVER_PROP_NAME, "timeout");
return -1;
@@ -178,20 +201,30 @@
int wifi_unload_driver()
{
- int count = 20; /* wait at most 10 seconds for comp...
+ LOGI("Unloading WiFi Modules\n");
+ sleep(1);
if (rmmod(DRIVER_MODULE_NAME) == 0) {
- while (count-- > 0) {
- if (!check_driver_loaded())
- break;
- usleep(500000);
- }
- if (count) {
- return 0;
- }
- return -1;
- } else
+ usleep(1000000);
+ } else {
+ LOGE("Unloading Ralink RT73USB WLAN Module Fail...
+ return -1;
+ }
+
+ if (rmmod(RT2X00_LIB_USB_DRIVER_MODULE_NAME) == 0) {
+ usleep(1000000);
+ } else {
+ LOGE("Unloading RT2X00_LIB_USB Module Failed\n");
+ return -1;
+ }
+
+ if (rmmod(RT2X00_LIB_DRIVER_MODULE_NAME) == 0) {
+ usleep(1000000);
+ } else {
+ LOGE("Unloading RT2X00_LIB Module Failed\n");
return -1;
+ }
+ return 0;
}
int ensure_config_file_exists()
@@ -200,6 +233,7 @@
int srcfd, destfd;
int nread;
+ LOGE("%s\n", __FUNCTION__);
if (access(SUPP_CONFIG_FILE, R_OK|W_OK) == 0) {
return 0;
} else if (errno != ENOENT) {
@@ -252,6 +286,7 @@
unsigned serial = 0;
#endif
+ LOGI("start %s",__FUNCTION__);
/* Check whether already running */
if (property_get(SUPP_PROP_NAME, supp_status, NULL)
&& strcmp(supp_status, "running") == 0) {
@@ -260,7 +295,7 @@
/* Before starting the daemon, make sure its config...
if (ensure_config_file_exists() < 0) {
- LOGE("Wi-Fi will not be enabled");
+ LOGE("Configuration file does not exist. Wi-Fi ...
return -1;
}
@@ -291,9 +326,11 @@
if (pi != NULL) {
__system_property_read(pi, NULL, supp_statu...
if (strcmp(supp_status, "running") == 0) {
+ LOGI("Wi-Fi is running\n");
return 0;
} else if (pi->serial != serial &&
strcmp(supp_status, "stopped") == 0...
+ LOGI("Wi-Fi has been stopped");
return -1;
}
}
@@ -313,6 +350,7 @@
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
int count = 50; /* wait at most 5 seconds for compl...
+ LOGI("%s called",__func__);
/* Check whether supplicant already stopped */
if (property_get(SUPP_PROP_NAME, supp_status, NULL)
&& strcmp(supp_status, "stopped") == 0) {
@@ -337,6 +375,7 @@
char ifname[256];
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
+ LOGI("%s called",__func__);
/* Make sure supplicant is running */
if (!property_get(SUPP_PROP_NAME, supp_status, NULL)
|| strcmp(supp_status, "running") != 0) {
@@ -344,7 +383,7 @@
return -1;
}
- property_get("wifi.interface", iface, "sta");
+ property_get("wifi.interface", iface, "wlan0");
if (access(IFACE_DIR, F_OK) == 0) {
snprintf(ifname, sizeof(ifname), "%s/%s", IFACE...
@@ -352,6 +391,8 @@
strlcpy(ifname, iface, sizeof(ifname));
}
+ LOGI("Interface directory = %s", IFACE_DIR);
+ LOGI("Interface name = %s", ifname);
ctrl_conn = wpa_ctrl_open(ifname);
if (ctrl_conn == NULL) {
LOGE("Unable to open connection to supplicant o...
@@ -370,6 +411,7 @@
ctrl_conn = monitor_conn = NULL;
return -1;
}
+ LOGI("Connect to Supplicant done\n");
return 0;
}
@@ -377,20 +419,24 @@
{
int ret;
+ LOGI("%s, cmd = %s\n", __FUNCTION__, cmd);
if (ctrl_conn == NULL) {
LOGV("Not connected to wpa_supplicant - \"%s\" ...
return -1;
}
+ memset(reply, 0, *reply_len);
ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), repl...
if (ret == -2) {
LOGD("'%s' command timed out.\n", cmd);
return -2;
} else if (ret < 0 || strncmp(reply, "FAIL", 4) == ...
+ LOGI("reply:%s\n",reply);
return -1;
}
if (strncmp(cmd, "PING", 4) == 0) {
reply[*reply_len] = '\0';
}
+ LOGI("returning reply %s for cmd %s\n", reply, cmd);
return 0;
}
@@ -403,16 +449,19 @@
struct timeval tval;
struct timeval *tptr;
+ LOGI("%s called",__func__);
+ LOGI("monitor_conn checking \n");
if (monitor_conn == NULL)
return 0;
+ LOGI("calling wpa_ctrl_recv\n");
result = wpa_ctrl_recv(monitor_conn, buf, &nread);
if (result < 0) {
LOGD("wpa_ctrl_recv failed: %s\n", strerror(err...
return -1;
}
buf[nread] = '\0';
- /* LOGD("wait_for_event: result=%d nread=%d string=...
+ LOGI("wait_for_event: result=%d nread=%d string=\"%...
/* Check for EOF on the socket */
if (result == 0 && nread == 0) {
/* Fabricate an event to pass up */
@@ -437,11 +486,13 @@
memmove(buf, match+1, nread+1);
}
}
+ LOGI("returning nread\n");
return nread;
}
void wifi_close_supplicant_connection()
{
+ LOGI("%s called",__func__);
if (ctrl_conn != NULL) {
wpa_ctrl_close(ctrl_conn);
ctrl_conn = NULL;
@@ -454,5 +505,6 @@
int wifi_command(const char *command, char *reply, size...
{
+ LOGI("%s called, cmd:%s",__func__,command);
return wifi_send_command(ctrl_conn, command, reply,...
}
*** Adjust WifiService.java [#h6d5264f]
>
Change '''android-1.5r3/frameworks/base/services/java/com...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u frameworks...
--- frameworks/base/services/java/com/android/server/Wif...
+++ frameworks/base/services/java/com/android/server/Wif...
@@ -75,7 +75,7 @@
*/
public class WifiService extends IWifiManager.Stub {
private static final String TAG = "WifiService";
- private static final boolean DBG = false;
+ private static final boolean DBG = true;
private static final Pattern scanResultPattern = Pa...
private final WifiStateTracker mWifiStateTracker;
@@ -1219,53 +1219,18 @@
}
int lineLen = lineEnd - lineBeg;
if (0 < lineLen && lineLen <= SCAN_RESU...
- int scanResultLevel = 0;
/*
* At most one thread should have a...
*/
synchronized(mScanResultBuffer) {
- boolean parsingScanResultLevel ...
for (int i = lineBeg; i < lineE...
- char ch = reply.charAt(i);
- /*
- * Assume that the signal l...
- */
- if (ch == '-') {
- /*
- * Skip whatever instan...
- * after we parse the s...
- */
- parsingScanResultLevel ...
- } else if (parsingScanResul...
- int digit = Character.d...
- if (0 <= digit) {
- scanResultLevel =
- 10 * scanResult...
- /*
- * Replace the sign...
- * the string with ...
- */
- ch = '0';
- } else {
- /*
- * Reset the flag i...
- * character
- */
- parsingScanResultLe...
- }
- }
- mScanResultBuffer[i - lineB...
+ mScanResultBuffer[i - lineB...
}
- if (scanResultLevel != 0) {
- ScanResult scanResult = par...
- new String(mScanResultB...
- if (scanResult != null) {
- scanResult.level = -scanR...
- scanList.add(scanResult);
- }
- } else if (DBG) {
- Log.w(TAG,
- "ScanResult.level=0: ...
+ ScanResult scanResult = parseSc...
+ new String(mScan...
+ if (scanResult != null) {
+ scanList.add(scanResult);
+ if (DBG) Log.d(TAG, "Sca...
}
}
} else if (0 < lineLen) {
*** Change the name of WiFi I/F [#wf353c19]
>
In the source code of android-1.5r3, change the notation ...
'''android-1.5r3/external/dhcpcd/android/conf'''
beat@bc9-android-sdk:~/android-1.5r3$ diff -u external/d...
--- external/dhcpcd/android.conf.orig 2009-08-31 22:50:3...
+++ external/dhcpcd/android.conf 2009-08-31 22:51:09.000...
@@ -1,6 +1,6 @@
# dhcpcd configuration for Android Wi-Fi interface
# See dhcpcd.conf(5) for details.
-interface tiwlan0
+interface wlan0
# dhcpcd-run-hooks uses these options.
option subnet_mask, routers, domain_name_servers
'''andriod-1.5r3/frameworks/base/service/java/com/android...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u frameworks...
--- frameworks/base/services/java/com/android/server/Wif...
+++ frameworks/base/services/java/com/android/server/Wif...
@@ -81,7 +81,7 @@
* DHCP-replied DNS server anyway.
*/
/** The system property whose value provides the cu...
- private static final String SYSTEMPROPERTY_KEY_DNS ...
+ private static final String SYSTEMPROPERTY_KEY_DNS ...
private Context mContext;
private ContentResolver mContentResolver;
'''android-1.5r3/frameworks/base/wifi/java/android/net/wi...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u frameworks...
--- frameworks/base/wifi/java/android/net/wifi/WifiState...
+++ frameworks/base/wifi/java/android/net/wifi/WifiState...
@@ -321,7 +321,7 @@
mSettingsObserver = new SettingsObserver(new Ha...
- mInterfaceName = SystemProperties.get("wifi.int...
+ mInterfaceName = SystemProperties.get("wifi.int...
sDnsPropNames = new String[] {
"dhcp." + mInterfaceName + ".dns1",
"dhcp." + mInterfaceName + ".dns2"
** sound source file [#j046a512]
>
'''AudioPackage2.mk''' is copied, and change its name to ...
to be copied to the right places when build the files.~
** Fix BoardConfig.mk [#sc7d3ec3]
>
For the integration of ALSA and handling WiFi, '''android...
'''BoardConfig.mk''' is replaced with the code shown belo...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u build/targ...
--- build/target/board/generic/BoardConfig.mk.orig 2009-...
+++ build/target/board/generic/BoardConfig.mk 2009-08-30...
@@ -8,4 +8,7 @@
TARGET_NO_KERNEL := true
TARGET_NO_RADIOIMAGE := true
HAVE_HTC_AUDIO_DRIVER := true
-BOARD_USES_GENERIC_AUDIO := true
+BOARD_USES_ALSA_AUDIO := true
+WPA_BUILD_SUPPLICANT := true
+BOARD_WPA_SUPPLICANT_DRIVER := WEXT
+#BOARD_USES_GENERIC_AUDIO := true
*** Modify system.prop [#rff889e5]
>
To change the I/F name of Wi-Fi to '''wlan0''', '''androi...
below. After build is executed, this change will be taken...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u build/targ...
--- build/target/board/generic/system.prop.orig 2009-08-...
+++ build/target/board/generic/system.prop 2009-08-31 20...
@@ -2,5 +2,10 @@
# system.prop for generic sdk
#
-rild.libpath=/system/lib/libreference-ril.so
-rild.libargs=-d /dev/ttyS0
+# RILD settings
+#rild.libpath=/system/lib/libreference-ril.so
+#rild.libargs=-d /dev/ttyS0
+
+# WiFi settings
+wifi.interface = wlan0
+
* build [#u0f9c135]
>
As these fixings and adjustments shown above are complete...
$ cd ~/android-1.5r3
$ make
Technically, build is completed, but the lib files of Ope...
'''android-1.5r3/out/target/product/generic/system/lib'''...
build separately.~
* Additional Build [#b614ed64]
** OpenWnn [#v2d3766f]
>
As bc9 is basically works inside '''landscape''', turn of...
'''android-1.5_r3/packages/inputsmethod/OpenWnn/src/jp/co...
below.~
beat@bc9-android-sdk:~/android-1.5r3$ diff -u packages/i...
--- packages/inputmethods/OpenWnn/src/jp/co/omronsoft/op...
+++ packages/inputmethods/OpenWnn/src/jp/co/omronsoft/op...
@@ -847,7 +847,7 @@
private void createKeyboardsLandscape(OpenWnn paren...
Keyboard[][] keyList;
/* qwerty shift_off (landscape) */
-/* keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBO...
+ keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBOAR...
keyList[KEYMODE_JA_FULL_HIRAGANA][0] = new Keyb...
keyList[KEYMODE_JA_FULL_ALPHABET][0] = new Keyb...
keyList[KEYMODE_JA_FULL_NUMBER][0] = new Keyb...
@@ -856,9 +856,9 @@
keyList[KEYMODE_JA_HALF_NUMBER][0] = new Keyb...
keyList[KEYMODE_JA_HALF_KATAKANA][0] = new Keyb...
keyList[KEYMODE_JA_HALF_PHONE][0] = new Keyb...
-*/
+
/* qwerty shift_on (landscape) */
-/* keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBO...
+ keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBOAR...
keyList[KEYMODE_JA_FULL_HIRAGANA][0] =
mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_QWER...
keyList[KEYMODE_JA_FULL_ALPHABET][0] = new Keyb...
@@ -872,9 +872,9 @@
mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_QWER...
keyList[KEYMODE_JA_HALF_PHONE][0] =
mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_QWER...
-*/
+
/* 12-keys shift_off (landscape) */
-/* keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBO...
+ keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBOAR...
keyList[KEYMODE_JA_FULL_HIRAGANA][0] = new Keyb...
keyList[KEYMODE_JA_FULL_HIRAGANA][1] = new Keyb...
keyList[KEYMODE_JA_FULL_ALPHABET][0] = new Keyb...
@ -888,9 +888,9 @@
keyList[KEYMODE_JA_HALF_KATAKANA][0] = new Keyb...
keyList[KEYMODE_JA_HALF_KATAKANA][1] = new Keyb...
keyList[KEYMODE_JA_HALF_PHONE][0] = new Keyb...
-*/
+
/* 12-keys shift_on (landscape) */
-/* keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBO...
+ keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBOAR...
keyList[KEYMODE_JA_FULL_HIRAGANA]
= mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_12...
keyList[KEYMODE_JA_FULL_ALPHABET]
@@ -907,7 +907,7 @@
= mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_12...
keyList[KEYMODE_JA_HALF_PHONE]
= mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_12...
-*/
+
}
After the change is completed. '''OpenWnn''' can be buil...
$ cd ~/android-1.5_r3/build/
$ source envsetup.sh
$ cd ~/android-1.5_r3/packages/inputmethods/OpenWnn
$ mm
Finally, the lib files for OpenWnn are built under '''~/a...
* Create android-root [#zbcb0c89]
** Place the built android file [#bdd6a20a]
>
The whole build process described above is completed, the...
$ cd ~/
$ mkdir android-root
$ cp -a ~/android-1.5r2/out/target/product/generic/root/...
$ cp -a ~/android-1.5r2/out/target/product/generic/syste...
** Place kernel module [#b5069bc3]
>
The '''rt73usb''' related kernel module and the firmware ...
users turn on/off Wi-Fi from GUI of android via applying ...
are shown below.~
Caution: As using kernel module, bc9 is needed to be boot...
$ mkdir ~/android-root/system/lib/modules/
$ cp ~/kernel_work/linux-android-2.6.29-bc9-r6/drivers/n...
$ mkdir ~/android-root/system/etc/
$ cp kernel_work/RT71W_Firmware_V1.8/LICENSE.ralink-firm...
$ cp kernel_work/RT71W_Firmware_V1.8/rt73.bin android-ro...
** Edit init.rc [#b81dc61b]
>
The confutations of '''android-root/init.rc''' is needed ...
--- init.rc.orig 2009-08-30 14:59:02.000000000 +0...
+++ init.rc 2009-09-01 15:34:35.000000000 +0900
@@ -36,16 +36,16 @@
# mount mtd partitions
# Mount /system rw first to give the filesystem a c...
- mount yaffs2 mtd@system /system
- mount yaffs2 mtd@system /system ro remount
+ # mount yaffs2 mtd@system /system
+ # mount yaffs2 mtd@system /system ro remount
# We chown/chmod /data again so because mount is ru...
- mount yaffs2 mtd@userdata /data nosuid nodev
+ # mount yaffs2 mtd@userdata /data nosuid nodev
chown system system /data
chmod 0771 /data
# Same reason as /data above
- mount yaffs2 mtd@cache /cache nosuid nodev
+ # mount yaffs2 mtd@cache /cache nosuid nodev
chown system cache /cache
chmod 0770 /cache
@@ -78,10 +78,35 @@
chown root root /cache/lost+found
chmod 0770 /cache/lost+found
+ chmod 0666 /dev/bc9_leds
+
+ setprop alsa.mixer.playback.master Master
+ setprop alsa.mixer.capture.master Capture
+ setprop alsa.mixer.playback.earpiece Master
+ setprop alsa.mixer.capture.earpiece Capture
+ setprop alsa.mixer.playback.headset Master
+ setprop alsa.mixer.playback.speaker Master
+ chmod 0777 /dev/pcmC0D0c
+ chmod 0777 /dev/pcmC0D0p
+ chmod 0777 /dev/controlC0
+ chmod 0777 /dev/timer
+ chown root audio /dev/controlC
+ chown root audio /dev/pcmC0D0c
+ chown root audio /dev/pcmC0D0p
+ chown root audio /dev/timer
+
+ # create wifi filesystem structure
+ mkdir /data/misc/wifi 0770 system system
+ mkdir /data/misc/wifi/sockets 0770 system system
+ mkdir /data/system/wpa_supplicant 0770 system system
+ mkdir /data/misc/dhcp 0770 dhcp dhcp
+ chown dhcp dhcp /data/misc/dhcp
+
+
on boot
# basic network init
ifup lo
- hostname localhost
+ hostname bc9
domainname localdomain
# set RLIMIT_NICE to allow priorities from 19 to -20
@@ -110,6 +135,9 @@
setprop ro.CONTENT_PROVIDER_MEM 5632
setprop ro.EMPTY_APP_MEM 6144
+ setprop wifi.interface wlan0
+ setprop wlan.driver.status ok
+
# Write value must be consistent with the above propert...
# Note that the driver only supports 6 slots, so we hav...
# same memory level as services.
@@ -204,11 +232,11 @@
service debuggerd /system/bin/debuggerd
-service ril-daemon /system/bin/rild
- socket rild stream 660 root radio
- socket rild-debug stream 660 radio system
- user root
- group radio cache inet misc
+#service ril-daemon /system/bin/rild
+# socket rild stream 660 root radio
+# socket rild-debug stream 660 radio system
+# user root
+# group radio cache inet misc
service zygote /system/bin/app_process -Xzygote /system...
socket zygote stream 666
@@ -219,38 +247,59 @@
user media
group system audio camera graphics inet net_bt net_...
-service bootsound /system/bin/playmp3
- user media
- group audio
- oneshot
-
-service dbus /system/bin/dbus-daemon --system --nofork
- socket dbus stream 660 bluetooth bluetooth
- user bluetooth
- group bluetooth net_bt_admin
-
-service hcid /system/bin/hcid -s -n -f /etc/bluez/hcid....
- socket bluetooth stream 660 bluetooth bluetooth
- socket dbus_bluetooth stream 660 bluetooth bluetooth
- # init.rc does not yet support applying capabilitie...
- # let hcid drop uid to bluetooth with the right lin...
- group bluetooth net_bt_admin misc
- disabled
+#service bootsound /system/bin/playmp3
+# user media
+# group audio
+# oneshot
+
+#service dbus /system/bin/dbus-daemon --system --nofork
+# socket dbus stream 660 bluetooth bluetooth
+# user bluetooth
+# group bluetooth net_bt_admin
+
+#service hcid /system/bin/hcid -s -n -f /etc/bluez/hcid...
+# socket bluetooth stream 660 bluetooth bluetooth
+# socket dbus_bluetooth stream 660 bluetooth bluetooth
+# # init.rc does not yet support applying capabiliti...
+# # let hcid drop uid to bluetooth with the right li...
+# group bluetooth net_bt_admin misc
+# disabled
+
+#service hfag /system/bin/sdptool add --channel=10 HFAG
+# user bluetooth
+# group bluetooth net_bt_admin
+# disabled
+# oneshot
+
+#service hsag /system/bin/sdptool add --channel=11 HSAG
+# user bluetooth
+# group bluetooth net_bt_admin
+# disabled
+# oneshot
+
+
+#service wlan_loader /system/bin/wlan_loader
+# disabled
+# oneshot
+
+service ifcfg_ralink /system/bin/ifconfig wlan0 up
+# disabled
+# oneshot
+
+service wpa_supplicant /system/bin/logwrapper /system/b...
+ disabled
+ group system
+
+service dhcpcd /system/bin/logwrapper /system/bin/dhcpc...
+ disabled
+ oneshot
+ #group system dhcp
-service hfag /system/bin/sdptool add --channel=10 HFAG
- user bluetooth
- group bluetooth net_bt_admin
- disabled
- oneshot
-
-service hsag /system/bin/sdptool add --channel=11 HSAG
- user bluetooth
- group bluetooth net_bt_admin
- disabled
- oneshot
+on property:init.svc.wpa_supplicant=stopped
+ stop dhcpcd
service installd /system/bin/installd
socket installd stream 600 system system
-service flash_recovery /system/bin/flash_image recovery...
- oneshot
+#service flash_recovery /system/bin/flash_image recover...
+# oneshot
** Configure alsa file [#l1b4d2b6]
>
Copy the ALSA configuration files at '''/android-root/sys...
&ref(asound.conf); & &ref(asound.state);
*** asound.state [#na58f801]
>
'''asound.state''' is generated at OpenEmbedded's directo...
*** asound.conf [#r5b26285]
>
'''asound.conf''' is created for letting each control wor...
** vold configuration file [#e4faef1e]
>
For Android, SDcard is mounted as '''/system/bin/vold/'''...
'''vold''' works as its configuration file, which is loca...
is defined as shown below.~
## vold configuration file for bc9
volume_sdcard {
media_path /devices/platform/pxa2xx-mci.0/mmc_host...
media_type mmc
mount_point /sdcard
ums_path /devices/platform/usb_mass_storage/lun0
}
Because of this configuration, the first partition of mic...
Put the files pictures, audio, and videos on the first pa...
** Configuration of button setting [#m84f94ba]
>
From the top, bc9's buttons are set for, HOME, MENU, and ...
bc9 has three buttons, which is connected via GPIO. The b...
used for HOME, MENU, and BACK. To use the buttons, modify...
--- qwerty.kl.orig 2009-09-01 16:44:37.000000000 +0900
+++ qwerty.kl 2009-09-01 16:45:24.000000000 +0900
@@ -11,18 +11,18 @@ key 10 9
key 11 0
key 158 BACK WAKE_DROPPED
key 230 SOFT_RIGHT WAKE
-key 60 SOFT_RIGHT WAKE
+key 60 MENU WAKE
key 107 ENDCALL WAKE_DROPPED
key 62 ENDCALL WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
-key 59 MENU WAKE_DROPPED
+key 59 HOME WAKE
key 127 SEARCH WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 228 POUND
key 227 STAR
key 231 CALL WAKE_DROPPED
-key 61 CALL WAKE_DROPPED
+key 61 BACK WAKE
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
** default.prop [#n0dda072]
>
At the end of '''default.prop''', set up the IP of OpenDN...
(If the use of OpenDNS is prohibited, set up any availabl...
net.eth0.dns1=208.66.222.222
net.dns1=208.67.222.222
** Screen Timeout [#lf1e3dc9]
>
Since Power Management function is cancelled by applicati...
will not turn on again. Screen Timeout is needed to be tu...
-[Menu] - [Settings] ? [Sound & display] ? [Screen timeou...
** device_provisioned [#e4861d6d]
>
activation related setting affects on the Open Source ver...
Giving the command, shown below, on the file, android bec...
This should be on Linux and applying sqlite3.)
# cd /data/data/com.android.providers.settings/databases
# sqlite3 settings.db
sqlite> insert into "secure" values(NULL,"device_provisi...
sqlite> .exit
Once android is activated, the key lock dialog will be a...
Before android is activated, HOME~
screen immediately appears after android is booted. After...
pushing MENU button, reach HOME screen. On the key lock ...
capable of connecting to 3G communication. Ethernet can b...
~
As users fails to activate android, these issues are reco...
-HOME key is cancelled.
-While android is booting, key dialog does not appears.~
>
This ends the build and preparation process of android 1....
End:
[[bc9]]
-Contents
#Contents
* android-1.5r3 for bc9 (bc9-android-sdk-release20090815 ...
>
Checkout '''android-1.5r3''' and modify it.
-android-1.5r3 is a tag branch, which is created right af...
-android-1.5r3 is a tag brach, which is put fort cupcake-...
-The kernel source of android-1.5r3 is excluded from repo...
* Get Source [#k37bd4ac]
** android-1.5r3 branch [#wf45f630]
>
Following the instructions below, obtain source code of ...
$ mkdir ~/android-1.5r3
$ cd android-1.5r3
$ repo init -u git://android.git.kernel.org/platform/man...
$ repo sync
** ALSA [#v68316f0]
>
android-1.5r3 branch is a tag branch of the cupcake-relea...
cupcake-release branch. Since this is not the master brac...
information of ALSA in local_manifest.xml and ordering re...
these files at the source tree of android-1.5r3. Then, bu...
is committed later then August 2009. '''alsa_sound''' use...
ALSA is shown below.~
$ cd ~android-1.5r3/external
$ git clone git://android.git.kernel.org/platform/extern...
$ cd alsa-lib
$ git checkout 7d7fc0e
$ cd ~android-1.5r3/hardware
$ git clone git://android.git.kernel.org/hardware/alsa_s...
$ cd alsa_sound
$ git checkout a5cf8cc
* Adjust the Contents of build [#sc688863]
** Adjust alsa-lib [#d070a516]
>
Modify '''android-1.5r3/external/alsa-lib/Android.mk'''. ...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u external/a...
--- external/alsa-lib/Android.mk.orig 2009-08-30 15:00:5...
+++ external/alsa-lib/Android.mk 2009-08-30 15:01:13.000...
@@ -55,7 +55,7 @@
-fPIC -DPIC -D_POSIX_SOURCE \
-DALSA_CONFIG_DIR=\"/system/usr/share/alsa\" \
-DALSA_PLUGIN_DIR=\"/system/usr/lib/alsa-lib\" \
- -DALSA_DEVICE_DIRECTORY=\"/dev/snd/\"
+ -DALSA_DEVICE_DIRECTORY=\"/dev/\"
LOCAL_SRC_FILES := $(sort $(call all-c-files-under, src))
** Patch for power management [#fa42dac3]
>
Please apply the patch listed below before build the file...
as low level battery.
- dummy-battery.patch
>&ref(dummy-battery.patch);
>
$ cd android-sdk-1.5_r3
$ patch -b -p1 < ../dummy-battery.patch
** Adjust Wi-Fi [#pc5f1edd]
*** Modify wpa_supplicant [#wdcd7bd2]
>
Change '''android-1.5r3/external/wpa_supplicant/.config''...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u external/w...
--- external/wpa_supplicant/.config.orig 2009-08-31 20:3...
+++ external/wpa_supplicant/.config 2009-08-31 20:33:50....
@@ -19,13 +19,13 @@
CONFIG_PKCS12=y
# CONFIG_PCSC=y
CONFIG_SMARTCARD=y
-# CONFIG_WIRELESS_EXTENSION=y
+CONFIG_WIRELESS_EXTENSION=y
CONFIG_CTRL_IFACE=y
# CONFIG_DRIVER_HOSTAP=y
# CONFIG_DRIVER_HERMES=y
# CONFIG_DRIVER_MADWIFI=y
# CONFIG_DRIVER_ATMEL=y
-# CONFIG_DRIVER_WEXT=y
+CONFIG_DRIVER_WEXT=y
# CONFIG_DRIVER_NDISWRAPPER=y
# CONFIG_DRIVER_BROADCOM=y
# CONFIG_DRIVER_IPW=y
Alter '''android-1.5r3/external/wpa_supplicant/wpa_suppli...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u external/w...
--- external/wpa_supplicant/wpa_supplicant.conf.orig 200...
+++ external/wpa_supplicant/wpa_supplicant.conf 2009-08-...
@@ -72,7 +72,9 @@
# DACL (which will reject all connections). See README-...
# information about SDDL string format.
#
-ctrl_interface=tiwlan0
+#ctrl_interface=tiwlan0
+#ctrl_interface=wlan0
+ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=sy...
# IEEE 802.1X/EAPOL version
# wpa_supplicant is implemented based on IEEE Std 802.1...
*** Change wifi.c [#f74e9ef5]
>
As changing '''android-1.5r3/hardware/libhardware_legacy/...
accessible from Android's GUI. To check progress of the ...
necessary, please adjust the amount of log-outs by commen...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u hardware/l...
--- hardware/libhardware_legacy/wifi/wifi.c.orig ...
+++ hardware/libhardware_legacy/wifi/wifi.c 2009-08-...
@@ -48,17 +48,23 @@
// TODO: use new ANDROID_SOCKET mechanism, once support...
// sockets is in
-static const char IFACE_DIR[] = "/data/system...
-static const char DRIVER_MODULE_NAME[] = "wlan";
-static const char DRIVER_MODULE_TAG[] = "wlan ";
-static const char DRIVER_MODULE_PATH[] = "/system/lib/...
-static const char FIRMWARE_LOADER[] = "wlan_loader";
-static const char DRIVER_PROP_NAME[] = "wlan.driver....
-static const char SUPPLICANT_NAME[] = "wpa_supplica...
-static const char SUPP_PROP_NAME[] = "init.svc.wpa...
-static const char SUPP_CONFIG_TEMPLATE[]= "/system/etc/...
-static const char SUPP_CONFIG_FILE[] = "/data/misc/w...
-static const char MODULE_FILE[] = "/proc/module...
+static const char IFACE_DIR[] ...
+static const char DRIVER_MODULE_NAME[] ...
+static const char DRIVER_MODULE_TAG[] ...
+static const char DRIVER_MODULE_PATH[] ...
+static const char RT2X00_LIB_DRIVER_MODULE_NAME[] ...
+static const char RT2X00_LIB_DRIVER_MODULE_TAG[] ...
+static const char RT2X00_LIB_DRIVER_MODULE_PATH[] ...
+static const char RT2X00_LIB_USB_DRIVER_MODULE_NAME[] ...
+static const char RT2X00_LIB_USB_DRIVER_MODULE_TAG[] ...
+static const char RT2X00_LIB_USB_DRIVER_MODULE_PATH[] ...
+static const char FIRMWARE_LOADER[] ...
+static const char DRIVER_PROP_NAME[] ...
+static const char SUPPLICANT_NAME[] ...
+static const char SUPP_PROP_NAME[] ...
+static const char SUPP_CONFIG_TEMPLATE[] ...
+static const char SUPP_CONFIG_FILE[] ...
+static const char MODULE_FILE[] ...
static int insmod(const char *filename)
{
@@ -66,6 +72,7 @@
unsigned int size;
int ret;
+ LOGI("%s\n", __FUNCTION__);
module = load_file(filename, &size);
if (!module)
return -1;
@@ -82,6 +89,7 @@
int ret = -1;
int maxtry = 10;
+ LOGI("%s\n", __FUNCTION__);
while (maxtry-- > 0) {
ret = delete_module(modname, O_NONBLOCK | O_EXC...
if (ret < 0 && errno == EAGAIN)
@@ -91,30 +99,35 @@
}
if (ret != 0)
- LOGD("Unable to unload driver module \"%s\": %s...
+ LOGE("Unable to unload driver module \"%s\": %s...
modname, strerror(errno));
return ret;
}
int do_dhcp_request(int *ipaddr, int *gateway, int *mask,
int *dns1, int *dns2, int *server, ...
+ LOGI("1. inside %s\n", __FUNCTION__);
/* For test driver, always report success */
- if (strcmp(iface, "sta") == 0)
+ if (strcmp(iface, "wlan0") == 0)
return 0;
+ LOGI("2. inside %s\n", __FUNCTION__);
if (ifc_init() < 0)
return -1;
+ LOGI("3. inside %s\n", __FUNCTION__);
if (do_dhcp(iface) < 0) {
ifc_close();
return -1;
}
ifc_close();
get_dhcp_info(ipaddr, gateway, mask, dns1, dns2, se...
+ LOGI("4. inside %s\n", __FUNCTION__);
return 0;
}
const char *get_dhcp_error_string() {
+ LOGI("Inside %s\n", __FUNCTION__);
return dhcp_lasterror();
}
@@ -140,10 +153,12 @@
}
while ((fgets(line, sizeof(line), proc)) != NULL) {
if (strncmp(line, DRIVER_MODULE_TAG, strlen(DRI...
+ LOGI("driver %s has been installed\n",DRIVE...
fclose(proc);
return 1;
}
}
+ LOGE("Cannot find driver %s in proc",DRIVER_MODULE_...
fclose(proc);
property_set(DRIVER_PROP_NAME, "unloaded");
return 0;
@@ -154,23 +169,31 @@
char driver_status[PROPERTY_VALUE_MAX];
int count = 100; /* wait at most 20 seconds for com...
+ LOGI("Loading WiFi Modules\n");
+ sleep(1);
+
+ property_set(DRIVER_PROP_NAME, "ok");
if (check_driver_loaded()) {
return 0;
}
-
- if (insmod(DRIVER_MODULE_PATH) < 0)
- return -1;
-
+ insmod(RT2X00_LIB_DRIVER_MODULE_PATH);
+ insmod(RT2X00_LIB_USB_DRIVER_MODULE_PATH);
+ insmod(DRIVER_MODULE_PATH);
property_set("ctl.start", FIRMWARE_LOADER);
sched_yield();
while (count-- > 0) {
+ usleep(500000);
if (property_get(DRIVER_PROP_NAME, driver_statu...
- if (strcmp(driver_status, "ok") == 0)
+ if (strcmp(driver_status, "ok") == 0) {
+ property_set("ctl.start", "ifcfg_ralink...
+ usleep(1000000);
+ //property_set("ctl.start", "dhcpcd");
return 0;
- else if (strcmp(DRIVER_PROP_NAME, "failed")...
+ }
+ else if (strcmp(DRIVER_PROP_NAME, "failed")...
return -1;
+ }
}
- usleep(200000);
}
property_set(DRIVER_PROP_NAME, "timeout");
return -1;
@@ -178,20 +201,30 @@
int wifi_unload_driver()
{
- int count = 20; /* wait at most 10 seconds for comp...
+ LOGI("Unloading WiFi Modules\n");
+ sleep(1);
if (rmmod(DRIVER_MODULE_NAME) == 0) {
- while (count-- > 0) {
- if (!check_driver_loaded())
- break;
- usleep(500000);
- }
- if (count) {
- return 0;
- }
- return -1;
- } else
+ usleep(1000000);
+ } else {
+ LOGE("Unloading Ralink RT73USB WLAN Module Fail...
+ return -1;
+ }
+
+ if (rmmod(RT2X00_LIB_USB_DRIVER_MODULE_NAME) == 0) {
+ usleep(1000000);
+ } else {
+ LOGE("Unloading RT2X00_LIB_USB Module Failed\n");
+ return -1;
+ }
+
+ if (rmmod(RT2X00_LIB_DRIVER_MODULE_NAME) == 0) {
+ usleep(1000000);
+ } else {
+ LOGE("Unloading RT2X00_LIB Module Failed\n");
return -1;
+ }
+ return 0;
}
int ensure_config_file_exists()
@@ -200,6 +233,7 @@
int srcfd, destfd;
int nread;
+ LOGE("%s\n", __FUNCTION__);
if (access(SUPP_CONFIG_FILE, R_OK|W_OK) == 0) {
return 0;
} else if (errno != ENOENT) {
@@ -252,6 +286,7 @@
unsigned serial = 0;
#endif
+ LOGI("start %s",__FUNCTION__);
/* Check whether already running */
if (property_get(SUPP_PROP_NAME, supp_status, NULL)
&& strcmp(supp_status, "running") == 0) {
@@ -260,7 +295,7 @@
/* Before starting the daemon, make sure its config...
if (ensure_config_file_exists() < 0) {
- LOGE("Wi-Fi will not be enabled");
+ LOGE("Configuration file does not exist. Wi-Fi ...
return -1;
}
@@ -291,9 +326,11 @@
if (pi != NULL) {
__system_property_read(pi, NULL, supp_statu...
if (strcmp(supp_status, "running") == 0) {
+ LOGI("Wi-Fi is running\n");
return 0;
} else if (pi->serial != serial &&
strcmp(supp_status, "stopped") == 0...
+ LOGI("Wi-Fi has been stopped");
return -1;
}
}
@@ -313,6 +350,7 @@
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
int count = 50; /* wait at most 5 seconds for compl...
+ LOGI("%s called",__func__);
/* Check whether supplicant already stopped */
if (property_get(SUPP_PROP_NAME, supp_status, NULL)
&& strcmp(supp_status, "stopped") == 0) {
@@ -337,6 +375,7 @@
char ifname[256];
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
+ LOGI("%s called",__func__);
/* Make sure supplicant is running */
if (!property_get(SUPP_PROP_NAME, supp_status, NULL)
|| strcmp(supp_status, "running") != 0) {
@@ -344,7 +383,7 @@
return -1;
}
- property_get("wifi.interface", iface, "sta");
+ property_get("wifi.interface", iface, "wlan0");
if (access(IFACE_DIR, F_OK) == 0) {
snprintf(ifname, sizeof(ifname), "%s/%s", IFACE...
@@ -352,6 +391,8 @@
strlcpy(ifname, iface, sizeof(ifname));
}
+ LOGI("Interface directory = %s", IFACE_DIR);
+ LOGI("Interface name = %s", ifname);
ctrl_conn = wpa_ctrl_open(ifname);
if (ctrl_conn == NULL) {
LOGE("Unable to open connection to supplicant o...
@@ -370,6 +411,7 @@
ctrl_conn = monitor_conn = NULL;
return -1;
}
+ LOGI("Connect to Supplicant done\n");
return 0;
}
@@ -377,20 +419,24 @@
{
int ret;
+ LOGI("%s, cmd = %s\n", __FUNCTION__, cmd);
if (ctrl_conn == NULL) {
LOGV("Not connected to wpa_supplicant - \"%s\" ...
return -1;
}
+ memset(reply, 0, *reply_len);
ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), repl...
if (ret == -2) {
LOGD("'%s' command timed out.\n", cmd);
return -2;
} else if (ret < 0 || strncmp(reply, "FAIL", 4) == ...
+ LOGI("reply:%s\n",reply);
return -1;
}
if (strncmp(cmd, "PING", 4) == 0) {
reply[*reply_len] = '\0';
}
+ LOGI("returning reply %s for cmd %s\n", reply, cmd);
return 0;
}
@@ -403,16 +449,19 @@
struct timeval tval;
struct timeval *tptr;
+ LOGI("%s called",__func__);
+ LOGI("monitor_conn checking \n");
if (monitor_conn == NULL)
return 0;
+ LOGI("calling wpa_ctrl_recv\n");
result = wpa_ctrl_recv(monitor_conn, buf, &nread);
if (result < 0) {
LOGD("wpa_ctrl_recv failed: %s\n", strerror(err...
return -1;
}
buf[nread] = '\0';
- /* LOGD("wait_for_event: result=%d nread=%d string=...
+ LOGI("wait_for_event: result=%d nread=%d string=\"%...
/* Check for EOF on the socket */
if (result == 0 && nread == 0) {
/* Fabricate an event to pass up */
@@ -437,11 +486,13 @@
memmove(buf, match+1, nread+1);
}
}
+ LOGI("returning nread\n");
return nread;
}
void wifi_close_supplicant_connection()
{
+ LOGI("%s called",__func__);
if (ctrl_conn != NULL) {
wpa_ctrl_close(ctrl_conn);
ctrl_conn = NULL;
@@ -454,5 +505,6 @@
int wifi_command(const char *command, char *reply, size...
{
+ LOGI("%s called, cmd:%s",__func__,command);
return wifi_send_command(ctrl_conn, command, reply,...
}
*** Adjust WifiService.java [#h6d5264f]
>
Change '''android-1.5r3/frameworks/base/services/java/com...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u frameworks...
--- frameworks/base/services/java/com/android/server/Wif...
+++ frameworks/base/services/java/com/android/server/Wif...
@@ -75,7 +75,7 @@
*/
public class WifiService extends IWifiManager.Stub {
private static final String TAG = "WifiService";
- private static final boolean DBG = false;
+ private static final boolean DBG = true;
private static final Pattern scanResultPattern = Pa...
private final WifiStateTracker mWifiStateTracker;
@@ -1219,53 +1219,18 @@
}
int lineLen = lineEnd - lineBeg;
if (0 < lineLen && lineLen <= SCAN_RESU...
- int scanResultLevel = 0;
/*
* At most one thread should have a...
*/
synchronized(mScanResultBuffer) {
- boolean parsingScanResultLevel ...
for (int i = lineBeg; i < lineE...
- char ch = reply.charAt(i);
- /*
- * Assume that the signal l...
- */
- if (ch == '-') {
- /*
- * Skip whatever instan...
- * after we parse the s...
- */
- parsingScanResultLevel ...
- } else if (parsingScanResul...
- int digit = Character.d...
- if (0 <= digit) {
- scanResultLevel =
- 10 * scanResult...
- /*
- * Replace the sign...
- * the string with ...
- */
- ch = '0';
- } else {
- /*
- * Reset the flag i...
- * character
- */
- parsingScanResultLe...
- }
- }
- mScanResultBuffer[i - lineB...
+ mScanResultBuffer[i - lineB...
}
- if (scanResultLevel != 0) {
- ScanResult scanResult = par...
- new String(mScanResultB...
- if (scanResult != null) {
- scanResult.level = -scanR...
- scanList.add(scanResult);
- }
- } else if (DBG) {
- Log.w(TAG,
- "ScanResult.level=0: ...
+ ScanResult scanResult = parseSc...
+ new String(mScan...
+ if (scanResult != null) {
+ scanList.add(scanResult);
+ if (DBG) Log.d(TAG, "Sca...
}
}
} else if (0 < lineLen) {
*** Change the name of WiFi I/F [#wf353c19]
>
In the source code of android-1.5r3, change the notation ...
'''android-1.5r3/external/dhcpcd/android/conf'''
beat@bc9-android-sdk:~/android-1.5r3$ diff -u external/d...
--- external/dhcpcd/android.conf.orig 2009-08-31 22:50:3...
+++ external/dhcpcd/android.conf 2009-08-31 22:51:09.000...
@@ -1,6 +1,6 @@
# dhcpcd configuration for Android Wi-Fi interface
# See dhcpcd.conf(5) for details.
-interface tiwlan0
+interface wlan0
# dhcpcd-run-hooks uses these options.
option subnet_mask, routers, domain_name_servers
'''andriod-1.5r3/frameworks/base/service/java/com/android...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u frameworks...
--- frameworks/base/services/java/com/android/server/Wif...
+++ frameworks/base/services/java/com/android/server/Wif...
@@ -81,7 +81,7 @@
* DHCP-replied DNS server anyway.
*/
/** The system property whose value provides the cu...
- private static final String SYSTEMPROPERTY_KEY_DNS ...
+ private static final String SYSTEMPROPERTY_KEY_DNS ...
private Context mContext;
private ContentResolver mContentResolver;
'''android-1.5r3/frameworks/base/wifi/java/android/net/wi...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u frameworks...
--- frameworks/base/wifi/java/android/net/wifi/WifiState...
+++ frameworks/base/wifi/java/android/net/wifi/WifiState...
@@ -321,7 +321,7 @@
mSettingsObserver = new SettingsObserver(new Ha...
- mInterfaceName = SystemProperties.get("wifi.int...
+ mInterfaceName = SystemProperties.get("wifi.int...
sDnsPropNames = new String[] {
"dhcp." + mInterfaceName + ".dns1",
"dhcp." + mInterfaceName + ".dns2"
** sound source file [#j046a512]
>
'''AudioPackage2.mk''' is copied, and change its name to ...
to be copied to the right places when build the files.~
** Fix BoardConfig.mk [#sc7d3ec3]
>
For the integration of ALSA and handling WiFi, '''android...
'''BoardConfig.mk''' is replaced with the code shown belo...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u build/targ...
--- build/target/board/generic/BoardConfig.mk.orig 2009-...
+++ build/target/board/generic/BoardConfig.mk 2009-08-30...
@@ -8,4 +8,7 @@
TARGET_NO_KERNEL := true
TARGET_NO_RADIOIMAGE := true
HAVE_HTC_AUDIO_DRIVER := true
-BOARD_USES_GENERIC_AUDIO := true
+BOARD_USES_ALSA_AUDIO := true
+WPA_BUILD_SUPPLICANT := true
+BOARD_WPA_SUPPLICANT_DRIVER := WEXT
+#BOARD_USES_GENERIC_AUDIO := true
*** Modify system.prop [#rff889e5]
>
To change the I/F name of Wi-Fi to '''wlan0''', '''androi...
below. After build is executed, this change will be taken...
beat@bc9-android-sdk:~/android-1.5r3$ diff -u build/targ...
--- build/target/board/generic/system.prop.orig 2009-08-...
+++ build/target/board/generic/system.prop 2009-08-31 20...
@@ -2,5 +2,10 @@
# system.prop for generic sdk
#
-rild.libpath=/system/lib/libreference-ril.so
-rild.libargs=-d /dev/ttyS0
+# RILD settings
+#rild.libpath=/system/lib/libreference-ril.so
+#rild.libargs=-d /dev/ttyS0
+
+# WiFi settings
+wifi.interface = wlan0
+
* build [#u0f9c135]
>
As these fixings and adjustments shown above are complete...
$ cd ~/android-1.5r3
$ make
Technically, build is completed, but the lib files of Ope...
'''android-1.5r3/out/target/product/generic/system/lib'''...
build separately.~
* Additional Build [#b614ed64]
** OpenWnn [#v2d3766f]
>
As bc9 is basically works inside '''landscape''', turn of...
'''android-1.5_r3/packages/inputsmethod/OpenWnn/src/jp/co...
below.~
beat@bc9-android-sdk:~/android-1.5r3$ diff -u packages/i...
--- packages/inputmethods/OpenWnn/src/jp/co/omronsoft/op...
+++ packages/inputmethods/OpenWnn/src/jp/co/omronsoft/op...
@@ -847,7 +847,7 @@
private void createKeyboardsLandscape(OpenWnn paren...
Keyboard[][] keyList;
/* qwerty shift_off (landscape) */
-/* keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBO...
+ keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBOAR...
keyList[KEYMODE_JA_FULL_HIRAGANA][0] = new Keyb...
keyList[KEYMODE_JA_FULL_ALPHABET][0] = new Keyb...
keyList[KEYMODE_JA_FULL_NUMBER][0] = new Keyb...
@@ -856,9 +856,9 @@
keyList[KEYMODE_JA_HALF_NUMBER][0] = new Keyb...
keyList[KEYMODE_JA_HALF_KATAKANA][0] = new Keyb...
keyList[KEYMODE_JA_HALF_PHONE][0] = new Keyb...
-*/
+
/* qwerty shift_on (landscape) */
-/* keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBO...
+ keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBOAR...
keyList[KEYMODE_JA_FULL_HIRAGANA][0] =
mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_QWER...
keyList[KEYMODE_JA_FULL_ALPHABET][0] = new Keyb...
@@ -872,9 +872,9 @@
mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_QWER...
keyList[KEYMODE_JA_HALF_PHONE][0] =
mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_QWER...
-*/
+
/* 12-keys shift_off (landscape) */
-/* keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBO...
+ keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBOAR...
keyList[KEYMODE_JA_FULL_HIRAGANA][0] = new Keyb...
keyList[KEYMODE_JA_FULL_HIRAGANA][1] = new Keyb...
keyList[KEYMODE_JA_FULL_ALPHABET][0] = new Keyb...
@ -888,9 +888,9 @@
keyList[KEYMODE_JA_HALF_KATAKANA][0] = new Keyb...
keyList[KEYMODE_JA_HALF_KATAKANA][1] = new Keyb...
keyList[KEYMODE_JA_HALF_PHONE][0] = new Keyb...
-*/
+
/* 12-keys shift_on (landscape) */
-/* keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBO...
+ keyList = mKeyboard[LANG_JA][LANDSCAPE][KEYBOAR...
keyList[KEYMODE_JA_FULL_HIRAGANA]
= mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_12...
keyList[KEYMODE_JA_FULL_ALPHABET]
@@ -907,7 +907,7 @@
= mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_12...
keyList[KEYMODE_JA_HALF_PHONE]
= mKeyboard[LANG_JA][LANDSCAPE][KEYBOARD_12...
-*/
+
}
After the change is completed. '''OpenWnn''' can be buil...
$ cd ~/android-1.5_r3/build/
$ source envsetup.sh
$ cd ~/android-1.5_r3/packages/inputmethods/OpenWnn
$ mm
Finally, the lib files for OpenWnn are built under '''~/a...
* Create android-root [#zbcb0c89]
** Place the built android file [#bdd6a20a]
>
The whole build process described above is completed, the...
$ cd ~/
$ mkdir android-root
$ cp -a ~/android-1.5r2/out/target/product/generic/root/...
$ cp -a ~/android-1.5r2/out/target/product/generic/syste...
** Place kernel module [#b5069bc3]
>
The '''rt73usb''' related kernel module and the firmware ...
users turn on/off Wi-Fi from GUI of android via applying ...
are shown below.~
Caution: As using kernel module, bc9 is needed to be boot...
$ mkdir ~/android-root/system/lib/modules/
$ cp ~/kernel_work/linux-android-2.6.29-bc9-r6/drivers/n...
$ mkdir ~/android-root/system/etc/
$ cp kernel_work/RT71W_Firmware_V1.8/LICENSE.ralink-firm...
$ cp kernel_work/RT71W_Firmware_V1.8/rt73.bin android-ro...
** Edit init.rc [#b81dc61b]
>
The confutations of '''android-root/init.rc''' is needed ...
--- init.rc.orig 2009-08-30 14:59:02.000000000 +0...
+++ init.rc 2009-09-01 15:34:35.000000000 +0900
@@ -36,16 +36,16 @@
# mount mtd partitions
# Mount /system rw first to give the filesystem a c...
- mount yaffs2 mtd@system /system
- mount yaffs2 mtd@system /system ro remount
+ # mount yaffs2 mtd@system /system
+ # mount yaffs2 mtd@system /system ro remount
# We chown/chmod /data again so because mount is ru...
- mount yaffs2 mtd@userdata /data nosuid nodev
+ # mount yaffs2 mtd@userdata /data nosuid nodev
chown system system /data
chmod 0771 /data
# Same reason as /data above
- mount yaffs2 mtd@cache /cache nosuid nodev
+ # mount yaffs2 mtd@cache /cache nosuid nodev
chown system cache /cache
chmod 0770 /cache
@@ -78,10 +78,35 @@
chown root root /cache/lost+found
chmod 0770 /cache/lost+found
+ chmod 0666 /dev/bc9_leds
+
+ setprop alsa.mixer.playback.master Master
+ setprop alsa.mixer.capture.master Capture
+ setprop alsa.mixer.playback.earpiece Master
+ setprop alsa.mixer.capture.earpiece Capture
+ setprop alsa.mixer.playback.headset Master
+ setprop alsa.mixer.playback.speaker Master
+ chmod 0777 /dev/pcmC0D0c
+ chmod 0777 /dev/pcmC0D0p
+ chmod 0777 /dev/controlC0
+ chmod 0777 /dev/timer
+ chown root audio /dev/controlC
+ chown root audio /dev/pcmC0D0c
+ chown root audio /dev/pcmC0D0p
+ chown root audio /dev/timer
+
+ # create wifi filesystem structure
+ mkdir /data/misc/wifi 0770 system system
+ mkdir /data/misc/wifi/sockets 0770 system system
+ mkdir /data/system/wpa_supplicant 0770 system system
+ mkdir /data/misc/dhcp 0770 dhcp dhcp
+ chown dhcp dhcp /data/misc/dhcp
+
+
on boot
# basic network init
ifup lo
- hostname localhost
+ hostname bc9
domainname localdomain
# set RLIMIT_NICE to allow priorities from 19 to -20
@@ -110,6 +135,9 @@
setprop ro.CONTENT_PROVIDER_MEM 5632
setprop ro.EMPTY_APP_MEM 6144
+ setprop wifi.interface wlan0
+ setprop wlan.driver.status ok
+
# Write value must be consistent with the above propert...
# Note that the driver only supports 6 slots, so we hav...
# same memory level as services.
@@ -204,11 +232,11 @@
service debuggerd /system/bin/debuggerd
-service ril-daemon /system/bin/rild
- socket rild stream 660 root radio
- socket rild-debug stream 660 radio system
- user root
- group radio cache inet misc
+#service ril-daemon /system/bin/rild
+# socket rild stream 660 root radio
+# socket rild-debug stream 660 radio system
+# user root
+# group radio cache inet misc
service zygote /system/bin/app_process -Xzygote /system...
socket zygote stream 666
@@ -219,38 +247,59 @@
user media
group system audio camera graphics inet net_bt net_...
-service bootsound /system/bin/playmp3
- user media
- group audio
- oneshot
-
-service dbus /system/bin/dbus-daemon --system --nofork
- socket dbus stream 660 bluetooth bluetooth
- user bluetooth
- group bluetooth net_bt_admin
-
-service hcid /system/bin/hcid -s -n -f /etc/bluez/hcid....
- socket bluetooth stream 660 bluetooth bluetooth
- socket dbus_bluetooth stream 660 bluetooth bluetooth
- # init.rc does not yet support applying capabilitie...
- # let hcid drop uid to bluetooth with the right lin...
- group bluetooth net_bt_admin misc
- disabled
+#service bootsound /system/bin/playmp3
+# user media
+# group audio
+# oneshot
+
+#service dbus /system/bin/dbus-daemon --system --nofork
+# socket dbus stream 660 bluetooth bluetooth
+# user bluetooth
+# group bluetooth net_bt_admin
+
+#service hcid /system/bin/hcid -s -n -f /etc/bluez/hcid...
+# socket bluetooth stream 660 bluetooth bluetooth
+# socket dbus_bluetooth stream 660 bluetooth bluetooth
+# # init.rc does not yet support applying capabiliti...
+# # let hcid drop uid to bluetooth with the right li...
+# group bluetooth net_bt_admin misc
+# disabled
+
+#service hfag /system/bin/sdptool add --channel=10 HFAG
+# user bluetooth
+# group bluetooth net_bt_admin
+# disabled
+# oneshot
+
+#service hsag /system/bin/sdptool add --channel=11 HSAG
+# user bluetooth
+# group bluetooth net_bt_admin
+# disabled
+# oneshot
+
+
+#service wlan_loader /system/bin/wlan_loader
+# disabled
+# oneshot
+
+service ifcfg_ralink /system/bin/ifconfig wlan0 up
+# disabled
+# oneshot
+
+service wpa_supplicant /system/bin/logwrapper /system/b...
+ disabled
+ group system
+
+service dhcpcd /system/bin/logwrapper /system/bin/dhcpc...
+ disabled
+ oneshot
+ #group system dhcp
-service hfag /system/bin/sdptool add --channel=10 HFAG
- user bluetooth
- group bluetooth net_bt_admin
- disabled
- oneshot
-
-service hsag /system/bin/sdptool add --channel=11 HSAG
- user bluetooth
- group bluetooth net_bt_admin
- disabled
- oneshot
+on property:init.svc.wpa_supplicant=stopped
+ stop dhcpcd
service installd /system/bin/installd
socket installd stream 600 system system
-service flash_recovery /system/bin/flash_image recovery...
- oneshot
+#service flash_recovery /system/bin/flash_image recover...
+# oneshot
** Configure alsa file [#l1b4d2b6]
>
Copy the ALSA configuration files at '''/android-root/sys...
&ref(asound.conf); & &ref(asound.state);
*** asound.state [#na58f801]
>
'''asound.state''' is generated at OpenEmbedded's directo...
*** asound.conf [#r5b26285]
>
'''asound.conf''' is created for letting each control wor...
** vold configuration file [#e4faef1e]
>
For Android, SDcard is mounted as '''/system/bin/vold/'''...
'''vold''' works as its configuration file, which is loca...
is defined as shown below.~
## vold configuration file for bc9
volume_sdcard {
media_path /devices/platform/pxa2xx-mci.0/mmc_host...
media_type mmc
mount_point /sdcard
ums_path /devices/platform/usb_mass_storage/lun0
}
Because of this configuration, the first partition of mic...
Put the files pictures, audio, and videos on the first pa...
** Configuration of button setting [#m84f94ba]
>
From the top, bc9's buttons are set for, HOME, MENU, and ...
bc9 has three buttons, which is connected via GPIO. The b...
used for HOME, MENU, and BACK. To use the buttons, modify...
--- qwerty.kl.orig 2009-09-01 16:44:37.000000000 +0900
+++ qwerty.kl 2009-09-01 16:45:24.000000000 +0900
@@ -11,18 +11,18 @@ key 10 9
key 11 0
key 158 BACK WAKE_DROPPED
key 230 SOFT_RIGHT WAKE
-key 60 SOFT_RIGHT WAKE
+key 60 MENU WAKE
key 107 ENDCALL WAKE_DROPPED
key 62 ENDCALL WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
-key 59 MENU WAKE_DROPPED
+key 59 HOME WAKE
key 127 SEARCH WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 228 POUND
key 227 STAR
key 231 CALL WAKE_DROPPED
-key 61 CALL WAKE_DROPPED
+key 61 BACK WAKE
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
** default.prop [#n0dda072]
>
At the end of '''default.prop''', set up the IP of OpenDN...
(If the use of OpenDNS is prohibited, set up any availabl...
net.eth0.dns1=208.66.222.222
net.dns1=208.67.222.222
** Screen Timeout [#lf1e3dc9]
>
Since Power Management function is cancelled by applicati...
will not turn on again. Screen Timeout is needed to be tu...
-[Menu] - [Settings] ? [Sound & display] ? [Screen timeou...
** device_provisioned [#e4861d6d]
>
activation related setting affects on the Open Source ver...
Giving the command, shown below, on the file, android bec...
This should be on Linux and applying sqlite3.)
# cd /data/data/com.android.providers.settings/databases
# sqlite3 settings.db
sqlite> insert into "secure" values(NULL,"device_provisi...
sqlite> .exit
Once android is activated, the key lock dialog will be a...
Before android is activated, HOME~
screen immediately appears after android is booted. After...
pushing MENU button, reach HOME screen. On the key lock ...
capable of connecting to 3G communication. Ethernet can b...
~
As users fails to activate android, these issues are reco...
-HOME key is cancelled.
-While android is booting, key dialog does not appears.~
>
This ends the build and preparation process of android 1....
Page: