I pass my answer from here on request:
Prevent my audio app using NuPlayer on Android Lollipop 5.x?
So, I finally found a way to safely detect whether or not it NuPlayerwill be used or not on Lollipop. It seems like the best strategy is to tell the user to open the developerโs settings and turn it on AwesomePlayeruntil Google installs NuPlayer. Unfortunately, there is no good way to change this parameter for the user, we can just read its value if you are not subscribed as a system application.
Android, , AwesomePlayer . Lollipop NuPlayer , , , NuPlayer .
SystemProperties.java , android.os (it JNI-, ).
, Lollipop/5.0, AwesomePlayer , (, ):
public void openDeveloperSettingsIfAwesomePlayerNotActivated(final Context context) {
final boolean useAwesome = SystemProperties.getBoolean("persist.sys.media.use-awesome", false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && !useAwesome) {
final Intent intent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
context.startActivity(intent);
}
}