The updated Google Phone app version 17 brings Floating Bubble feature to Pixel and Nexus devices. A main benefit of Floating Bubble is that you can turn on speaker phone, mute microphone, or hang up the call while you are on another app. You can access this feature by just pressing on the Home button while on a call. Here is how to get this feature on other devices.
Google Phone and Contact app offers several features, like answer or reject calls from the notification shade, real-time spam protection, caller ID, call blocking, voicemail transcription support (some region only), Google Duo video call integration, backup all of your contacts to the cloud, the new floating bubble and more.
The Google phone app is available on Nexus 5X, Nexus 6P, Pixel, Pixel XL, Pixel 2, and Pixel 2 XL and some Android One phones. If you have not received the updated version of Phone app (version 17.0), you can download the APK file from APK mirror [here] and sideload manually.
If you are using another dialer app, make Phone app default to get the new floating bubble feature. To do so, open Settings menu > select Apps and notification > Phone app > select Phone from the list. To access the floating bubble, jut press the Home button during a call.
How to get Floating Bubble on non-Google phones
Now, if Google Phone app does not support your device, but want to get the new floating bubble feature, a ported version of the app is available for download. Head over the XDA here, download the ported version and install it on your device (requires Android 6.0 Marshmallow and above).
After installation, make it your default dialer app. Note that not all features of Google Phone app are available with the ported version, like Spam Caller ID, Nearby Places, etc. (Source)