Bug 309678

Summary: My app wants permission for phone contacts but I did not configure it that way
Product: [Unmaintained] Necessitas Reporter: Jean <jeancremers>
Component: Android QtCreatorAssignee: BogDan Vatra <bogdan>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: giantpune, sebsauer
Priority: NOR    
Version: alpha4   
Target Milestone: Unspecified   
Platform: Android   
OS: Android 4.x   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jean 2012-11-07 07:40:46 UTC
When my app installs it says it needs permission to access phone contacts. I did not activate this permission and it's not in the androidmanifest.xml either. I don't know how to get rid of it.

Reproducible: Always

Steps to Reproduce:
1. Create an app
2.Install it.
3.It asks phone permissions.
Comment 1 BogDan Vatra 2012-11-10 08:10:06 UTC
Please provide more information about your phone (e.g. Android version, ROM version, etc), some logs and a testing application.
Comment 2 Jean 2012-11-10 08:36:24 UTC
I just tried this with an empty app:
MainWindow::MainWindow(QWidget *parent)   : QMainWindow(parent)
{
 }
MainWindow::~MainWindow()
{
}

I tested on tweo devices:
-Htc Desire Bravo, cyanogenmod 7 
-QWare pro 3 tablet, custom rom from Ics.

Both want 'phone permissions'.

If there is more information you want, please ask.

Succes for you!


Logs:
Starting remote process...D/dalvikvm(  342): GC_EXTERNAL_ALLOC freed 52K, 53% free 2555K/5379K, external 410K/517K, paused 51ms
D/dalvikvm(  342): DexOpt: --- BEGIN 'QtIndustrius-7.jar' (bootstrap=0) ---
D/dalvikvm(  342): DexOpt: --- END 'QtIndustrius-7.jar' (success) ---
D/dalvikvm(  342): DEX prep '/data/data/org.kde.necessitas.ministro/files/qt/jar/QtIndustrius-7.jar': unzip in 80ms, rewrite 610ms
D/dalvikvm(  342): Trying to load lib /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtCore.so 0x40510230
D/dalvikvm(  342): Added shared lib /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtCore.so 0x40510230
D/dalvikvm(  342): No JNI_OnLoad found in /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtCore.so 0x40510230, skipping init
D/dalvikvm(  342): Trying to load lib /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtGui.so 0x40510230
D/dalvikvm(  342): Added shared lib /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtGui.so 0x40510230
D/dalvikvm(  342): No JNI_OnLoad found in /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtGui.so 0x40510230, skipping init
D/dalvikvm(  342): Trying to load lib /data/data/org.kde.necessitas.ministro/files/qt/plugins/platforms/android/libandroid-5.so 0x40510230
D/dalvikvm(  342): Added shared lib /data/data/org.kde.necessitas.ministro/files/qt/plugins/platforms/android/libandroid-5.so 0x40510230
I/Qt      (  342): qt start
D/dalvikvm(  342): Trying to load lib /data/data/org.kde.necessitas.example.symbols/lib/libsymbols.so 0x405147b0
D/dalvikvm(  342): Added shared lib /data/data/org.kde.necessitas.example.symbols/lib/libsymbols.so 0x405147b0
D/dalvikvm(  342): No JNI_OnLoad found in /data/data/org.kde.necessitas.example.symbols/lib/libsymbols.so 0x405147b0, skipping init
W/Qt      (  342): Can't set environment "" 
W/Qt      (  342): WARNING: QApplication was not created in the main() thread.
I/Qt JAVA (  342): surfaceChanged: 240,381,240,381
D/Qt      (  342): QAndroidPlatformIntegrationPlugin::create "android" 
D/Qt      (  342): Reading json file took 169 ms 
D/Qt      (  342): Parsing json file took 46 ms 
D/Qt      (  342): QAndroidPlatformIntegration::QAndroidPlatformIntegration():  creating QAndroidPlatformScreen => Using Raster (Software) for painting 
D/Qt      (  342): QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() 
W/dalvikvm(  342): dvmFindClassByName rejecting 'org/kde/necessitas/industrius/QtNativeInputConnection'
W/dalvikvm(  342): dvmFindClassByName rejecting 'org/kde/necessitas/industrius/QtExtractedText'
D/Qt      (  342): setFullScreen false 
D/Qt      (  342): setFullScreen false 
I/Qt JAVA (  342): surfaceDestroyed 


'org.kde.necessitas.example.symbols' died
Starting remote process...D/dalvikvm(  920): GC_EXTERNAL_ALLOC freed 55K, 53% free 2555K/5379K, external 410K/517K, paused 90ms
D/dalvikvm(  920): DexOpt: --- BEGIN 'QtIndustrius-7.jar' (bootstrap=0) ---
D/dalvikvm(  920): DexOpt: --- END 'QtIndustrius-7.jar' (success) ---
D/dalvikvm(  920): DEX prep '/data/data/org.kde.necessitas.ministro/files/qt/jar/QtIndustrius-7.jar': unzip in 106ms, rewrite 434ms
D/dalvikvm(  920): Trying to load lib /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtCore.so 0x40510af8
D/dalvikvm(  920): Added shared lib /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtCore.so 0x40510af8
D/dalvikvm(  920): No JNI_OnLoad found in /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtCore.so 0x40510af8, skipping init
D/dalvikvm(  920): Trying to load lib /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtGui.so 0x40510af8
D/dalvikvm(  920): Added shared lib /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtGui.so 0x40510af8
D/dalvikvm(  920): No JNI_OnLoad found in /data/data/org.kde.necessitas.ministro/files/qt/lib/libQtGui.so 0x40510af8, skipping init
D/dalvikvm(  920): Trying to load lib /data/data/org.kde.necessitas.ministro/files/qt/plugins/platforms/android/libandroid-5.so 0x40510af8
D/dalvikvm(  920): Added shared lib /data/data/org.kde.necessitas.ministro/files/qt/plugins/platforms/android/libandroid-5.so 0x40510af8
I/Qt      (  920): qt start
D/dalvikvm(  920): Trying to load lib /data/data/org.kde.necessitas.example.symbols/lib/libsymbols.so 0x40515078
D/dalvikvm(  920): Added shared lib /data/data/org.kde.necessitas.example.symbols/lib/libsymbols.so 0x40515078
D/dalvikvm(  920): No JNI_OnLoad found in /data/data/org.kde.necessitas.example.symbols/lib/libsymbols.so 0x40515078, skipping init
W/Qt      (  920): Can't set environment "" 
W/Qt      (  920): WARNING: QApplication was not created in the main() thread.
D/Qt      (  920): QAndroidPlatformIntegrationPlugin::create "android" 
I/Qt JAVA (  920): surfaceChanged: 240,381,240,381
D/Qt      (  920): Reading json file took 358 ms 
D/Qt      (  920): Parsing json file took 38 ms 
D/Qt      (  920): QAndroidPlatformIntegration::QAndroidPlatformIntegration():  creating QAndroidPlatformScreen => Using Raster (Software) for painting 
D/Qt      (  920): QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() 
W/dalvikvm(  920): dvmFindClassByName rejecting 'org/kde/necessitas/industrius/QtNativeInputConnection'
W/dalvikvm(  920): dvmFindClassByName rejecting 'org/kde/necessitas/industrius/QtExtractedText'
D/Qt      (  920): setFullScreen false 
D/Qt      (  920): setFullScreen false 
W/KeyCharacterMap(  920): No keyboard for id 0
W/KeyCharacterMap(  920): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
D/Qt      (  920): keyUp 
D/Qt      (  920): KEYCODE_BACK !!!! 
D/Qt      (  920): MainMethod finished, it's time to cleanup 
I/Qt JAVA (  920): surfaceDestroyed 
I/Qt JAVA (  920): onDestroy
Comment 3 BogDan Vatra 2012-11-10 08:44:57 UTC
Hmm your log doesn't contain any information about contacts.
Please provide a picture or a short movie, I still can't figure out what is wrong.
BTW when do you see the contacts message? When you are install it or when you are running it?
Comment 4 Jean 2012-11-10 09:48:49 UTC
Bogdan,

I see the message when I install the apps.

Picture taken from the tablet:
http://jcremers.com/permissions.png

Contents of AndroidManifest.xml in [project]/android shows no phone permission, same as the AndroidManifest.xml inside the .apk.

<?xml version='1.0' encoding='utf-8'?>
<manifest android:versionCode="1" package="org.kde.necessitas.example.symbols" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0">
    <application android:name="org.kde.necessitas.origo.QtApplication" android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name="org.kde.necessitas.origo.QtActivity" android:configChanges="orientation|locale|fontScale|keyboard|keyboardHidden" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
            <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
            <meta-data android:name="android.app.lib_name" android:value="symbols"/>
            <!--  Messages maps -->
            <meta-data android:name="android.app.ministro_not_found_msg" android:value="@string/ministro_not_found_msg"/>
            <meta-data android:name="android.app.ministro_needed_msg" android:value="@string/ministro_needed_msg"/>
            <meta-data android:name="android.app.fatal_error_msg" android:value="@string/fatal_error_msg"/>
            <!--  Messages maps -->
            <!-- Splash screen -->
            <meta-data android:name="android.app.splash_screen" android:resource="@layout/splash"/>
            <!-- Splash screen -->
        </activity>
    </application>
    <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>
Comment 5 Jean 2012-11-10 10:48:50 UTC
I created an apk http://jcremers.com/Test-debug.apk
It's an empty project from the wizzard in qtcreator, just mainwindow.cpp/h, no ui file.
It asks phone permissions.
Hope you find something..
Comment 6 BogDan Vatra 2012-11-10 15:34:56 UTC
I checked something similar on my phone and I could not reproduce it. Anyway is obvious that the installer is showing you wrong information, so the best you can do is to contact cyanogenmod guys and report this issue.
Also your description is wrong, you said that the application needs permission to read *contacts* but the picture says something else.
Comment 7 Jean 2012-11-10 16:02:24 UTC
Well, I have the issue also on my tablet, which is not cyanogenmod.
Sorry about the misunderstanding, I meant phone, like in my first message above.
Comment 8 Jean 2012-11-10 16:47:50 UTC
Did you try the .apk I posted?  http://jcremers.com/Test-debug.apk
Also, that picture I posted was not from cyanogenmod 7, it was from my tablet which runs ICS.
Anyway, thanks for your time.
Comment 9 jenna 2012-11-12 10:30:02 UTC
I can confirm this issue is present in alpha 4.1 on linux.  I installed the apk above in a 2.3 emulator image from google (no fancy custom rom at all).  Looking at the apk in the applications menu shows the phone calls permission.  Every necessitas app installed in the emulator shows this permission.  I have about 20 installed, and none of them have purposefully had the phone permission enabled, yet all of them show that permission in the menu.
Comment 10 jenna 2012-11-12 10:40:33 UTC
It looks like this is a necessitas bug, but leftovers from older versions of the android permission system.   If you set you apk to be compitable with any api less than 4, it will automatically get the permissions android.permission.WRITE_EXTERNAL_STORAGE and  android.permission.READ_PHONE_STATE.
Comment 11 Sebastian Sauer 2013-03-25 00:28:45 UTC
Problem is still persistent. I did run into that with the just released Coffice ( http://blogs.kde.org/2013/03/24/coffice-calligra-android-available-now ). The reason and suggestion for a fix is described at http://lwn.net/Articles/544250. In short, the AndroidManifest.xml needs a:
<uses-sdk android:targetSdkVersion="7" android:minSdkVersion="7"/>
Comment 12 Jean 2013-03-26 15:57:27 UTC
Workaround works, thanks!
Comment 13 Andrew Crouthamel 2018-09-04 16:16:30 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years and I will be closing this bug.