apache / apache/cordova-android

deprecation warnings on java code

Open
#1,386 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
1.6k
Avg merge
16h 18m
Merged PRs (30d)
11

Description

# Bug Report
cordova's java code presents 17 deprecation warnings
they should be evaluated to replace the code or ignore the warning

## Problem

### What is expected to happen?

### What does actually happen?

## Information

Task :CordovaLib:compileReleaseJavaWithJavac
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:132: warning: [deprecation] FLAG_FULLSCREEN in LayoutParams has been deprecated
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:133: warning: [deprecation] FLAG_FULLSCREEN in LayoutParams has been deprecated
WindowManager.LayoutParams.FLAG_FULLSCREEN);
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:136: warning: [deprecation] FLAG_FORCE_NOT_FULLSCREEN in LayoutParams has been deprecated
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:137: warning: [deprecation] FLAG_FORCE_NOT_FULLSCREEN in LayoutParams has been deprecated
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:69: warning: [deprecation] startActivityForResult(Intent,int) in ComponentActivity has been deprecated
activity.startActivityForResult(intent, requestCode);
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:222: warning: [deprecation] onRequestPermissionResult(int,String[],int[]) in CordovaPlugin has been deprecated
callback.first.onRequestPermissionResult(callback.second, permissions, grantResults);
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:337: warning: [deprecation] SYSTEM_UI_FLAG_LAYOUT_STABLE in View has been deprecated
final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:338: warning: [deprecation] SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION in View has been deprecated
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:339: warning: [deprecation] SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN in View has been deprecated
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:340: warning: [deprecation] SYSTEM_UI_FLAG_HIDE_NAVIGATION in View has been deprecated
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:341: warning: [deprecation] SYSTEM_UI_FLAG_FULLSCREEN in View has been deprecated
| View.SYSTEM_UI_FLAG_FULLSCREEN
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:342: warning: [deprecation] SYSTEM_UI_FLAG_IMMERSIVE_STICKY in View has been deprecated
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:344: warning: [deprecation] setSystemUiVisibility(int) in View has been deprecated
getWindow().getDecorView().setSystemUiVisibility(uiOptions);
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:349: warning: [deprecation] startActivityForResult(Intent,int,Bundle) in ComponentActivity has been deprecated
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\CordovaActivity.java:352: warning: [deprecation] startActivityForResult(Intent,int,Bundle) in ComponentActivity has been deprecated
super.startActivityForResult(intent, requestCode, options);
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java:38: warning: [deprecation] setAcceptFileSchemeCookies(boolean) in CookieManager has been deprecated
cookieManager.setAcceptFileSchemeCookies(true);
^
E:\kopija\zoran\platforms\android\CordovaLib\src\org\apache\cordova\PermissionHelper.java:83: warning: [deprecation] onRequestPermissionResult(int,String[],int[]) in CordovaPlugin has been deprecated
plugin.onRequestPermissionResult(requestCode, permissions, requestResults);
^
17 warnings

### Command or Code

### Environment, Platform, Device

windows 10

### Version information

cordova 10.1.1
no plugins test aplication
Android studio ARCTIC FOX 2020.3.1

## Checklist

- [ x ] I searched for existing GitHub issues
- [ x ] I updated all Cordova tooling to most recent version
- [ x ] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start by running the CordovaLib compileReleaseJavaWithJavac task and reviewing the deprecated calls listed in CordovaActivity.java, CordovaInterfaceImpl.java, SystemCookieManager.java, and PermissionHelper.java. Determine whether each warning should be replaced or explicitly ignored; done means the 17 warnings have been evaluated and the resulting build output reflects those decisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.