Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19933] Android: Required uses-permission are not always added to AndroidManifest

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterFokke Zandbergen
AssigneeUnknown
Created2015-11-12T08:18:55.000+0000
Updated2018-02-28T19:55:26.000+0000

Description

We automatically add the required <uses-permission> elements to AndroidManifest.xml when certain Titanium APIs are used. The new permission request methods need to be added to that list, but it seems it can be simplified/improved in other ways as well: * Instead of testing for different Calendar.\* methods we should just test for the calendar (and android.calendar namespace. Why would you want to use anything in the namespace without the required permissions? If there *is* a good reason not to then Calendar.hasCalendarPermissions and Calendar.requestCalendarPermissions need to be added. * Instead of testing for different Contacts.\* methods we should just test for the contacts namespace for both read and write permissions. Right now, if you don't use Contacts.removePerson or Contacts.removePerson using Contacts.Group.removePerson or any set method will probably fail. If there *is* a good reason no to then all these remove/set methods need to be added as well as the new Contacts.hasContactsPermissions and requestContactsPermissions. * Media.hasCameraPermissions and Media.requestCameraPermissions must be added.

Comments

  1. Fokke Zandbergen 2015-11-12

    [~cng] I closed (as invalid or included) the other permissions tickets since this one covers the edge cases that caused them.
  2. Hieu Pham 2015-11-12

    I'm not sure why this ticket is necessary. Why do you need to check for permissions if you're not using it? If you're not using any API that actually require permissions to work, checking and requesting for them are dead code for most cases (unless you run a custom module, but if that's the case, you'd already have the permissions added manually, because our CLI won't take care of that)
  3. Fokke Zandbergen 2015-11-12

    Because it makes it more predictable. And do note that the second point is no "dead code", but actual use case we're now missing.
  4. Rainer Schleevoigt 2016-02-03

    Currently I have a similar issue with audiorecording. In manifest I have placed the AUDIORECORDER-permission, but in app specific section I see a non activated MICROPHON permission. I can not record, after clicking in this permission section I can. How can I start an intent to permission Screen for a specific app? And why the permission is setting to false although I have a permission in manifest?

JSON Source