Is CyanogenMod/android_packages_apps_SamsungServiceMode related to this? And if not what is it?No, because CM dev people doesn't seem to know how the SM works and have messed up some of the standard functionality when it come to SM related items and "secret codes". Unfortunayely this is not only true for CM, but also most other AOSP based ROMs. SM is usually provided by a (java) wrapper application to send OEM commands to the baseband where the SM is actually running. So, you can try to install a copy of the Factory and Service related apps, as found on the stock rom of your device (using the same API version).