-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TIMOB-26157] Android: Avoid Android 8.0 crash when applying a fixed …
…orientation to a semi-transparent or modal window. (#10138) - No longer supported by the Android OS. Now catches the exception and logs an error when attempting to do so. - Removed API Level 9 checks when assigning orientation. (Min supported API Level is currently 16.)
- Loading branch information
1 parent
8795d4f
commit ef2912f
Showing
4 changed files
with
91 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
/* eslint-env mocha */ | ||
/* global Ti */ | ||
/* eslint no-unused-expressions: "off" */ | ||
'use strict'; | ||
|
||
describe('Titanium.UI.Window', function () { | ||
var win; | ||
|
||
afterEach(function () { | ||
if (win) { | ||
win.close(); | ||
} | ||
win = null; | ||
}); | ||
|
||
// As of Android 8.0, the OS will throw an exception if you apply a fixed orientation to a translucent window. | ||
// Verify that Titanium handles the issue and avoids a crash. | ||
it.android('TIMOB-26157', function (finish) { | ||
this.slow(1000); | ||
this.timeout(5000); | ||
|
||
win = Ti.UI.createWindow({ | ||
backgroundColor: 'rgba(0,0,255,128)', | ||
opacity: 0.5, | ||
orientationModes: [ Ti.UI.PORTRAIT ] | ||
}); | ||
win.addEventListener('open', function () { | ||
finish(); | ||
}); | ||
win.open(); | ||
}); | ||
}); |