Justin,

The framework does a check on the permissions of the applications you
are trying to start. In the case of how you are trying to start the
activities the framework does not grant the permission. In general if
you would be root or the owner of the calendar application (in this
case its the system ) you get the permission granted right away to
start the activity.

In your case the check for the permission is not successful because of
the wrong permission is passed down to the framework.

I did not find out what permission you need in your case. But if you
want to spend time investigating the framework code look at
checkComponentPermission()  in frameworks/base/services/java/com/
android/server/am/ActivityManagerService.java


        final int perm = checkComponentPermission(aInfo.permission,
callingPid,
                callingUid, aInfo.exported ? -1 :
aInfo.applicationInfo.uid);
        if (perm != PackageManager.PERMISSION_GRANTED) {
            if (resultRecord != null) {
                sendActivityResultLocked(-1,
                    resultRecord, resultWho, requestCode,
                    Activity.RESULT_CANCELED, null);
            }
            String msg = "Permission Denial: starting " +
intent.toString()
                    + " from " + callerApp + " (pid=" + callingPid
                    + ", uid=" + callingUid + ")"
                    + " requires " + aInfo.permission;
            Log.w(TAG, msg);
            throw new SecurityException(msg);
        }



By the way starting the calendar app in this way does not cause any
exception

        Intent calendarIntent = new Intent() ;
        calendarIntent.setFlags
(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT );
        calendarIntent.setClassName
("com.android.calendar","com.android.calendar.MonthActivity");


--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.



On Aug 18, 8:23 pm, Tikoze <janderson....@gmail.com> wrote:
> Any ideas on why my app doesn't have permissions to launch the
> Calendar app when it is running but it does have permissions to launch
> virtually any other running app????
>
> This bug is driving me crazy!
>
> Thanks in advance for any pointers/suggestions
> Justin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to