Skip to content

Commit 9d83967

Browse files
committed
Merge remote-tracking branch 'upstream/release-9.0.1' into merge-release-9.0.1-27_08_2018
2 parents 4eba796 + 048f906 commit 9d83967

32 files changed

Lines changed: 650 additions & 84 deletions
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Name: androidRequestPermission
2+
3+
Type: command
4+
5+
Syntax: androidRequestPermission <permissionName>
6+
7+
Summary:
8+
Displays a dialog showing a permission request for <permissionName>. If a user has already granted permission for <permissionName>, this command does nothing.
9+
10+
Introduced: 9.0.1
11+
12+
OS: android
13+
14+
Platforms: mobile
15+
16+
Example:
17+
local tCameraPermissionGranted
18+
put androidHasPermission("android.permission.CAMERA") into tCameraPermissionGranted
19+
if not tCameraPermissionGranted then
20+
androidRequestPermission "android.permission.CAMERA"
21+
end if
22+
put androidHasPermission("android.permission.CAMERA") into tCameraPermissionGranted
23+
if not tCameraPermissionGranted then
24+
answer "This app is not permitted to access the device camera. You can change this" && \
25+
"in the Settings app."
26+
end if
27+
28+
29+
Parameters:
30+
permissionName (enum):
31+
The name of the permission to request.
32+
33+
- "android.permission.READ_CALENDAR": permission to allow an application to read the device's calendar.
34+
- "android.permission.WRITE_CALENDAR": permission to allow an application to write to the device's calendar.
35+
- "android.permission.CAMERA": permission to allow an application to access the device's camera.
36+
- "android.permission.ACCESS_COARSE_LOCATION": permission to allow an application to access the device's coarse location.
37+
- "android.permission.ACCESS_FINE_LOCATION": permission to allow an application to access the device's fine location.
38+
- "android.permission.READ_CONTACTS": permission to allow an application to read data from the device's contacts.
39+
- "android.permission.WRITE_CONTACTS": permission to allow an application to write date to the device's contacts.
40+
- "android.permission.GET_ACCOUNTS": permission to allow an application to access to the list of accounts in the Accounts Service.
41+
- "android.permission.RECORD_AUDIO": permission to allow an application to allow an application to record audio.
42+
- "android.permission.READ_EXTERNAL_STORAGE": permission to allow an application to read data from the device's external storage.
43+
- "android.permission.WRITE_EXTERNAL_STORAGE": permission to allow an application to write data to the device's external storage.
44+
- "android.permission.READ_PHONE_STATE": permission to allow an application to access phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device.
45+
- "android.permission.READ_PHONE_NUMBERS": permission to allow an application to access the device's phone number(s).
46+
- "android.permission.CALL_PHONE": permission to allow an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call.
47+
- "android.permission.ANSWER_PHONE_CALLS": permission to allow an application to answer an incoming phone call.
48+
- "android.permission.READ_CALL_LOG": permission to allow an application to read the user's call log.
49+
- "android.permission.WRITE_CALL_LOG": permission to allow an application to write to the user's call log.
50+
- "android.permission.ADD_VOICEMAIL": permission to allow an application to add voicemails into the system.
51+
- "android.permission.USE_SIP": permission to allow an application to use SIP service.
52+
- "android.permission.PROCESS_OUTGOING_CALLS": permission to allow an application to see the number being dialed during an outgoing call with the option to redirect the call to a different number or abort the call altogether.
53+
- "android.permission.SEND_SMS": permission to allow an application to send SMS messages.
54+
- "android.permission.RECEIVE_SMS": permission to allow an application to receive SMS messages
55+
- "android.permission.READ_SMS": permission to allow an application to read SMS messages.
56+
- "android.permission.RECEIVE_WAP_PUSH": permission to allow an application to receive WAP push messages.
57+
- "android.permission.RECEIVE_MMS": permission to allow an application to receive MMS messages.
58+
- "android.permission.BODY_SENSORS": permission to allow an application to access data from sensors that the user uses to measure what is happening inside his/her body, such as heart rate.
59+
60+
61+
62+
Description:
63+
Use the <androidRequestPermission> command to request permission for <permissionName> from the user.
64+
65+
>*Note:* Permission names are case sensitive.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Name: androidHasPermission
2+
3+
Type: function
4+
5+
Syntax: androidHasPermission(<permissionName>)
6+
7+
Summary:
8+
Returns if permission <permissionName> has been granted by the user.
9+
10+
Introduced: 9.0.1
11+
12+
OS: android
13+
14+
Platforms: mobile
15+
16+
Example:
17+
local tLocationPermissionGranted
18+
put androidHasPermission("android.permission.ACCESS_FINE_LOCATION") into tLocationPermissionGranted
19+
if not tLocationPermissionGranted then
20+
androidRequestPermission "android.permission.ACCESS_FINE_LOCATION"
21+
end if
22+
if not tLocationPermissionGranted then
23+
answer "This app is not permitted to access the device location. You can change this" && \
24+
"in the Settings app."
25+
end if
26+
27+
28+
Parameters:
29+
permissionName (enum):
30+
The name of the permission to request.
31+
32+
- "android.permission.READ_CALENDAR": permission to allow an application to read the device's calendar.
33+
- "android.permission.WRITE_CALENDAR": permission to allow an application to write to the device's calendar.
34+
- "android.permission.CAMERA": permission to allow an application to access the device's camera.
35+
- "android.permission.ACCESS_COARSE_LOCATION": permission to allow an application to access the device's coarse location.
36+
- "android.permission.ACCESS_FINE_LOCATION": permission to allow an application to access the device's fine location.
37+
- "android.permission.READ_CONTACTS": permission to allow an application to read data from the device's contacts.
38+
- "android.permission.WRITE_CONTACTS": permission to allow an application to write date to the device's contacts.
39+
- "android.permission.GET_ACCOUNTS": permission to allow an application to access to the list of accounts in the Accounts Service.
40+
- "android.permission.RECORD_AUDIO": permission to allow an application to allow an application to record audio.
41+
- "android.permission.READ_EXTERNAL_STORAGE": permission to allow an application to read data from the device's external storage.
42+
- "android.permission.WRITE_EXTERNAL_STORAGE": permission to allow an application to write data to the device's external storage.
43+
- "android.permission.READ_PHONE_STATE": permission to allow an application to access phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device.
44+
- "android.permission.READ_PHONE_NUMBERS": permission to allow an application to access the device's phone number(s).
45+
- "android.permission.CALL_PHONE": permission to allow an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call.
46+
- "android.permission.ANSWER_PHONE_CALLS": permission to allow an application to answer an incoming phone call.
47+
- "android.permission.READ_CALL_LOG": permission to allow an application to read the user's call log.
48+
- "android.permission.WRITE_CALL_LOG": permission to allow an application to write to the user's call log.
49+
- "android.permission.ADD_VOICEMAIL": permission to allow an application to add voicemails into the system.
50+
- "android.permission.USE_SIP": permission to allow an application to use SIP service.
51+
- "android.permission.PROCESS_OUTGOING_CALLS": permission to allow an application to see the number being dialed during an outgoing call with the option to redirect the call to a different number or abort the call altogether.
52+
- "android.permission.SEND_SMS": permission to allow an application to send SMS messages.
53+
- "android.permission.RECEIVE_SMS": permission to allow an application to receive SMS messages
54+
- "android.permission.READ_SMS": permission to allow an application to read SMS messages.
55+
- "android.permission.RECEIVE_WAP_PUSH": permission to allow an application to receive WAP push messages.
56+
- "android.permission.RECEIVE_MMS": permission to allow an application to receive MMS messages.
57+
- "android.permission.BODY_SENSORS": permission to allow an application to access data from sensors that the user uses to measure what is happening inside his/her body, such as heart rate.
58+
59+
Returns(boolean):
60+
True if permission has been granted, false otherwise.
61+
62+
63+
Description:
64+
Use the <androidRequestPermission> function to find out if permission <permissionName> has been granted by the user.
65+
66+
>*Note:* Permission names are case sensitive.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Name: androidPermissionExists
2+
3+
Type: function
4+
5+
Syntax: androidPermissionExists(<permissionName>)
6+
7+
Summary:
8+
Returns true if <permissionName> is a valid Android permission name
9+
10+
Introduced: 9.0.1
11+
12+
OS: android
13+
14+
Platforms: mobile
15+
16+
Example:
17+
18+
if not androidPermissionExists(pPermission) then
19+
answer pPermission && "is not a valid permission name"
20+
end if
21+
22+
23+
Parameters:
24+
permissionName (string):
25+
The name of the permission to check.
26+
27+
Returns(boolean):
28+
True if <permissionName> is a valid Android permission name, false otherwise.
29+
30+
Description:
31+
Use the <androidPermissionExists> function to check if <permissionName> is a valid Android permission name.
32+
33+
>*Note:* Permission names are case sensitive.

docs/notes/bugfix-21396.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix crash on startup in iOS 12 beta

docs/notes/bugfix-21417.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Don't include any externals in emscripten standalones

docs/notes/bugfix-21434.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix visual effects not working when acceleratedRendering is true on Android

docs/notes/bugfix-21443.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix groups sometimes not redrawing when scrolled

docs/notes/bugfix-21496.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure emscripten aux stacks are loaded on startup
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Android 6.0 runtime permissions
2+
3+
Android 6.0 (API 23) Marshmallow introduced a new permissions model
4+
that lets apps request permissions from the user at runtime, rather
5+
than prior to installation. Apps built with LC 9.0.1 do support this
6+
new permissions model, and request permissions automatically when the
7+
app actually requires the services or data protected by the services.
8+
9+
For example, if the app calls `mobilePickPhoto "camera"`, a dialog will
10+
be shown to the user asking for permission to access the device camera.
11+
12+
If the user does not grant permission, the call will fail. Moreover, the
13+
app can use the function `androidRequestPermission(permissionName)` to
14+
check if the permission for `permissionName` has been granted.
15+
16+
Notes:
17+
18+
- You have to make sure that you check the required permissions for your
19+
app in the standalone settings.
20+
- Apps that run on devices running Android 6+ will work with the new
21+
permissions model.
22+
- Apps that run on older devices (less than Android 6) will continue to
23+
work with the old permissions model.
24+
- If the user does not grant a permission when the dialog appears for the
25+
first time, they can change this preference from the Settings app.
26+
Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
script "__startup"
21
constant kEngineVersion = "@ENGINE_VERSION@"
32

43
-- Directories that engine expects to normally be present
@@ -7,41 +6,38 @@ constant kStandardFolders = "/tmp:/livecode:/boot:/boot/standalone:/boot/fonts"
76
-- Directory containing the initial stack files
87
constant kStartupFolder = "/boot/standalone"
98

10-
on startup
11-
local tError, tFolder
12-
try
13-
----------------------------------------------------------------
14-
-- Create standard filesystem layout
15-
set the itemdelimiter to ":"
16-
repeat for each item tFolder in kStandardFolders
17-
if there is not a folder tFolder then
18-
create folder tFolder
19-
if the result is not empty then
20-
throw the result
21-
end if
9+
local tError, tFolder
10+
try
11+
----------------------------------------------------------------
12+
-- Create standard filesystem layout
13+
set the itemdelimiter to ":"
14+
repeat for each item tFolder in kStandardFolders
15+
if there is not a folder tFolder then
16+
create folder tFolder
17+
if the result is not empty then
18+
throw the result
2219
end if
23-
end repeat
24-
25-
-------------------------------------------------------------
26-
-- Validate engine version
27-
if the version is not kEngineVersion then
28-
throw "Engine mismatch: found" && the version & ", expected" && kEngineVersion
2920
end if
30-
31-
32-
@STARTUP_SCRIPT@
33-
34-
catch tError
35-
end try
36-
37-
-- Set the initial working directory to the directory that contains
38-
-- the initial stack.
39-
set the defaultfolder to kStartupFolder
40-
41-
-- Try to print something vaguely helpful to the the log
42-
if tError is not empty then
43-
write "startup failed:" && tError & return to stderr
21+
end repeat
22+
23+
-------------------------------------------------------------
24+
-- Validate engine version
25+
if the version is not kEngineVersion then
26+
throw "Engine mismatch: found" && the version & ", expected" && kEngineVersion
4427
end if
45-
46-
return tError
47-
end startup
28+
29+
30+
@STARTUP_SCRIPT@
31+
32+
catch tError
33+
end try
34+
35+
-- Try to print something vaguely helpful to the the log
36+
if tError is not empty then
37+
write "startup failed:" && tError & return to stderr
38+
throw tError
39+
end if
40+
41+
-- Set the initial working directory to the directory that contains
42+
-- the initial stack.
43+
set the defaultfolder to kStartupFolder

0 commit comments

Comments
 (0)