Dalvik was used up until Android 4.4. Since Android 5 Lollipop the Java Runtime Environment is called the 'Android Runtime' or just ART.
Java and MySQL were already out in the open as open source projects when Oracle acquired Sun though.
I don't know much about Android's history but if Dalvik was created exclusively by Google and they had no intention of open sourcing it fully... it'd be akin to a closed source Java app on top of the open source OpenJDK... which would be allowed.
You're right that broadly speaking, there is very little that could be done to stop this but having a culture of "everything GPL" in an organization definitely helps. For example, Sun was farsighted enough, though they couldn't stop Oracle from acquiring MySql, Oracle was still forced to keep MySql under GPL and they were able to salvage MariaDB too.
Similar was the case with Java. Oracle tried everything in its power to control its use and direction including legal means, it's only thanks to GPL that alternative implementations like OpenJDK and Amazon Corretto still exist. We can't even imagine the state of these software today if Sun hadn't licensed them under GPL originally but used some other permissive license instead!