Details

    • Platform/s:
      Android

      Description

      Qt for Android build complains about some deprecation in the java codes, by enabling the "-Xlint:deprecation" javac flag we get a list of warnings:

      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java:333: warning: [deprecation] addAction(int) in AccessibilityNodeInfo has been deprecated
                  node.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
                      ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java:336: warning: [deprecation] addAction(int) in AccessibilityNodeInfo has been deprecated
                  node.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
                      ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java:584: warning: [deprecation] newInstance() in Class has been deprecated
                        Object staticInitDataObject = initClass.newInstance(); // create an instance
                                                               ^
        where T is a type-variable:
          T extends Object declared in class Class
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java:776: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                      m_splashScreen.setImageDrawable(m_activity.getResources().getDrawable(id));
                                                                               ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java:1173: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                      m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId));
                                                                                            ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/EditContextView.java:79: warning: [deprecation] getColor(int) in Resources has been deprecated
                  setTextColor(getResources().getColor(R.color.widget_edittext_dark));
                                             ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/EditContextView.java:80: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                  EditContextView.this.setBackground(getResources().getDrawable(R.drawable.editbox_background_normal));
                                                                   ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:77: warning: [deprecation] fromHtml(String) in Html has been deprecated
              m_text = Html.fromHtml(text);
                           ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:112: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                  return m_activity.getResources().getDrawable(typedValue.resourceId);
                                                  ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:122: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                          return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_info);
                                                          ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:136: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                          return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_alert);
                                                          ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:143: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                          return m_activity.getResources().getDrawable(android.R.drawable.ic_menu_help);
                                                          ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:154: warning: [deprecation] fromHtml(String) in Html has been deprecated
              m_title = Html.fromHtml(title);
                            ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:159: warning: [deprecation] fromHtml(String) in Html has been deprecated
              m_text = Html.fromHtml(text);
                           ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:164: warning: [deprecation] fromHtml(String) in Html has been deprecated
              m_informativeText = Html.fromHtml(informativeText);
                                      ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:169: warning: [deprecation] fromHtml(String) in Html has been deprecated
              m_detailedText = Html.fromHtml(text);
                                   ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:221: warning: [deprecation] ClipboardManager in android.text has been deprecated
                                  ClipboardManager cm = (android.text.ClipboardManager) m_activity.getSystemService(Context.CLIPBOARD_SERVICE);
                                  ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:221: warning: [deprecation] ClipboardManager in android.text has been deprecated
                                  ClipboardManager cm = (android.text.ClipboardManager) m_activity.getSystemService(Context.CLIPBOARD_SERVICE);
                                                                     ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:235: warning: [deprecation] setTextAppearance(Context,int) in TextView has been deprecated
                          view.setTextAppearance(m_activity, android.R.style.TextAppearance_Medium);
                              ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:252: warning: [deprecation] setTextAppearance(Context,int) in TextView has been deprecated
                          view.setTextAppearance(m_activity, android.R.style.TextAppearance_Medium);
                              ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:272: warning: [deprecation] setTextAppearance(Context,int) in TextView has been deprecated
                          view.setTextAppearance(m_activity, android.R.style.TextAppearance_Small);
                              ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:308: warning: [deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
                                      spacer.setBackgroundDrawable(getStyledDrawable("dividerVertical"));
                                            ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java:323: warning: [deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
                              horizontalDevider.setBackgroundDrawable(getStyledDrawable("dividerHorizontal"));
                                               ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java:126: warning: [deprecation] newInstance() in Class has been deprecated
                        Object staticInitDataObject = initClass.newInstance(); // create an instance
                                                               ^
        where T is a type-variable:
          T extends Object declared in class Class
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java:1413: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                                  json.put("TextView_textCursorDrawable", getDrawable(m_context.getResources().getDrawable(a.getResourceId(attr, 0)), styleName + "_TextView_textCursorDrawable", null));
                                                                                                              ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java:1511: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                                  json.put("TextView_textSelectHandleLeft", getDrawable(m_context.getResources().getDrawable(a.getResourceId(attr, 0)), styleName + "_TextView_textSelectHandleLeft", null));
                                                                                                                ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java:1521: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                                  json.put("TextView_textSelectHandleRight", getDrawable(m_context.getResources().getDrawable(a.getResourceId(attr, 0)), styleName + "_TextView_textSelectHandleRight", null));
                                                                                                                 ^
      /home/assam/sources/qt5/5.15/qt5/qtbase/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java:1531: warning: [deprecation] getDrawable(int) in Resources has been deprecated
                                  json.put("TextView_textSelectHandle", getDrawable(m_context.getResources().getDrawable(a.getResourceId(attr, 0)), styleName + "_TextView_textSelectHandle", null));
                                                                                                            ^
      28 warnings
      

      These warnings should be fixed, and potentially enable the previous flag by default, so that new deprecations don't go unnoticed.

      This issue, if not addressed, will continue showing up each time a qt app for android is being built with Gradle.

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qtandroidteam Qt Androidteam
            Reporter:
            assam Assam Boudjelthia
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes