fix some linter warnings

This commit is contained in:
adbenitez
2023-10-07 21:59:26 +02:00
parent d125e0d8be
commit d4c763e282
5 changed files with 24 additions and 24 deletions
@@ -27,6 +27,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.ActionBar;
import androidx.core.app.TaskStackBuilder;
import androidx.core.content.pm.ShortcutInfoCompat;
import androidx.core.content.pm.ShortcutManagerCompat;
@@ -216,13 +217,16 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
private void setScreenMode() {
// enter/exit fullscreen mode depending on orientation (landscape/portrait),
// on tablets there is enought height so fullscreen mode is never enabled there
// on tablets there is enough height so fullscreen mode is never enabled there
boolean enable = getResources().getBoolean(R.bool.isLandscape) && !getResources().getBoolean(R.bool.isBigScreen);
getWindow().getDecorView().setSystemUiVisibility(enable? View.SYSTEM_UI_FLAG_FULLSCREEN : 0);
if (enable) {
getSupportActionBar().hide();
} else {
getSupportActionBar().show();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
if (enable) {
actionBar.hide();
} else {
actionBar.show();
}
}
}
@@ -281,19 +285,19 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
res = new WebResourceResponse("text/plain", "UTF-8", targetStream);
}
if (res != null) {
Map<String, String> headers = new HashMap<>();
headers.put("Content-Security-Policy",
"default-src 'self'; "
+ "style-src 'self' 'unsafe-inline' blob: ; "
+ "font-src 'self' data: blob: ; "
+ "script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ; "
+ "connect-src 'self' data: blob: ; "
+ "img-src 'self' data: blob: ; "
+ "media-src 'self' data: blob: ;"
+ "webrtc 'block' ; "
);
headers.put("X-DNS-Prefetch-Control", "off");
Map<String, String> headers = new HashMap<>();
headers.put("Content-Security-Policy",
"default-src 'self'; "
+ "style-src 'self' 'unsafe-inline' blob: ; "
+ "font-src 'self' data: blob: ; "
+ "script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ; "
+ "connect-src 'self' data: blob: ; "
+ "img-src 'self' data: blob: ; "
+ "media-src 'self' data: blob: ;"
+ "webrtc 'block' ; "
);
headers.put("X-DNS-Prefetch-Control", "off");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
res.setResponseHeaders(headers);
}
return res;
@@ -20,8 +20,6 @@ import org.thoughtcrime.securesms.util.ThemeUtil;
public class AvatarImageView extends AppCompatImageView {
private static final String TAG = AvatarImageView.class.getSimpleName();
private OnClickListener listener = null;
public AvatarImageView(Context context) {
@@ -44,7 +44,6 @@ public class PagingMediaLoader extends AsyncLoader<DcMediaGalleryElement> {
DcMsg unfound = context.getMsg(msg.getId());
Log.e(TAG, "did not find message in list: " + unfound.getId() + " / " + unfound.getFile() + " / " + unfound.getText());
}
DcMediaGalleryElement retVal = new DcMediaGalleryElement(mediaMessages, currentIndex, context, leftIsRecent);
return retVal;
return new DcMediaGalleryElement(mediaMessages, currentIndex, context, leftIsRecent);
}
}
@@ -124,7 +124,7 @@ public class ChatBackgroundActivity extends PassphraseRequiredActionBarActivity
Point size = new Point();
display.getSize(size);
// resize so that the larger side fits the screen accurately
int largerSide = (size.x > size.y ? size.x : size.y);
int largerSide = Math.max(size.x, size.y);
Bitmap scaledBitmap = GlideApp.with(context)
.asBitmap()
.load(imageUri)
@@ -10,7 +10,6 @@ import android.media.MediaExtractor;
import android.media.MediaFormat;
import android.os.Build;
import android.util.Log;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;