Einstein
Einstein copied to clipboard
Android Q lacks App Menu
Basic Information
- Platform (Mac, iOS, Android, Linux, etc): Android Q (Pixel 3a 10 (QP1A.191105.003)
- Built from source? (yes/no): yes
- If yes, source branch/revision ID: Master
Description of issue
App menu cannot be invoked, because no App icon appears. The app itself runs fine, but the application menu is not visible.
Expected behavior
Expected behavior documented here: https://rkixmiller.dudaone.com/old-hardware-emulated-einstein-emulating-the-apple-newton-part-3
Steps to reproduce issue
- Build and install the app.
- Observe that the app launches
- Observe that no Newton icon appears in the Android system tray
- Attempt to invoke the App menu by any other method

This seems to be related: https://stackoverflow.com/questions/16045722/android-notification-is-not-showing
Confirming, that adding a notification channel (per SO article above) fixes the problem -- however, I'm not sure if I've implemented this in a backward compatible fashion. Add the below to the raisePriority method of EinsteinService.java
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { String channelId = "EinsteinEmulator"; NotificationChannel channel = new NotificationChannel(channelId, "Einstein Emulator", NotificationManager.IMPORTANCE_DEFAULT); mNM.createNotificationChannel(channel); mBuilder.setChannelId(channelId); }
Also, replace the last line of the method startForeground(0x4e256cc5, mBuilder.build()); with:
mNM.notify(0x4e256cc5, mBuilder.build());
The menu is non-existent over here on 9 as well.