Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114075

PrivateApi in QtActivityLoader

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • 6.5.1
    • QPA: Android
    • None
    • Android
    • 2f706df65 (dev)
    • 2023wk44FOQtforAndroid, 2023wk46FOQtforAndroid

    Description

      We get this linter issues in our app.

      /.../src/android/java/src/org/qtproject/qt/android/bindings/QtActivityLoader.java:79: Warning: Accessing internal APIs via reflection is not supported and may not work on all devices or in the future [PrivateApi]
                  m_activity.setTheme(Class.forName("android.R$style").getDeclaredField(QT_ANDROID_DEFAULT_THEME).getInt(null));
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
         Explanation for issues of type "PrivateApi":
         Using reflection to access hidden/private Android APIs is not safe; it will
         often not work on devices from other vendors, and it may suddenly stop
         working (if the API is removed) or crash spectacularly (if the API behavior
         changes, since there are no guarantees for compatibility).
      
         https://developer.android.com/preview/restrictions-non-sdk-interfaces
      

      Maybe line 65 is affected, too.

      Attachments

        Issue Links

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

          Activity

            People

              assam Assam Boudjelthia
              misery André Klitzing
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes