Solution.

1) Open external/dhcpcd/Android.mk and uncomment next lines:

include $(CLEAR_VARS)
LOCAL_MODULE := dhcpcd.conf
LOCAL_MODULE_TAGS := user
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(etc_dir)
LOCAL_SRC_FILES := android.conf
include $(BUILD_PREBUILT)

by default they are commented.

2) frameworks/base/wifi/java/android/net/wifi/WifiStateTracker.java
and change:

mInterfaceName = SystemProperties.get("wifi.interface", "tiwlan0");

on your wifi interface. In my case it's wlan0:

mInterfaceName = SystemProperties.get("wifi.interface", "wlan0");

3) verify in init.rc or init.platform.rc dhcpcd service configuration.
In my case it is:

service dhcpcd /system/bin/dhcpcd -d wlan0
    group system dhcp
    disabled
    oneshot

Verify that -d option is set before wifi interface name, otherwise
dhcpcd will not call dhcpcd-run-hooks script.

4) verify system.prop file, should me a line:
wifi.interface=your_wifi_interface

in my case it is:

wifi.interface=wlan0


That's it.

Good luck!

On May 19, 9:39 pm, Robert Greenwalt <rgreenw...@google.com> wrote:
> weird - I checked my devices and it is of course present..  If you know the
> default build comments it out you could file a bug against it.
>
> Sry about the hassle and congratulations on your progress!
>
> R
>
> On Wed, May 19, 2010 at 11:17 AM, supermaximus79 
> <andruschenk...@mail.ru>wrote:
>
> > Solved. The problem was because there wasn't dhcpcd.conf file on my
> > file system. i don't know why, but by default it is commented in
> > Android.mk
>
> > On May 18, 1:12 pm, supermaximus79 <andruschenk...@mail.ru> wrote:
> > > Hello Robert!
> > > Today i debugged 20-dns.conf script and found the problem.
> > > It's a content of 20-dns.conf script, i included some debug messages:
>
> > > set_dns_props()
> > > {
> > >     echo "executing SET_DNS_PROPS"
> > >     case "${new_domain_name_servers}" in
> > >     "")   return 0;;
> > >     esac
>
> > >     echo "AFTER 1"
>
> > >     count=1
> > >     for i in 1 2 3 4; do
> > >         setprop dhcp.${interface}.dns${i} ""
> > >     done
>
> > >     echo "AFTER 2"
>
> > >     count=1
> > >     for dnsaddr in ${new_domain_name_servers}; do
> > >         setprop dhcp.${interface}.dns${count} ${dnsaddr}
> > >         echo "MAXXXXXXX"
> > >         echo ${dnsaddr}
> > >         count=$(($count + 1))
> > >     done
>
> > > }
>
> > > I don't see message "AFTER 1", which means that variable
> > > new_domain_name_servers = "" (Empty).
> > > But i don't know why. Is dhcpcd fill this variable
> > > new_domain_name_servers?
>
> > > my system properties:
> > > # begin build properties
> > > # autogenerated by buildinfo.sh
> > > ro.build.id=MASTER
> > > ro.build.display.id=MASTER.eng.root.20100517.205514
> > > ro.build.version.incremental=eng.root.20100517.205514
> > > ro.build.version.sdk=5
> > > ro.build.version.codename=AOSP
> > > ro.build.version.release=AOSP
> > > ro.build.date=Mon May 17 20:56:02 EEST 2010
> > > ro.build.date.utc=1274118962
> > > ro.build.type=user
> > > ro.build.user=root
> > > ro.build.host=haha
> > > ro.build.tags=test-keys
> > > ro.product.model=AOSP on Pegasus (US, RU)
> > > ro.product.brand=pegasus
> > > ro.product.name=pegasus
> > > ro.product.device=pegasus
> > > ro.product.board=
> > > ro.product.cpu.abi=armeabi
> > > ro.product.manufacturer=mgr
> > > ro.product.locale.language=en
> > > ro.product.locale.region=US
> > > ro.wifi.channels=
> > > ro.board.platform=pegasus
> > > # ro.build.product is obsolete; use ro.product.device
> > > ro.build.product=pegasus
> > > # Do not try to parse ro.build.description or .fingerprint
> > > ro.build.description=pegasus-user AOSP MASTER eng.root.20100517.205514
> > > test-keys
> > > ro.build.fingerprint=pegasus/pegasus/pegasus/:AOSP/MASTER/eng.root.
> > > 20100517.205514:user/test-keys
> > > # end build properties
> > > #
> > > # system.prop for Pegasus
> > > #
>
> > > #rild.libpath=/system/lib/libhtc_ril.so
> > > wifi.interface=wlan0
> > > # Time between scans in seconds. Keep it high to minimize battery
> > > drain.
> > > # This only affects the case in which there are remembered access
> > > points,
> > > # but none are in range.
> > > wifi.supplicant_scan_interval = 45
>
> > > # density in DPI of the LCD of this board. This is used to scale the
> > > UI
> > > # appropriately. If this property is not defined, the default value is
> > > 160 dpi..
> > > ro.sf.lcd_density = 128
>
> > > # Default network type
> > > # 0 => WCDMA Preferred.
> > > #ro.telephony.default_network = 0
>
> > > #
> > > # ADDITIONAL_BUILD_PROPERTIES
> > > #
> > > ro.config.notification_sound=OnTheHunt.ogg
> > > ro.config.alarm_alert=Alarm_Classic.ogg
> > > net.bt.name=Android
> > > ro.config.sync=yes
> > > dalvik.vm.stack-trace-file=/data/anr/traces.txt
>
> > > On May 17, 11:27 pm, Robert Greenwalt <rgreenw...@google.com> wrote:
>
> > > > Your WifiStateTracker reports:
>
> > > > V/WifiStateTracker( 1731): IP configuration: ipaddr 192.168.1.101
> > > > gateway 192.168.1.1 netmask 255.255.255.0 dns1 0.0.0.0 dns2 0.0.0.0
> > > > DHCP server 192.168.1.1 lease 7200 seconds
>
> > > > so the mDhcpInfo object seems to not know what's up regarding dns.  Can
> > you
> > > > include the system properties to your log (or use "adb bugreport >
> > foo")?
>
> > > > R
>
> > > > On Mon, May 17, 2010 at 12:56 PM, supermaximus79 <
> > andruschenk...@mail.ru>wrote:
>
> > > > > Thanks!
>
> > > > > I verified in WifiStateTracker constructor interfaces names, here
> > they
> > > > > are:
> > > > > DNS1 = dhcp.wlan0.dns1
> > > > > DNS2 = dhcp.wlan0.dns2
> > > > > Looks like everything is ok
>
> > > > > But still there is empty DNS.
> > > > > My logs:
>
> > > > > init: starting
> > > > > 'wpa_supplicant'
> > > > > D/WifiService( 1731): ACTION_BATTERY_CHANGED pluggedType:
> > > > > 1
> > > > > E/WifiHW  ( 1731): Unable to open connection to supplicant on
> > "wlan0":
> > > > > No such file or
> > > > > directory
> > > > > D/SettingsWifiEnabler( 1967): Received wifi state changed from
> > > > > Enabling to
> > > > > Enabled
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-STATE-CHANGE id=-1
> > > > > state=2
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > > > > Ready
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > > > > Ready
> > > > > E/SettingsWifiLayer( 1967): Unable to scan for
> > > > > networks
> > > > > I/NotificationService( 1731): enqueueToast pkg=com.android.settings
> > > > > callback=android.app.itransientnotification$stub$pr...@438e6b28
> > > > > duration=1
> > > > > ioctl[SIOCSIWPRIV]: Operation not
> > > > > permitted
> > > > > E/wpa_supplicant( 2386): wpa_driver_priv_driver_cmd
> > > > > failed
> > > > > V/WifiStateTracker( 1731): Connection to supplicant established,
> > > > > state=SCANNING
> > > > > D/NetworkStateTracker( 1731): setDetailed state, old =DISCONNECTED
> > and
> > > > > new
> > > > > state=SCANNING
> > > > > D/ConnectivityService( 1731): ConnectivityChange for WIFI:
> > > > > DISCONNECTED/
> > > > > SCANNING
> > > > > D/DataConnectionTracker( 1841): enableApnType(default),
> > > > > isApnTypeActive = false and state =
> > > > > IDLE
> > > > > ioctl[SIOCSIWPRIV]: Operation not
> > > > > permitted
> > > > > E/wpa_supplicant( 2386): wpa_driver_priv_driver_cmd
> > > > > failed
> > > > > I/ActivityManager( 1731): Start proc android.process.media for
> > > > > broadcast com.android.providers.downloads/.DownloadReceiver: pid=2389
> > > > > uid=10010 gids={1006, 1015, 2001, 3003}
> > > > > I/dalvikvm( 2389): Debugger thread not active, ignoring DDM send
> > > > > (t=0x41504e4d
> > > > > l=38)
> > > > > I/dalvikvm( 2389): Debugger thread not active, ignoring DDM send
> > > > > (t=0x41504e4d
> > > > > l=46)
> > > > > I/ActivityThread( 2389): Publishing provider drm:
> > > > > com.android.providers.drm.DrmProvider
> > > > > I/ActivityThread( 2389): Publishing provider media:
> > > > > com.android.providers.media.MediaProvider
> > > > > V/MediaProvider( 2389): Attached volume:
> > > > > internal
> > > > > I/ActivityThread( 2389): Publishing provider downloads:
> > > > > com.android.providers.downloads.DownloadProvider
> > > > > I/ActivityManager( 1731): Exiting empty application process
> > > > > android.process.media
> > > > > (android.os.binderpr...@437fed50)
> > > > > I/Process ( 1731): Sending signal. PID: 2389 SIG:
> > > > > 9
> > > > > D/ActivityManager( 1731): Received spurious death notification for
> > > > > thread
> > > > > android.os.binderpr...@437fed50
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > > > > Ready
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > > > > Ready
> > > > > E/SettingsWifiLayer( 1967): Could not set highest priority on state
> > > > > because saving config
> > > > > failed.
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-SCAN-RESULTS
> > > > > Ready
> > > > > I/wpa_supplicant( 2386): Trying to associate with 00:27:19:18:36:a2
> > > > > (SSID='11g' freq=2437
> > > > > MHz)
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-STATE-CHANGE id=-1
> > > > > state=3
> > > > > I/wpa_supplicant( 2386): Association request to the driver
> > > > > failed
> > > > > V/WifiMonitor( 1731): Event [Trying to associate with
> > > > > 00:27:19:18:36:a2 (SSID='11g' freq=2437
> > > > > MHz)]
> > > > > V/WifiMonitor( 1731): Event [CTRL-EVENT-STATE-CHANGE id=-1
> > > > > state=3]
> > > > > V/WifiStateTracker( 1731): Changing supplicant state: SCANNING ==>
> > > > > ASSOCIATING
> > > > > D/NetworkStateTracker( 1731): setDetailed state, old =SCANNING and
> > new
> > > > > state=CONNECTING
> > > > > D/ConnectivityService( 1731): ConnectivityChange for WIFI:
> > CONNECTING/
> > > > > CONNECTING
> > > > > V/WifiMonitor( 1731): Event [Association request to the driver
> > > > > failed]
> > > > > D/dalvikvm( 1731): GC freed 13858 objects / 699376 bytes in
> > > > > 234ms
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-STATE-CHANGE id=0
> > > > > state=4
> > > > > I/wpa_supplicant( 2386): Associated with
> > > > > 00:27:19:18:36:a2
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-STATE-CHANGE id=0
> > > > > state=7
> > > > > I/wpa_supplicant( 2386): CTRL-EVENT-CONNECTED - Connection to
> > > > > 00:27:19:18:36:a2 completed (auth) [id=0
> > > > > id_str=]
> > > > > V/WifiMonitor( 1731): Event [CTRL-EVENT-STATE-CHANGE id=0
> > > > > state=4]
> > > > > V/WifiStateTracker( 1731): Changing supplicant state: ASSOCIATING ==>
> > > > > ASSOCIATED
> > > > > D/NetworkStateTracker( 1731): setDetailed state, old =CONNECTING and
> > > > > new
> > > > > state=CONNECTING
> > > > > V/WifiMonitor( 1731): Event [Associated with
> > > > > 00:27:19:18:36:a2]
> > > > > V/WifiMonitor( 1731): Event [CTRL-EVENT-STATE-CHANGE id=0
> > > > > state=7]
> > > > > V/WifiStateTracker( 1731): Changing supplicant state: ASSOCIATED ==>
> > > > > COMPLETED
> > > > > V/WifiMonitor( 1731): Event [CTRL-EVENT-CONNECTED - Connection to
> > > > > 00:27:19:18:36:a2 completed (auth) [id=0
> > > > > id_str=]]
> > > > > V/WifiStateTracker( 17init: starting
> > > > > 'dhcpcd'
> > > > > 31): New network state is
> > > > > CONNECTED
> > > > > D/NetworkStateTracker( 1731): setDetailed state, old =CONNECTING and
> > > > > new
> > > > > state=OBTAINING_IPADDR
> > > > > D/WifiStateTracker( 1731): DhcpHandler: DHCP request
>
> ...
>
> read more »

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to