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
fix(android)(9_3_X): AudioRecorder recording/stopped property handling #11996
Conversation
Tests:
|
android/modules/media/src/java/ti/modules/titanium/media/TiAudioRecorder.java
Outdated
Show resolved
Hide resolved
android/modules/media/src/java/ti/modules/titanium/media/TiAudioRecorder.java
Show resolved
Hide resolved
out.close(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
if (this.audioRecord != null) { |
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.
Same as above, do we need to guard consecutive resume calls? (or some other state?) I think the null check guards against resuming after stopped or before started.
iphone/cli/hooks/run.js
Outdated
@@ -90,8 +90,11 @@ exports.init = function (logger, config, cli) { | |||
logger.error('[' + simHandle.appName + '] ' + msg); | |||
}) | |||
.on('app-started', function () { | |||
finished && finished(); | |||
finished = null; | |||
// TODO: Add "installed" event to "ioslib" module for simulators and emit below event from there. |
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.
Looks fairly straightforward to add here: https://github.com/appcelerator/ioslib/blob/1_7_X/lib/simulator.js#L1586
Basically instead of passing next to simctl.install as the callback, add a function that emits the event (if no error) and then fires next().
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.
Yes, I thought about making changes to ioslib, but I saw that major changes are being made to it on master. And I have no idea what's going on with the 2_X and 3_X branches. Are they used by the daemon and Appc Studio?
await xcrun([ 'simctl', 'privacy', builder.simHandle.udid, 'grant', 'all', builder.tiapp.id ]); | ||
|
||
// Re-launch app in case granting permissions forced-quit it. | ||
await xcrun([ 'simctl', 'launch', builder.simHandle.udid, builder.tiapp.id ]); |
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.
I assume this is because of the note above where we're not actually firing post-install, pre-launch - we're firing post-launch?
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.
Exactly right. We'd be able to remove this line if we could fire the post install event before the launch.
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
FR Passed. |
Fixes TIMOB-28105
- Now auto-stops recording when JS object is released or JS runtime has been terminated. * Needed to to free up microphone to be used by next audio recorder object. - Modified AudioRecorder.start() to no-op if already started. - Removed blocking reads from audio recorder. Now always reads microphone from worker thread. - Now checks if audio recording was successfully started.
79f5111
to
397cbb4
Compare
The backport to
Check the run for full details # Fetch latest updates from GitHub
git fetch
# Check out the target branch
git checkout master
# Make sure it's up to date
git pull
# Check out your branch
git checkout -b backport-11996-to-master
# Apply the commits from the PR
curl -s https://github.com/appcelerator/titanium_mobile/commit/aa2d1ba047198f0624c2769a18dee70c00e5cb72.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/22e8cc0a1e23487f82f9a039899214640834eaa0.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/29277557f1fe68b49b39595f538ffe2a3629cad7.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/8335e27ec6db2d3758bd637121973b430166ce94.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/6c3869af9044ff9a107a4b8c692dbaa3cbcf5e57.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/68a1057a2b897ccac65045fa1b655a7570376d9f.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/487c403502fad18c7e6e531c56ce6c9f74dea796.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/397cbb47ffde0b6a7e2ff97b725e0b5ecefbcf62.patch | git am -3 --ignore-whitespace
# Push it to GitHub
git push --set-upstream origin backport-11996-to-master Then, create a pull request where the |
JIRA:
https://jira.appcelerator.org/browse/TIMOB-28105
Summary:
AudioRecoder
changes:recording
andstopped
propertiesstart()
andresume()
methods. (Can block up to 10 sec.)stop()
method. (No longer creates 2nd audio file.)AudioRecorder
unit tests for Android and iOS.Test:
AudioRecorderStatusTest.js
attached to TIMOB-28105 for the "app.js".true
and the other labels arefalse
.true
and the other labels arefalse
.true
and the other labels arefalse
.true
and the other labels arefalse
.true
and the other labels arefalse
.tiapp.xml