[TIMOB-14918] Android: Changing orientation with camera overlay causes app to crash
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-08-26T19:21:50.000+0000 |
Affected Version/s | Release 3.1.2 |
Fix Version/s | 2013 Sprint 17, 2013 Sprint 17 Core, Release 3.1.3, Release 3.2.0 |
Components | Android |
Labels | module_media, qe-closed-3.1.3, qe-testadded, regression |
Reporter | Allen Yeung |
Assignee | Allen Yeung |
Created | 2013-08-19T23:08:25.000+0000 |
Updated | 2013-08-26T22:42:12.000+0000 |
Description
This is a regression in 3.1.2.GA. It works fine in 3.1.1.GA.
Steps to reproduce:
1. Run the test case:
Ti.UI.backgroundColor = "#fff";
var win = Ti.UI.createWindow({
title : 'Test',
backgroundColor : '#fff'
}), logLabel = Ti.UI.createLabel({
bottom : "8dp",
left : "8dp",
right : "8dp",
height : "96dp",
backgroundColor : "black",
color : "white",
font : {
fontSize : "10sp"
},
verticalAlign : Ti.UI.TEXT_VERTICAL_ALIGNMENT_TOP
}), log = function(s, clearFirst) {
var current = logLabel.text;
if (current && !clearFirst) {
current += "\n";
} else {
current = "";
}
current += s;
logLabel.text = current;
}, showCamera, overlay, takePicture, switchCamera, close, currentCamera = Ti.Media.CAMERA_REAR;
logLabel.addEventListener("dblclick", function() {
logLabel.text = "";
});
win.add(logLabel);
overlay = Ti.UI.createView({
width : Ti.UI.FILL,
height : Ti.UI.FILL
});
win.add( showCamera = Ti.UI.createButton({
title : "Show Camera",
width : Ti.UI.SIZE
}));
showCamera.addEventListener("click", function() {
Ti.Media.showCamera({
cancel : function() {
log("Cancelled");
},
error : function(e) {
log("Error - " + e.error);
},
success : function(e) {
log("Media type: " + e.mediaType);
log("Media size: " + e.media.length);
},
saveToPhotoGallery : true,
showControls : false,
overlay : overlay
});
});
win.open();
2. Hit show camera
3. Change orientation
Expected Results:
Orientation should switch without any errors
Actual Results:
App crashes
PR: https://github.com/appcelerator/titanium_mobile/pull/4583
3_1_X: https://github.com/appcelerator/titanium_mobile/pull/4595
Tested with Appcelerator Studio, build: 3.1.3.201308201707 Titanium SDK:3.1.3.v20130821151600 NO crash, but still error in a log Galaxy Nexus Android Version 4.1.1
Nexus7(2) Android Version 4.3
Env used: SDK: 3.1.3.v20130822140128 Studio:3.1.3.201308201707 Please find the below observations on various devices: Nexus7(4.2) No crash but following logs: 08-23 12:02:31.519: E/qdoverlay(178): Failed to call ioctl MSMFB_OVERLAY_SET err=Invalid argument 08-23 12:02:31.519: E/qdoverlay(178): MdpCtrl failed to setOverlay, restoring last known good ov info 08-23 12:02:31.519: E/qdoverlay(178): == Bad OVInfo is: mdp_overlay z=0 fg=0 alpha=255 mask=-1 flags=0x840003 id=-1 08-23 12:02:31.519: E/qdoverlay(178): src msmfb_img w=1920 h=1080 format=6 MDP_Y_CRCB_H2V2 08-23 12:02:31.519: E/qdoverlay(178): src_rect mdp_rect x=0 y=0 w=1920 h=1080 08-23 12:02:31.519: E/qdoverlay(178): dst_rect mdp_rect x=108 y=0 w=1080 h=1920 08-23 12:02:31.519: E/qdoverlay(178): == Last good known OVInfo is: mdp_overlay z=0 fg=0 alpha=0 mask=0 flags=0x0 id=-1 08-23 12:02:31.519: E/qdoverlay(178): src msmfb_img w=0 h=0 format=0 MDP_RGB_565 08-23 12:02:31.519: E/qdoverlay(178): src_rect mdp_rect x=0 y=0 w=0 h=0 08-23 12:02:31.519: E/qdoverlay(178): dst_rect mdp_rect x=0 y=0 w=0 h=0 08-23 12:02:31.519: E/qdoverlay(178): MdpCtrl Lkgo ov has id -1, will not restore 08-23 12:02:31.519: E/qdoverlay(178): Ctrl commit failed set overlay 08-23 12:02:31.519: E/qdhwcomposer(178): configureLowRes: commit failed for low res panel 08-23 12:02:31.619: E/CABL(204): MSMFB_HISTOGRAM_STOP failed! Nexus4(4.0.4) No crash but following error: 08-23 12:07:50.048: E/CameraHAL(120): Adapter state switch PREVIEW_ACTIVE Invalid Op! event = 0xf Galaxy note1(2.3.6) No crash, no error but flickers twice while changing the orientation iphone4(iOS7) No crash and no error logs Nexus7(SDK build 3.2) No crash but following error logs: 08-23 16:08:39.446: E/qdoverlay(177): Failed to call ioctl MSMFB_OVERLAY_SET err=Invalid argument 08-23 16:08:39.446: E/qdoverlay(177): MdpCtrl failed to setOverlay, restoring last known good ov info 08-23 16:08:39.446: E/qdoverlay(177): == Bad OVInfo is: mdp_overlay z=0 fg=0 alpha=255 mask=-1 flags=0x840000 id=-1 08-23 16:08:39.446: E/qdoverlay(177): src msmfb_img w=1920 h=1080 format=6 MDP_Y_CRCB_H2V2 08-23 16:08:39.446: E/qdoverlay(177): src_rect mdp_rect x=0 y=0 w=1920 h=1080 08-23 16:08:39.446: E/qdoverlay(177): dst_rect mdp_rect x=87 y=0 w=1026 h=1824 08-23 16:08:39.446: E/qdoverlay(177): == Last good known OVInfo is: mdp_overlay z=0 fg=0 alpha=0 mask=0 flags=0x0 id=-1 08-23 16:08:39.446: E/qdoverlay(177): src msmfb_img w=0 h=0 format=0 MDP_RGB_565 08-23 16:08:39.446: E/qdoverlay(177): src_rect mdp_rect x=0 y=0 w=0 h=0 08-23 16:08:39.446: E/qdoverlay(177): dst_rect mdp_rect x=0 y=0 w=0 h=0 08-23 16:08:39.446: E/qdoverlay(177): MdpCtrl Lkgo ov has id -1, will not restore 08-23 16:08:39.446: E/qdoverlay(177): Ctrl commit failed set overlay 08-23 16:08:39.446: E/qdhwcomposer(177): configureLowRes: commit failed for low res panel
closing after talking to developers, this log error has nothing to do with orientation change. No crash.