Closed Bug 1203821 Opened 10 years ago Closed 10 years ago

[cleanup] Simplify BluetoothPbapManager functions

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.2r+, firefox44 fixed, b2g-v2.2r fixed, b2g-master affected)

RESOLVED FIXED
FxOS-S9 (16Oct)
blocking-b2g 2.2r+
Tracking Status
firefox44 --- fixed
b2g-v2.2r --- fixed
b2g-master --- affected

People

(Reporter: ben.tian, Assigned: ben.tian)

References

Details

Attachments

(5 files, 5 obsolete files)

10.70 KB, patch
shawnjohnjr
: review+
Details | Diff | Splinter Review
15.03 KB, patch
Details | Diff | Splinter Review
1.47 KB, patch
shawnjohnjr
: review+
Details | Diff | Splinter Review
14.19 KB, patch
Details | Diff | Splinter Review
13.52 KB, patch
Details | Diff | Splinter Review
Simplify BluetoothPbapManager functions as following: - add utility function to convert big/little endianness - revise BluetoothPbapManager with above utility functions - integrate |PullPhonebook|, |PullvCardListing|, and |PullvCardEntry| into one function to fire PBAP request for gaia.
Depends on: 1203819
Attachment #8659709 - Flags: review?(shuang)
Attachment #8659708 - Flags: review?(shuang)
Blocks: 1168298
Attachment #8670671 - Attachment description: Patch 1 (v1): Add utility functions to convert big/little endianness and revise BluetoothPbapManager accordingly → Patch 1 (v2): Add utility functions to convert big/little endianness and revise BluetoothPbapManager accordingly
Attachment #8670671 - Attachment is obsolete: true
Attachment #8670673 - Flags: review?(shuang)
Attachment #8659709 - Flags: review?(shuang)
Attachment #8659709 - Attachment is obsolete: true
Attachment #8659709 - Flags: review?(shuang)
Attachment #8670671 - Attachment is obsolete: false
Attachment #8670671 - Flags: review?(shuang)
Comment on attachment 8670671 [details] [diff] [review] [final] Patch 1: Add utility functions to convert big/little endianness and revise BluetoothPbapManager accordingly, r=shuang Review of attachment 8670671 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bluetooth/bluedroid/BluetoothPbapManager.cpp @@ +251,5 @@ > > ReplyToDisconnectOrAbort(); > AfterPbapDisconnected(); > break; > case ObexRequestCode::SetPath: { nit:Please fix indentation. Left shitf two spaces. Although BluetoothDaemonHelpers do indent 4 spaces after brace. @@ +514,5 @@ > > switch (aTagId) { > case AppParameterTag::Order: { > + using namespace mozilla::dom::vCardOrderTypeValues; > + uint32_t order = nit:Please fix indentation. Left shift two spaces. @@ +524,2 @@ > case AppParameterTag::SearchProperty: { > + using namespace mozilla::dom::vCardSearchKeyTypeValues; nit:Please fix indentation. @@ +537,5 @@ > + // MDN:Internal_strings suggestion > + AppendNamedValue(aValues, "searchText", nsCString((char *) buf)); > + break; > + case AppParameterTag::MaxListCount: { > + uint16_t maxListCount = ReadLittleEndianUInt16(buf); nit:Please fix indentation. @@ +558,5 @@ > + case AppParameterTag::Format: > + AppendNamedValue(aValues, "format", static_cast<bool>(buf[0])); > + break; > + case AppParameterTag::vCardSelector: { > + bool hasSelectorOperator = aHeader.GetAppParameter( nit:Please fix indentation. ::: dom/bluetooth/common/BluetoothUtils.cpp @@ +604,5 @@ > aArray.InsertElementAt(aIndex, BluetoothNamedValue(name, aValue)); > } > > +uint16_t > +ChangeEndiannessUInt16(uint16_t aValue) I prefer to use 'Convert', s/Change/Convert.
Attachment #8670671 - Flags: review?(shuang) → review+
Attachment #8670673 - Flags: review?(shuang)
Rebase on bug 1212725.
Attachment #8670673 - Attachment is obsolete: true
Attachment #8672451 - Flags: review?(shuang)
Attachment #8672451 - Flags: feedback?(6jamin)
Comment on attachment 8672451 [details] [diff] [review] Patch 2 (v3): Notify gaia of PBAP request with one integrated function Review of attachment 8672451 [details] [diff] [review]: ----------------------------------------------------------------- The patch looks great. :) Thank Ben for providing this patch. ::: dom/bluetooth/bluedroid/BluetoothPbapManager.cpp @@ +294,5 @@ > ReplyToSetPath(); > break; > } > case ObexRequestCode::Get: > + /** Would you mind to use '/*' instead of '/**' here ? Mozilla coding style [1] suggests to use JavaDoc-style comments [2]. According to [2], a doc comment must precede a class, field, constructor or method declaration. [1] https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style [2] http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#format @@ +455,5 @@ > + // ... PullvCardListing function uses relative paths. An empty name header > + // may be sent to retrieve the vCard Listing object of the current folder. > + name = name.IsEmpty() ? mCurrentPath > + : mCurrentPath + NS_LITERAL_STRING("/") + name; > + Should we remove this empty line ?
Attachment #8672451 - Flags: feedback?(6jamin) → feedback+
Comment on attachment 8672451 [details] [diff] [review] Patch 2 (v3): Notify gaia of PBAP request with one integrated function Review of attachment 8672451 [details] [diff] [review]: ----------------------------------------------------------------- I would r+ this.
Attachment #8672451 - Flags: review?(shuang) → review+
Revise per Jamin's feedback and rebase on bug 1212729.
Attachment #8672451 - Attachment is obsolete: true
Attachment #8670671 - Attachment description: Patch 1 (v2): Add utility functions to convert big/little endianness and revise BluetoothPbapManager accordingly → [final] Patch 1: Add utility functions to convert big/little endianness and revise BluetoothPbapManager accordingly, r=shuang
Sync comment and log with 2.2r file.
Attachment #8672531 - Attachment is obsolete: true
(In reply to Ben Tian [:btian] from comment #13) > Created attachment 8672909 [details] [diff] [review] > Patch 3 (v1): Restore missing bug 1212729 change Comment 9 patch missed one section of bug 1212729 change. This patch 3 restores it.
Comment on attachment 8672909 [details] [diff] [review] Patch 3 (v1): Restore missing bug 1212729 change Thanks for finding this piece.
Attachment #8672909 - Flags: review?(shuang) → review+
Depends on: 1212729
Set 2.2r blocker for required bluetooth feature PBAP.
blocking-b2g: --- → 2.2r+
Note for 2.2r only two patches is required (comment 17 and 18) since 2.2r patch 2 already integrates m-c patch 3. (In reply to Carsten Book [:Tomcat] from comment #20) > https://hg.mozilla.org/mozilla-central/rev/a3b4565c0ee5 > https://hg.mozilla.org/mozilla-central/rev/4b163ef1abb2 > https://hg.mozilla.org/mozilla-central/rev/1904c51c0cc3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: