Messaging: Nullability
Change-Id: I8bcde2a868a9c8989971d056be24ff4986e4f8f3
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +25,9 @@ import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.ui.PersistentInstanceState;
|
||||
import com.android.messaging.util.ThreadUtil;
|
||||
@@ -72,7 +76,7 @@ public class CameraMediaChooserView extends FrameLayout implements PersistentIns
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(final Canvas canvas) {
|
||||
protected void onDraw(@NonNull final Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
// If the canvas isn't hardware accelerated, we have to replace the HardwareCameraPreview
|
||||
// with a SoftwareCameraPreview which supports software rendering
|
||||
|
||||
@@ -31,6 +31,8 @@ import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.datamodel.DataModel;
|
||||
import com.android.messaging.datamodel.data.GalleryGridItemData;
|
||||
@@ -107,7 +109,7 @@ public class GalleryGridItemView extends FrameLayout {
|
||||
final Rect region = new Rect(0, 0, getWidth(), getHeight());
|
||||
setTouchDelegate(new TouchDelegate(region, mCheckBox) {
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
public boolean onTouchEvent(@NonNull MotionEvent event) {
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
setPressed(true);
|
||||
|
||||
@@ -25,6 +25,8 @@ import android.util.AttributeSet;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@@ -44,23 +46,25 @@ public class HardwareCameraPreview extends TextureView implements CameraPreview.
|
||||
mPreview = new CameraPreview(this);
|
||||
setSurfaceTextureListener(new SurfaceTextureListener() {
|
||||
@Override
|
||||
public void onSurfaceTextureAvailable(final SurfaceTexture surfaceTexture, final int i, final int i2) {
|
||||
public void onSurfaceTextureAvailable(@NonNull final SurfaceTexture surfaceTexture,
|
||||
final int i, final int i2) {
|
||||
CameraManager.get().setSurface(mPreview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceTextureSizeChanged(final SurfaceTexture surfaceTexture, final int i, final int i2) {
|
||||
public void onSurfaceTextureSizeChanged(@NonNull final SurfaceTexture surfaceTexture,
|
||||
final int i, final int i2) {
|
||||
CameraManager.get().setSurface(mPreview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSurfaceTextureDestroyed(final SurfaceTexture surfaceTexture) {
|
||||
public boolean onSurfaceTextureDestroyed(@NonNull final SurfaceTexture surfaceTexture) {
|
||||
CameraManager.get().setSurface(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceTextureUpdated(final SurfaceTexture surfaceTexture) {
|
||||
public void onSurfaceTextureUpdated(@NonNull final SurfaceTexture surfaceTexture) {
|
||||
CameraManager.get().setSurface(mPreview);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,6 +23,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
@@ -708,8 +711,9 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
protected static final int READ_CONTACT_PERMISSION_REQUEST_CODE = 5;
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(
|
||||
final int requestCode, final String permissions[], final int[] grantResults) {
|
||||
public void onRequestPermissionsResult(final int requestCode,
|
||||
@NonNull final String permissions[],
|
||||
@NonNull final int[] grantResults) {
|
||||
if (mSelectedChooser != null) {
|
||||
mSelectedChooser.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,6 +24,8 @@ import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@@ -41,18 +44,18 @@ public class SoftwareCameraPreview extends SurfaceView implements CameraPreview.
|
||||
mPreview = new CameraPreview(this);
|
||||
getHolder().addCallback(new SurfaceHolder.Callback() {
|
||||
@Override
|
||||
public void surfaceCreated(final SurfaceHolder surfaceHolder) {
|
||||
public void surfaceCreated(@NonNull final SurfaceHolder surfaceHolder) {
|
||||
CameraManager.get().setSurface(mPreview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceChanged(final SurfaceHolder surfaceHolder, final int format, final int width,
|
||||
final int height) {
|
||||
public void surfaceChanged(@NonNull final SurfaceHolder surfaceHolder, final int format,
|
||||
final int width, final int height) {
|
||||
CameraManager.get().setSurface(mPreview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceDestroyed(final SurfaceHolder surfaceHolder) {
|
||||
public void surfaceDestroyed(@NonNull final SurfaceHolder surfaceHolder) {
|
||||
CameraManager.get().setSurface(null);
|
||||
}
|
||||
});
|
||||
@@ -60,7 +63,7 @@ public class SoftwareCameraPreview extends SurfaceView implements CameraPreview.
|
||||
|
||||
|
||||
@Override
|
||||
protected void onVisibilityChanged(final View changedView, final int visibility) {
|
||||
protected void onVisibilityChanged(@NonNull final View changedView, final int visibility) {
|
||||
super.onVisibilityChanged(changedView, visibility);
|
||||
mPreview.onVisibilityChanged(visibility);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,6 +30,8 @@ import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.util.LogUtil;
|
||||
|
||||
@@ -114,7 +117,7 @@ public class SoundLevels extends View {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(final Canvas canvas) {
|
||||
protected void onDraw(@NonNull final Canvas canvas) {
|
||||
if (!mIsEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -160,7 +162,7 @@ public class RenderOverlay extends FrameLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
public void draw(@NonNull Canvas canvas) {
|
||||
super.draw(canvas);
|
||||
if (mClients == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user