Nokia had long term plan which looked promising: They bought first Trolltech for QT and after that started doing Meego* (albeit too slowly) but the idea was to have one development platform for all their new and old phone platforms and QT fit the bill really nicely. But in the end the QT plan was really half-assed because getting it into Symbian took too long time and Meego was even slower project.
The first Meego phone N9 and it's unpublished sibling N950 (with the best qwerty hardware ever) were better phones than Android phones at that time, but when they released the N9 it was already known that Nokia will switch to Windows Phone and there was no point in buying N9 or developing apps for it.
They even had the QT + QT Quick setup working and showing lots of promise for writing javascript apps for different platforms. Sigh.
So if they've had the guts to execute the QT plan and Meego as a first priority projects + skipping Elop, the situation could be a lot different. Meego still feels more Linuxy than Android.
* Of course creating first Maemo on top of GTK and after that switching to QT sounded weird and with Meego there was other parties like Samsung and Intel meddling around so they lost lot of steam in that transition too.