Skip to content

Commit

Permalink
Fix issue #112
Browse files Browse the repository at this point in the history
  • Loading branch information
HBiSoft committed Apr 6, 2022
1 parent 6dae6c4 commit 9402714
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Binary file modified app/release/HBRecorderDemo.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,27 @@ public class ScreenRecordService extends Service {
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public int onStartCommand(final Intent intent, int flags, int startId) {
String pauseResumeAction = intent.getAction();
//Pause Recording
if (pauseResumeAction != null && pauseResumeAction.equals("pause")){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
pauseRecording();
}
boolean isAction = false;

//Check if there was an action called
if (intent != null && intent.getAction() != null){
isAction = true;
}
//Resume Recording
else if (pauseResumeAction != null && pauseResumeAction.equals("resume")){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
resumeRecording();

//If there was an action, check what action it was
//Called when recording should be paused or resumed
if (isAction){
//Pause Recording
if (intent.getAction().equals("pause")) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
pauseRecording();
}
}
//Resume Recording
else if (intent.getAction().equals("resume")){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
resumeRecording();
}
}
}
//Start Recording
Expand Down

0 comments on commit 9402714

Please sign in to comment.