Merge pull request #10274 from osmandapp/fix_10216

Fix_10216
This commit is contained in:
vshcherb 2020-11-27 13:24:39 +01:00 committed by GitHub
commit c2d680183a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -930,11 +930,21 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
stopRecording(activity, false);
}
@Override
public void mapActivityResume(MapActivity activity) {
this.mapActivity = activity;
if (Build.VERSION.SDK_INT < 29) {
runAction(activity);
}
}
@Override
public void mapActivityResumeOnTop(MapActivity activity) {
this.mapActivity = activity;
// ((AudioManager) activity.getSystemService(Context.AUDIO_SERVICE)).registerMediaButtonEventReceiver(
// new ComponentName(activity, MediaRemoteControlReceiver.class));
runAction(activity);
}
private void runAction(MapActivity activity) {
if (runAction != -1) {
takeAction(activity, actionLon, actionLat, runAction);
runAction = -1;