{ "id": "172565", "key": "TIMOB-26532", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2018-11-07T02:37:01.000+0000", "priority": null, "labels": [ "android", "canRequestPackageInstalls", "permissions" ], "versions": [], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-11-07T23:34:33.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "Hi, this is a enhancement request for the Ti.Android SDK module.\r\n\r\nSince Android 8 (Oreo) when an app wants to install a APK (Update itself or another app) it requires some extra permission and steps as highlighted here:\r\nhttps://android-developers.googleblog.com/2017/08/making-it-safer-to-get-apps-on-android-o.html\r\n\r\nPart of that process is checking if the app currently has the settings enabled for \"Install Unknown Sources\" for the app - to check for this one uses \"canRequestPackageInstalls\"\r\nhttps://developer.android.com/reference/android/content/pm/PackageManager#canRequestPackageInstalls()\r\n\r\nThis is not currently built into the Ti.Android SDK module to my knowledge (maybe I missed it?) \r\n\r\nI was able to get what I need with Hyperloop but it would be good if this was built into the SDK\r\n\r\nHere is my Hyperloop code:\r\n{code:java}\r\nvar activity = require('android.app.Activity');\r\nvar currentActivity = new activity(Ti.Android.currentActivity);\r\nvar canRequestPackageInstalls = currentActivity.getPackageManager().canRequestPackageInstalls();\r\nTi.API.info(\"canRequestPackageInstalls\");\r\nTi.API.info(canRequestPackageInstalls);\r\n{code}\r\n\r\nCan we get this added to the Ti.Android SDK Module?", "attachment": [], "flagged": false, "summary": "Android: Add canRequestPackageInstalls to Ti.Android", "creator": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "443388", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Thanks for the request. Our engineers will look into it. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-11-07T23:32:59.000+0000", "updated": "2018-11-07T23:32:59.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }