Skip to content

Commit

Permalink
wait to allow HAL closes all camera
Browse files Browse the repository at this point in the history
camera close call is aync call, multi camera exit soon after
placing request which create issue in camera HAL as buffer
release fail.

wait for 100 msec to allow HAL release all the buffers.

Tracked-On: OAM-125256
Signed-off-by: shivasku82 <[email protected]>
  • Loading branch information
shivasku82 committed Oct 8, 2024
1 parent 5849dc8 commit 1d0280e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,16 @@ protected void onResume() {
@Override
protected void onStop() {
super.onStop();
Log.v(TAG, "onStop");
if(isSwitchingActivity == false)
Log.v(TAG, " onStop");
if(isSwitchingActivity == false) {
closeCamera();
try {
// Sleep for 100ms to allow all camera to close properly
TimeUnit.MILLISECONDS.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.exit(0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,16 @@ protected void onPause() {
protected void onStop() {
super.onStop();
Log.v(TAG, "onStop");
if(isSwitchingActivity == false)
System.exit(0);
if(isSwitchingActivity == false) {
closeCamera();
try {
// Sleep for 100 milliseconds
TimeUnit.MILLISECONDS.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.exit(0);
}
}

public void settingView(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,15 @@ protected void onResume() {
protected void onStop() {
super.onStop();
Log.v(TAG, "onStop");
if(isSwitchingActivity == false)
if(isSwitchingActivity == false) {
closeCamera();
try {
// Sleep for 100ms to allow all camera to close properly
TimeUnit.MILLISECONDS.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.exit(0);
}
}
}

0 comments on commit 1d0280e

Please sign in to comment.