How to check the app permissions is changed by the user to the contacts.

Hello

I'm trying to get the details of the contacts, but when the user disable the authorization of contacts I get 0 has less code.

But my problem is when a user has 0 contact in the device. I am not able to recognize if the app permission is turned off or the number of contacts of device is 0.

ContactListFilters filters;
filters.setLimit (5000);
QList<>im::contacts:Contact > contactList = m_contactService-> contacts (filters);

contactList.size () is 0 if the user does not have any contact in the device.

contactList.size () is 0 if the user has disabled the app approval. How I know this.

Thank you

BlackBerry explicitly states that there is no way to read the permissions granted. Instead your application should attempt to use the resource controlled by the permission and respond to errors when these resources are not accessible. The problem you have is that, in my judgment, there is NO function in ContactService indicating an error during authorization has not been granted. They act just as if there are no resources that you are looking for, which is not at all useful.

There is only one thing I can think of, but it's ugly... try to create a new contact and then see if it is there. If this is the case, you have the permission. Then delete the contact test.

I told him he was ugly. The good thing is that you only need to run your test if ContactService reports no contacts, which is extremely rare I think.

Tags: BlackBerry Developers

Similar Questions

  • How to check the internal operations, Manager of competitor status in Oracle Apps R12 of en

    Step by step how to check the internal operations, Manager of competitor status in Oracle Apps R12 of front end and how to start their.

    Richa says:
    Step by step how to check the internal operations, Manager of competitor status in Oracle Apps R12 from front end

    Simultaneous treatment - platform generic competitor Manager Questions / answers [ID 105133.1]

    and how to start the

    (1) using the adcmctl.sh (from the backend)
    (2) using the button Activate (from front) - http://docs.oracle.com/cd/E18727_01/doc.121/e12893/T174296T174302.htm#4334248

    Thank you
    Hussein

  • How to check the image source for the image which is losted?

    Hello world

    How to check the image source for the image which is losted?

    If the image source already exists, I can read the PlaceItem.file.fsName.

    But if remove the image of the source, read the PlaceItem.file.fsName will report the error: there is no file associated with this element

    Thank you

    If (app.documents.length > 0) {}

    var sourceDoc = app.activeDocument;

    sourceName = sourceDoc.name var;

    artItem =]

    for (i = 0; i < sourceDoc.pageItems.length; i ++) {}

    artItem [i] = sourceDoc.pageItems [i];

    If (.) TypeName artItem [i] == 'PlacedItem') {}

    If (.imageColorSpace [i] artItem == undefined) {}

    Alert ("the file is the link, but I don't know whether or not the source image is losted");

    }

    }

    }

    }

    Use try/catch to catch the error

    if (app.documents.length > 0) {
        var sourceDoc = app.activeDocument;
        var sourceName = sourceDoc.name;
        artItem = []
        for (i = 0; i < sourceDoc.pageItems.length; i++) {
            artItem[i] = sourceDoc.pageItems[i];
            if (artItem[i].typename == 'PlacedItem') {
                if (artItem[i].imageColorSpace == undefined) {
                    try {
                        var fname = artItem[i].file.name;
                        alert("file name: " + fname);
                    }
                    catch (e) {
                        alert("The file is linking ,but source image is lost");
                    }
                }
            }
        }
    }
    
  • How to check the Lightroom updates.

    How to check the Lightroom updates.  I have a version 6.2.1 stand-alone.  When I go to the help tab and click on updates, she wants to connect to the CC.  I don't want to join the CC.

    Also, I hate the new interface to import.  It makes some assumptions about what you want to import.  I have to go through several steps just to import a picture of my office. I had no problem with the former.  Why was changed?  I hope that Adobe comes to their senses and and simplifies the interface to import again.

    LR 6 wants you connect to check your license, not join CC.  You have the latest version of this day, and you check the updates correctly.  You can also see the announcement on this forum area to see what is the latest version of LR.  You can disable the new Panel to add Photos into LR / preferences / general.

  • How to check the code of the generated report

    Hi all

    I need to change a standard module of PA report. The name of the report is "people's Republic of CHINA: distribute its use and miscellaneous charges.
    The method executable is GENERATED. The name of the executable file is PASDUC.
    Please let me know how to check the code of the present report and in what way I can locate the report.

    Kind regards
    Mahi.

    Thanks Sandeep, appreciate your words :)

    Kind regards
    Hussein

  • How to check the status of the statistics on a table?

    Hello
    I started the statistics collection on a few large tables in my database.
    How to check the status of statistics about a table? Are there views of data dictionary or tables to monitor the progress of the collection of statistics.


    Regds,
    Malika

    Hi all

    You can check with this little script.
    It lists details of sid for long as running session
    When he started
    What last update
    How long still to the left
    "ACTIVE/INACTIVE" session state etc.

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    -Author: James Syed_
    -Script_name: sid_long_ops.sql
    -Description: list details of sid for long running the session as when it began when the last update how long still to the left.

    fixed lines 200
    Neck LESS to a25

    Select
    a.SID,
    a.Serial #.
    b.Status,
    a.opname,
    TO_CHAR (a.START_TIME,' DD-me-AAAA HH24:mi:ss) START_TIME,
    TO_CHAR (a.LAST_UPDATE_TIME,' DD-me-AAAA HH24:mi:ss) LAST_UPDATE_TIME,.
    a.time_remaining as 'time remaining dry. "
    a.time_remaining/60 as "Min remaining time."
    a.time_remaining/60/60 as 'remaining time in HR.
    V $ session_longops a, v$ session b
    where = select a.sid
    a.sid = & sid
    And time_remaining > 0;

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------

    The sample output:
    --------------------

    SQL > @sid_long_ops
    Enter the SID value: 474
    13 old: a.sid = & sid
    13 News: and a.sid = 474

    SID, SERIAL # STATUS START_TIME LAST_UPDATE_TIME remaining time LESS dry time remaining minutes remaining HR time
    --------------------------------
    474 2033 ACTIVE collection schema statistics June 6, 2012 20:10:49 June 7, 2012 01:35:24 572 9.53333333.158888889

    Thank you & best regards

    Syed James.
    Oracle Apps DBA
    Mobile: + 91 9966270072
    E-mail: [email protected]

  • How to check the oracle forms?

    Dear friends,

    OS: RHEL AS 3
    DB: 9i R2
    Forms: Developer 6
    pc clients: Windows XP sp2
    Forms Server: novell 4.8

    How to check the oracle forms? for example, we have developed the forms using Developer 6. We would like to know which user accesses the number 152 of the form or the form name hrform.fmx
    Because, every time make us changes in the forms we need more fmx if the user accesses this form so we can not crush him in our novell server.
    Usually, we use a windows scheduler in the night to copy forms. so, if we know the user who has not disconnected from our system. the next day, we ask the user.

    Thank you

    Take a look at

    sys. DBMS_APPLICATION_INFO.set_module

    and

    sys. DBMS_APPLICATION_INFO.set_client_info

    and call these package with good info in each of your form in for example the trigger a TIME NEW FORM INSTANCE...

  • Anyone know how to check the date of warranty until when?

    Anyone know how to check the date of warranty until when?

    https://checkcoverage.Apple.com/Jo/en/;JSESSIONID=9pJ0X9pFPJtNg3c44yDGCvk9pVpt5l QSgn4B60y4Skv1WfmnqMkF!-1840326800

  • How to check the balance on the gift card itunes

    How to check the balance on the gift card itunes

    Redeem it

  • Satellite A200 - how to check the temperature of the processor fan?

    Hi all

    I have a Satellite A200 that my teenagers use a little, or abuse a little! Recently, it would not start up. I suspect the fan and pulled out the fan cleaned and tested the fan on a PSU, worked out well. He put it back together, ran startup repair and now the computer is operating normally. The fan is however not appear to come at all. In the Device Manager it tells me it works very well. I'm all good with the mechanical side of the House, but I'm a quamby operating system! How to check the temp CPU or fan?

    Thought that replace the fan but don't want to go that far just to get no results. Currently using the vacuum on low like an external fan and didn't want to just run the laptop with no cooling for fear of permanent damage. Although children watch movies with her on their doona may have already reached this!

    Any advice would be appreciated.

    Hey mate,

    How to clean the fan exactly? It s advisable to use the jet of compressed air. This could blow the dust of fans cooling and, therefore, it of not necessary to disassemble the laptop.

    In addition if the fan doesn't work anymore it of necessary to replace. You can order spare parts at an authorized service provider.

  • How to check the print queue in Windows 8

    Difficulty controlling the queue with your new Windows 8? Here's a great video on how to do it:

    Hope this helps to understand how to check the print queue in Windows 8. If you have problems, let me know, I'll see what I can do to help.

  • HP Photosmart 7525: How to check the version of the firmware of the HP PhotoSmart 7525 is up-to-date?

    How to check the version of the firmware of the HP Photosmart 7525 is up-to-date? And where can I go to download the latest firmware?

    Hello

    Follow these steps to check the update of firmware for your printer:

    http://support.HP.com/us-en/product/HP-Photosmart-7520-e-all-in-one-printer-series/5199461/model/5286642/document/c03312867/

    Note: the printer must be connected to your network to check the updates, if it is connected with a USB key follow the steps in the tehse to connect the * beep * to your wireless network:

    1. In the wireless menu, tap Settings.

  • How to check the size of the file to a text file.

    How to check the size of the file to a text file.

    Please explain to me.

    I'm new in LabVIEW. and have no idea about that...;

    Hi prashant,

    go to the file e/s palette and then the advanced palette which is a search palletteand sub getfilesize.vi... but this function gives the result in bytes...

    Thank you and best regards,

    srikrishnaNF

  • HP G42 notebook: how to check the heat sensor

    my laptop fire but there is no system message...

    and performance down... could be heat sensor not properly detect...

    How to check the heat sensor...

    my laptop G-42-355tu

  • How to check the use of the ram?

    I have 3 GB of ram on my pc, and I want to know how to check the use of the ram in xp pro? is the use of FP in taskmanager? or (k) of the kernel memory?

    I have 3 GB of ram on my pc, and I want to know how to check the use of the ram in xp pro? is the use of FP in taskmanager? or (k) of the kernel memory?

    Yes, Yes... and no. All applications on your computer uses RAM, not only the pagefile or system (kernel).

    What are you really trying to do?

    See http://www.petri.co.il/pagefile_optimization.htm , especially the part under "How Pagefile your system use?"

  • How to check the manufacturing date of the Z2?

    Hello, so the title sums up pretty much everything this. On the previous xperia phones, you can check under the battery, with xperia Z, that it was written on the back at the bottom but on Z2? How to check the date of manufacture?

    Hello and welcome to the community! Since you are new, please make sure that you have checked our Forum.

    This label can be found in the MicroSD slot, click on the following link:
    http://Userguide.sonymobile.com/referrer.php?region=en&product=Xperia-Z2#IMEI-number.html

Maybe you are looking for