Skip to content

Commit

Permalink
use linting for target SDK 30
Browse files Browse the repository at this point in the history
Signed-off-by: Balint Erdosi <[email protected]>
  • Loading branch information
berdosi committed Apr 11, 2021
1 parent b02405f commit 9273f4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ android {
release {
}
}
compileSdkVersion 29
compileSdkVersion 30
buildToolsVersion '29.0.2'
defaultConfig {
applicationId "eu.berdosi.app.heartbeat"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/eu/berdosi/app/heartbeat/CameraService.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public void onConfigureFailed(@NonNull CameraCaptureSession session) {
};

try {
// deprecated in API 30, but changing it would bump minSdkVersion to 28.
//noinspection deprecation
camera.createCaptureSession(Collections.singletonList(previewSurface), stateCallback, null); //1
} catch (CameraAccessException e) {
if (e.getMessage() != null) {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/eu/berdosi/app/heartbeat/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import androidx.core.app.ActivityCompat;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.view.Menu;
Expand Down Expand Up @@ -43,7 +44,7 @@ public class MainActivity extends Activity implements ActivityCompat.OnRequestPe
private boolean justShared = false;

@SuppressLint("HandlerLeak")
private final Handler mainHandler = new Handler() {
private final Handler mainHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
Expand Down

0 comments on commit 9273f4d

Please sign in to comment.