New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6_1_0][TIMOB-23429] Android: Nougat file schematics #9041
Conversation
@fmerzadyan No reviewer assigned here. Assigning @garymathews as per ticket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refer to the changes request in the main PR here: #8706 (review)
e763364
to
7100631
Compare
@garymathews, added requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: PASS
TEST CASE
var win = Titanium.UI.createWindow({title: 'TIMOB-23429', backgroundColor: 'gray', layout: 'vertical'}),
btn = Ti.UI.createButton({title: 'TAKE PICTURE', width: '100%', height: '40dp'}),
iv = Ti.UI.createImageView({autorotate: true, width: Ti.UI.FILL, height: Ti.UI.FILL});
function takePicture() {
Titanium.Media.showCamera({
success: function(e) {
iv.image = e.media;
Ti.Media.hideCamera();
},
cancel: function() {
Ti.API.info('canceled');
},
error: function(e) {
Ti.API.error(JSON.stringify(e, null, ' '))
},
saveToPhotoGallery: true,
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]
});
}
btn.addEventListener('click', function(e) {
var permissions = ['android.permission.CAMERA',
'android.permission.WRITE_EXTERNAL_STORAGE',
'android.permission.READ_EXTERNAL_STORAGE'];
for (var permission of permissions) {
if (!Ti.Android.hasPermission(permission)) {
Ti.Android.requestPermissions(permissions, function(e) {
if (e.success) {
takePicture();
}
});
return;
}
}
takePicture();
});
win.add(btn);
win.add(iv);
win.open();
android/cli/commands/_build.js
Outdated
AndroidBuilder.prototype.generateFileProviderPaths = function generateFileProviderPaths(next) { | ||
var xmlDir = path.join(this.buildResDir, 'xml'); | ||
|
||
if fppFile = path.join(xmlDir, 'file_provider_paths.xml'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if fppFile
should be var fppFile
. Build fails due to this.
25806fa
to
731feec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: Pass
731feec
to
4e339f3
Compare
FR Passed. The implementation works as expected according to the new permission model for android N. Studio Ver: 4.9.0.201705170123 |
Target SDK 24로 설정하면 OS N에서 Ti.Media.showCamera()를 호출하였을 때 Exception 발생하는 현상 수정하는 코드 적
Test case:
Should not get
FileUriExposedException
error.app.js (set up camera):
AndroidManifest (add permissions and target Android 7):
JIRA: https://jira.appcelerator.org/browse/TIMOB-23429