Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Added check to see if an extra that causes trouble on LG phones actua…
Browse files Browse the repository at this point in the history
…lly needs to be set before setting.
  • Loading branch information
James Thomas committed Jul 3, 2019
1 parent 074bfc2 commit 6860a17
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Media.Plugin/Android/IntentExtraExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ public static void UseBackCamera(this Intent intent)
// Android API 25 and up
intent.PutExtra(extraBackPost25, 1);

//Removed PutExtra. LG Phones crash when setting this intent and the back camera
// is already enabled (UserFront=false)

//TODO: Test if we can use the GetExtra to check before setting. May still fix LG
//with less potential negative side-effects for other phones or for the front-facing camera

//var val = intent.GetBooleanExtra(extraUserFront, false);
//if (val)
// intent.PutExtra(extraUserFront, false);
var val = intent.GetBooleanExtra(extraUserFront, false);
if (val)
intent.PutExtra(extraUserFront, false);
}
}
}

0 comments on commit 6860a17

Please sign in to comment.