Closed
Bug 740190
Opened 12 years ago
Closed 12 years ago
Screen Orientation API: implement locking in Android
Categories
(Core Graveyard :: Widget: Android, defect)
Core Graveyard
Widget: Android
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla14
People
(Reporter: mounir, Assigned: mounir)
References
Details
Attachments
(2 files)
9.70 KB,
patch
|
dougt
:
review+
|
Details | Diff | Splinter Review |
7.29 KB,
patch
|
dougt
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #610338 -
Flags: review?(doug.turner)
Assignee | ||
Updated•12 years ago
|
Whiteboard: [needs review]
Comment 1•12 years ago
|
||
Comment on attachment 610338 [details] [diff] [review] Patch v1 Review of attachment 610338 [details] [diff] [review]: ----------------------------------------------------------------- You can go as is - but do file a follow up about the inconsistency in AndroidBridge.cpp. Assign to me or blassey. Or better yet, assign it to yourself and fix it ;) ::: widget/android/AndroidBridge.cpp @@ +2108,5 @@ > +void > +AndroidBridge::LockScreenOrientation(const dom::ScreenOrientationWrapper& aOrientation) > +{ > + ALOG_BRIDGE("AndroidBridge::LockScreenOrientation"); > + mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jLockScreenOrientation, aOrientation.orientation); JNIEnv *env = AndroidBridge::GetJNIEnv(); if (!env) return; AutoLocalJNIFrame jniFrame(env, 1); You want to be using ^^ to get the jni env. The other instances of this mistake in this file should be corrected (since you are there).
Attachment #610338 -
Flags: review?(doug.turner) → review+
Assignee | ||
Comment 2•12 years ago
|
||
I've added an unlock function. Pretty basic patch. I will merge it with the other one before landing.
Attachment #610419 -
Flags: review?(doug.turner)
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Doug Turner (:dougt) from comment #1) > JNIEnv *env = AndroidBridge::GetJNIEnv(); > if (!env) > return; > > AutoLocalJNIFrame jniFrame(env, 1); I've been able to find a bug (bug 713803) that explains quite clearly why the three first lines. However, I do not understand why we need to call AutoLocalJNIFrame every time. I would be happy to write the patch but I would prefer to understand what I'm doing ;)
Comment 4•12 years ago
|
||
Comment on attachment 610419 [details] [diff] [review] Part 2 - unlock function Review of attachment 610419 [details] [diff] [review]: ----------------------------------------------------------------- Fix or follow up w/ a bug ::: widget/android/AndroidBridge.cpp @@ +2116,5 @@ > +void > +AndroidBridge::UnlockScreenOrientation() > +{ > + ALOG_BRIDGE("AndroidBridge::UnlockScreenOrientation"); > + mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jUnlockScreenOrientation); same thing here. you don't want to use mJNIEnv directly. Also you want to add a java stack frame like the other calls to CallStatic*Method
Attachment #610419 -
Flags: review?(doug.turner) → review+
Assignee | ||
Comment 5•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8bf3120ed0f8
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [needs review]
Target Milestone: --- → mozilla14
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•