Profile

Cover photo
Elliott Hughes
Works at Google
Lives in California, USA
878 followers|203,980 views
AboutPostsPhotosVideos

Stream

Elliott Hughes

Shared publicly  - 
 
New documentation about debugging various common kinds of native crash up on source.android.com this week: https://source.android.com/devices/tech/debug/native-crash.html

I actually wrote this to help folks in QA triage app compatibility crashes better, and it seems to have been helpful. The original internal version was based on actual app crashes from bugs.
17
9
Elliott Hughes's profile photoKarl Heimann's profile photo
3 comments
 
Any trick to track a web site change? For example when the documentation changed for Android.
Add a comment...

Elliott Hughes

Shared publicly  - 
 
We published the public docs for OEMs implementing A/B system updates today.

http://source.android.com/devices/tech/ota/ab_updates.html

Rom Lemarchand who leads the Android Systems Team gave a lightning talk at Linux Plumbers 2016 last week that has a fun diagram showing the new bootloader state machine (http://www.linuxplumbersconf.org/2016/ocw//system/presentations/3879/original/Android%20Background%20Updates%20-%20LPC%202016.pdf).
26
6
Add a comment...

Elliott Hughes

Shared publicly  - 
 
http://www.theverge.com/circuitbreaker/2016/9/17/12951694/iphone-7-home-button-glove-problem

Status: NeedsInfo

Please supply clearer repro steps... Specifically: what's a "glove", and where would we find one in the south bay?
Here's something that could be a little frustrating come winter: the iPhone 7's home button doesn't seem to work with most gloves. It turns out, Apple's new home button works more like a...
8
3
Rob Mellor's profile photo
 
Who gives a shit.
There have been conductive gloves for a decade now since all touch phone capacitive screens don't with with "normal" gloves.
The home button?!!! Who cares!
Guess what!? Finger print readers to unlock your phone don't with with gloves either. What a non story.
Add a comment...

Elliott Hughes

Shared publicly  - 
 
A brief history of Android's /system/bin...

This doesn't tell the full story, because the toolbox implementations did have bugs fixed and options added over the years. Gingerbread's rm, for example, supported -r/-R but not -f. But this gives you an idea of what was available in any given release, and how usable it was likely to be.

It's interesting that we had the BSD cat and dd since the beginning of time (well, Cupcake anyway; I didn't look further back than that), and that it was Jeff Sharkey who started moving more tools to the BSD implementations in Jellybean before I started in earnest in Lollipop. Lollipop was a major break with the past in many ways (LP64 support and the switch to ART both having lots of knock-on effects around the system), so although this was the beginning of the end of toolbox it (a) didn't stand out given all the other systems-level changes and (b) wasn't actually the direction we'd later take...

The move to toybox started in Marshmallow (well, in AOSP too late for Lollipop), and if you look at AOSP master today, dd, grep, and newfs_msdos are still BSD and only getevent is left of toolbox.


Android 2.3 (Gingerbread)

BSD: cat dd newfs_msdos

toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv nandread netstat notify printenv ps reboot renice rm rmdir rmmod route schedtop sendevent setconsole setprop sleep smd start stop sync top umount uptime vmstat watchprops wipe


Android 4.0 (IceCreamSandwich)

BSD: cat dd newfs_msdos

toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv nandread netstat notify printenv ps reboot renice rm rmdir rmmod route schedtop sendevent setconsole setprop sleep smd start stop sync top touch umount uptime vmstat watchprops wipe


Android 4.1-4.3 (Jellybean)

BSD: cat cp dd du grep newfs_msdos

toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln load_policy log ls lsmod lsof md5 mkdir mount mv nandread netstat notify printenv ps reboot renice restorecon rm rmdir rmmod route runcon schedtop sendevent setconsole setenforce setprop setsebool sleep smd start stop sync top touch umount uptime vmstat watchprops wipe


Android 4.4 (KitKat)

BSD: cat cp dd du grep newfs_msdos

toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln load_policy log ls lsmod lsof md5 mkdir mkswap mount mv nandread netstat notify printenv ps readlink renice restorecon rm rmdir rmmod route runcon schedtop sendevent setconsole setenforce setprop setsebool sleep smd start stop swapoff swapon sync top touch umount uptime vmstat watchprops wipe


Android 5.0 (Lollipop)

BSD: cat chown cp dd du grep kill ln mv printenv rm rmdir sleep sync

toolbox: chcon chmod clear cmp date df dmesg getenforce getevent getprop getsebool hd id ifconfig iftop insmod ioctl ionice load_policy log ls lsmod lsof md5 mkdir mknod mkswap mount nandread netstat newfs_msdos nohup notify ps readlink renice restorecon rmmod route runcon schedtop sendevent setenforce setprop setsebool smd start stop swapoff swapon top touch umount uptime vmstat watchprops wipe


Android 6.0 (Marshmallow)

BSD: dd du grep

toolbox: df getevent iftop ioctl ionice log ls lsof mount nandread newfs_msdos ps prlimit renice sendevent start stop top uptime watchprops

toybox: acpi basename blockdev bzcat cal cat chcon chgrp chmod chown chroot cksum clear comm cmp cp cpio cut date dirname dmesg dos2unix echo env expand expr fallocate false find free getenforce getprop groups head hostname hwclock id ifconfig inotifyd insmod kill load_policy ln logname losetup lsmod lsusb md5sum mkdir mknod mkswap mktemp modinfo more mountpoint mv netstat nice nl nohup od paste patch pgrep pidof pkill pmap printenv printf pwd readlink realpath restorecon rm rmdir rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort split stat strings swapoff swapon sync sysctl tac tail tar taskset tee time timeout touch tr true truncate umount uname uniq unix2dos usleep vmstat wc which whoami xargs yes


Android 7.0 (Nougat)

BSD: dd grep

toolbox: getevent iftop ioctl log nandread newfs_msdos ps prlimit sendevent start stop top

toybox: acpi base64 basename blockdev bzcat cal cat chcon chgrp chmod chown chroot cksum clear comm cmp cp cpio cut date df dirname dmesg dos2unix du echo env expand expr fallocate false find flock free getenforce getprop groups head hostname hwclock id ifconfig inotifyd insmod ionice iorenice kill killall load_policy ln logname losetup ls lsmod lsof lsusb md5sum mkdir mknod mkswap mktemp modinfo more mount mountpoint mv netstat nice nl nohup od paste patch pgrep pidof pkill pmap printenv printf pwd readlink realpath renice restorecon rm rmdir rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort split stat strings swapoff swapon sync sysctl tac tail tar taskset tee time timeout touch tr true truncate tty ulimit umount uname uniq unix2dos uptime usleep vmstat wc which whoami xargs xxd yes
35
12
William Maxwell Iceladen's profile photo
 
Looks awesome, at one time I replaced most of my gentoo userland with toybox, BusyBox, sbase-box and ubase-box
Add a comment...

Elliott Hughes

Shared publicly  - 
 
When someone like Satya Nadella (MS CEO) who really ought to know better says something that sounds like the kind of ignorant nonsense you'd usually hear from an arts student ("We humans have creativity, empathy, emotion, physicality, and insight that can then be mixed with powerful A.I. computation..." in his recent Slate article) it's hard not to wonder whether:

1. he's really not thought about this at all (nor ever read anything from anyone who has thought about this).
2. he harbors crypto-religious sentiments (humans having souls that machines can never have) that he's unwilling to state explicitly.
3. he's trying to calm the masses by pretending to them that they are actually unique and beautiful snowflakes and that mummy and daddy will always love them no matter what.
4. he's being deliberately misleading, not actually saying that machines can't have these things but leading us to infer them.

If the Brexit/Trump supporters are unhappy now, they're really going to hate the next 50/100 years. At least fear and hatred of the machines is likely to help humans get over their fear and hatred of each other.

In the meantime, http://smbc-comics.com/ regularly has web comics on these themes far more insightful than anything in Nadella's worthless article.
12
Luke Sleeman's profile photo
 
+1 for SMBC - for a random web comic, they tend to come up with some really interesting and amusing stuff.

As for if humans have something ineffably different from machine AI - I doubt it. We already know that human level intelligence can exist - albeit running on biological hardware. I see nothing fundamental to stop similar level intelligences being created ... though of course at the moment there are enormous practical problems: Namely, we don't know how to do it :-)
Add a comment...

Elliott Hughes

Shared publicly  - 
 
This week's blog post is a superset of last week's, covering all the dynamic linker changes NDK users need to be aware of:

http://android-developers.blogspot.com/2016/06/android-changes-for-ndk-developers.html
8
1
Add a comment...

Elliott Hughes

Shared publicly  - 
 
Ever wanted to download adb or fastboot without having to download the whole of Android Studio?

...but didn't want to download executables from some random warez site?

Good news this week:

https://developer.android.com/studio/releases/platform-tools.html

The links on that page will always return the adb/fastboot binaries currently shipping with Android Studio. No need to guess what the current version is, or update your own links: just follow these and get the latest binaries, direct from the source.

This is thanks to +Siva Velusamy and Kevin Quinn, not me.

(2017-01-09: Replaced the three direct links with the link to the new page, which will also include brief release notes.)
408
145
Pedro Mosqueda's profile photoCloudmouse Zhai's profile photoChris Druif (Automated Things)'s profile photoJimmy Z's profile photo
40 comments
Jimmy Z
 
+Chris Druif Windows peasants need these(probably outdated link): https://dl-ssl.google.com/android/repository/usb_driver_r11-windows.zip
Add a comment...

Elliott Hughes

Shared publicly  - 
 
My talk at Linux Plumbers 2016 was "Android Systems Programming Using the Java Language", which was a bit of background on the android.system package added in L:

https://www.linuxplumbersconf.org/2016/ocw//system/presentations/3741/original/Android%20Systems%20Programming%20in%20Java%20(linux%20plumbers%202016).pdf

(I would have called it android.os, but that was already taken.)
11
3
Michał Z.'s profile photoTrevor Drake (Steve Jones)'s profile photoElliott Hughes's profile photo
4 comments
 
+Trevor Drake Ugh. ioctl. Yeah, if you're writing platform code, and the ioctl in question is one that takes a single int* argument, there's ioctlInt. There are four other special-case overloads too. This was an attempt to impose some degree of type-safety on the mess that is ioctl.

But none of these are exposed as public API yet. I was hoping to gain some experience from platform users to try and help firm up the API, but in practice there's been very little use of ioctl over the years. I suspect this is in part because some of the most useful ones (such as FIONREAD) are already available via more traditional Java API. Whereas folks using BLKDISCARDZEROES or whatever are already deeply invested in lots of legacy native code anyway.

Luckily SELinux reduces the set of ioctls available to apps in each release anyway, so the problem is also solving itself. But, yeah, ioctl is probably the hardest system call to translate without getting into generic struct translation, which was out of scope.
Add a comment...

Elliott Hughes

Shared publicly  - 
 
The final release of NDK r13 went out last week.

Get it here (or direct from Android Studio) if you don't have it already: https://github.com/android-ndk/ndk/wiki

As part of the continued deprecation/removal of GCC, r13 makes clang the default compiler. If you have bugs keeping you from switching to clang, get them filed at the github site.

libc++ has been upgraded to match the platform version and to remove all the hacks that used to be in the NDK copy. Don't celebrate too soon, though: libandroid_support.a isn't dead yet, so all the bugs it introduces are still there.

The documentation for standalone toolchains has been rewritten and should be more accurate and helpful now: https://developer.android.com/ndk/guides/standalone_toolchain.html

Full change log here: https://github.com/android-ndk/ndk/wiki/Changelog-r13

9
1
Add a comment...

Elliott Hughes

Shared publicly  - 
 
Our continuous builds of the NDK can now be accessed by anyone with a Google account at http://partner.android.com/build. Select “Build List” from the menu on the left and then choose a branch and target from the menus at the top of the page.

Disclaimer: These builds are not suitable for production use. This is just a continuous build. The amount of testing these builds have been put through is minimal. A successful build only means that our test suite built successfully (and even then, not necessary on Windows).

But in future if you're told that your NDK bug has been fixed in AOSP, you can now (within a few hours) give it a spin without having to build it yourself.

As usual, thank Dan Albert.


https://android.googlesource.com/platform/ndk/+/master/docs/ContinuousBuilds.md
Continuous Builds. The NDK's continuous builds can be accessed by anyone with a Google account at http://partner.android.com/build. Select “Build List” from the menu on the left and then choose a branch and target from the menus at the top of the page. Disclaimer: These builds are not suitable ...
9
1
Add a comment...

Elliott Hughes

Shared publicly  - 
 
Surely that should say "Last but not least, we've made significant enhancements to the OTA update system to keep your device up-to-date much more easily with the latest system software and security patches"? :-)

http://android-developers.blogspot.com/2016/09/security-enhancements-in-nougat.html
13
4
Felipe Leme's profile photoDanny Arbeiter's profile photoElliott Hughes's profile photo
3 comments
 
If I follow the link it still says "Lastly, we've made significant enhancements to the OTA update system..." for me.
Add a comment...

Elliott Hughes

Shared publicly  - 
 
I recorded an episode of the confusingly named "ADB" podcast a few weeks ago. For once, this episode actually talks about the real adb. The NDK too. It's up now:

http://androidbackstage.blogspot.com/2016/07/episode-53-adb-on-adb.html

Being a manager and British, I always feel awkward promoting the work of others; worried that it looks like I'm taking credit. I did a reasonable job here, I think, except for the fact that I didn't mention Dan Albert's work on the NDK. It turns out that in a regular conversation it's easy to credit folks who worked on specific pieces -- you just mention their name when that piece comes up -- but it's actually hard to credit the guy who does everything. No small piece seems like the right time to credit them, and the whole never really comes up because it's the topic of the discussion.

Luckily, anyone who's been filing NDK bugs (https://github.com/android-ndk/ndk/issues) knows who's fixing them! But for those of you who haven't even been hitting any bugs lately, you have Dan Albert to thank...

Oh, and if you're the guy who first talked to me about toybox at the Linux Plumber's Conference in Germany a couple of years ago, my apologies for not knowing your name!
10
Add a comment...
Work
Occupation
Software Engineer
Employment
  • Google
    Software Engineer, 2008 - present
  • BlueArc
    present
  • GeneData
    present
Basic Information
Gender
Male
Relationship
Married
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
California, USA
Previously
England - Switzerland - Germany