In my Android app I wanted to check the source of app installation. I looked at the Android documentation and found the following API as part of the PackageManager class:
With regard to your question how was the app installed onto the device? Through "adb install" it will be null.
Using the following you should be able to override it to whatever you want for testing purposes.
pm install -i installername com.example.package
GooglePlay should have a value of com.google.android.feedback. I'm not sure what values other app stores use.