Commit Graph
331 Commits
Author SHA1 Message Date
Jing-wei Wu 7fd3f2f2dc Bug 1329128 - Part 1: Implement the functionality of remove bookmark folder in BrowserProvider. r=Grisha
MozReview-Commit-ID: GQfM4Z9zU2x
2017-05-02 17:52:55 +08:00
Jing-wei Wu 6a0ecb7194 Bug 1329131 - Part 1: Implement the functionality of listing all bookmark folders except special folders. r=Grisha
MozReview-Commit-ID: AK79E6kkXFI
2017-04-21 18:31:03 +08:00
Jan Henning ab33946bd2 Bug 1352997 - Part 5 - Implement common behaviour for custom tabs/web apps and switch over the former. r=sebastian,walkingice
This implements the common behaviour for restoring the correct tab when switching to/from custom tab and web app activities. Unlike our normal UI, those activities are basically single tab activities, that is each activity is linked to a certain Gecko tab, with no facilities (bugs aside) for the user to directly load/select a different tab within that activity.

Therefore, here we basically update the selected tab only when the activity is starting up and initially creating its new (or, especially once tab type switching will be implemented, taking over an existing) content tab.

When subsequently restoring, we then check whether the tab is still available. If it is, we select it, if not, we fall back to opening a new tab based on the available intent data.

This also means that we no longer have to finish() the activity on closing so the activity state (finished) matches the tab (closed), which means that we no longer have to prematurely kill Gecko as a side effect of that.

MozReview-Commit-ID: KjFz1qrqWLy
2017-04-08 19:19:32 +02:00
Jan Henning 2df85dd781 Bug 1351739 - Part 2 - Convert CustomTabsActivity to SafeIntents. r=sebastian,walkingice
These are potentially untrusted external intents, so we should use SafeIntents for interacting with them.

MozReview-Commit-ID: 3nmjg85wbr1
2017-04-02 14:09:36 +02:00
Edouard Oger 301076f140 Bug 1360047 - Generate random GUIDs more reliably in TestFxAccountDeviceListUpdater. r=eoger
MozReview-Commit-ID: 9Ak99iIxOzY
2017-04-27 09:50:24 -07:00
Edouard Oger 842aa56844 Bug 1351805 part 3 - Refresh the remote devices list on Married/Engaged states. r=Grisha
MozReview-Commit-ID: 1Ktbtlzc1fI
2017-04-19 17:45:49 -04:00
Edouard Oger 87f243259e Bug 1351805 part 1 - Create a org.mozilla.gecko.fxa.devices package. r=Grisha,nalexander
MozReview-Commit-ID: FjJmRiHlqEg
2017-04-07 11:56:38 -04:00
Wes Kocher e5cf37107d Backed out 3 changesets (bug 1351805) for android Test failures a=backout
Backed out changeset da34da5f310a (bug 1351805)
Backed out changeset 430b56176e04 (bug 1351805)
Backed out changeset a3dfb4b9dc66 (bug 1351805)

MozReview-Commit-ID: AE4RcKV3akz
2017-04-25 12:47:59 -07:00
Edouard Oger 24a859fd50 Bug 1351805 part 3 - Refresh the remote devices list on Married/Engaged states. r=Grisha
MozReview-Commit-ID: 1Ktbtlzc1fI
2017-04-19 17:45:49 -04:00
Edouard Oger bfc7019308 Bug 1351805 part 1 - Create a org.mozilla.gecko.fxa.devices package. r=Grisha,nalexander
MozReview-Commit-ID: FjJmRiHlqEg
2017-04-07 11:56:38 -04:00
Edouard Oger b838bef9e9 Bug 1349299 - Register device on FxA even on Push registration failure. r=Grisha
MozReview-Commit-ID: 3qDkm9iV9C0
2017-04-06 11:30:23 -04:00
Jing-wei Wu 51f50a43b6 Bug 1232439 - Part 2: Support get/update/remove bookmark record by ID in BrowserDB. r=Grisha
MozReview-Commit-ID: 6RNKCUiZE8K
2017-04-05 14:03:16 +08:00
Sebastian Kaspari 9a6566dcc6 Bug 1272354 - (DLC) Download Action: If there's no download scheduled then exit early. r=Grisha
There's no need to run all other checks if there's nothing scheduled to be downloaded (anymore). In later
patches we want to report error states to our telemetry system and there's no need to report "no network"
errors if we are not going to download anything anyways.

MozReview-Commit-ID: K4bxbM3ptvZ
2017-04-03 16:27:36 +02:00
Joel Maher 1217666e25 Bug 1350473 - add BUG_COMPONENT to mobile/* files. r=snorp
MozReview-Commit-ID: HkWLIVAaciF
2017-04-11 09:47:28 -04:00
Julian_Chu 3dcdc83629 Bug 1348718 - Build option menu button in same way r=sebastian
There might be up to 2 Always-show-as-action button in ActionBar.
One for menu-options, one for 3rd-party app action-button, if any.

According to our design spec, the two buttons appearance should be
similiar, therefore now we create them by same method.

MozReview-Commit-ID: GPVteQR3hxr
2017-04-07 13:03:57 +08:00
Julian_Chu eb1089bbfa Bug 1351605 - Get rid of color variable in activity r=sebastian
Now we can get toolbar color from intent directly, and the intent will
be stored in `onSavedInstanceState`. Let's get rid of the local
variable.

MozReview-Commit-ID: OsqwgFJctH
2017-04-06 12:54:33 +08:00
Julian_Chu e79e76f230 Bug 1351605 - store start-intent in activity r=sebastian
`getIntent()` not always returns the intent whith start this Activity
due to GeckoApp.onCreate reset it. We make a copy here in case of this
activity is destroyed and re-created.

MozReview-Commit-ID: 7TF3b1WdbM2
2017-04-06 11:40:04 +08:00
Grigory Kruglov 22864fe6de Bug 1350442 - Remove redundant storeDone from the RepositorySession class r=rnewman
Confusion between storeDone() and storeDone(long end) resulted in certain sessions (bookmarks
and form history) not overriding the current method. As a result, their final "flush the queue"
methods weren't being called by the buffering middleware.

This patch removes the storeDone(long end) method, making such confusion a non-issue.

Given that a lot of sessions tend to build up buffers which they need to then flush after a storeDone()
call, passing in a timestamp into that method doesn't make sense. Instead, let's supply a default
implementation in RepositorySession which calls onStoreCompleted(endTimestamp) with current time,
and allow sessions to override this method and own the onStoreCompleted(endTimestamp) call.

MozReview-Commit-ID: 84o7aAL8RPC
2017-03-31 19:00:13 -04:00
Grigory Kruglov 862b7aa8f6 Bug 1343726 - Respect max_record_payload_bytes limit while uploading records r=rnewman
If we try to upload a record whose payload BSO field is larger than the limit specified
by the server, fail that record during BatchingUploader's processing.

Consequently, Synchronizer will fail current sync stage and advance to the next.

Previous behaviour was to essentially rely on the server to fail our POST request,
at which point we'll fail current sync stage. So in a way, this is an optimization to
avoid making network requests which we know will fail.

MozReview-Commit-ID: 5aJRRNoUuXe
2017-03-15 13:51:31 -07:00
Edouard Oger a6834582f3 Bug 1265314 - Set tabs record lastModified to clients.lastModified. r=nalexander
MozReview-Commit-ID: 84g7WXxRwdX
2017-03-24 15:40:34 -04:00
Julian_Chu 85d399af7f Bug 1336373 - CustomTabsActivity supports tint in Action Button r=sebastian
If 3-rd party app specify to use tint for Action Button, use primary
text color as the tint color for Action Button.

MozReview-Commit-ID: 3sX0MH8P0dM
2017-03-20 13:59:43 +08:00
Grigory Kruglov 0883c803e4 Bug 1346438 - Specify X-I-U-S header value while uploading meta/global r=nalexander
We upload meta/global in three scenarios:
- fresh start
- when it was modified after a successful sync
- when it was modified after an aborted sync

Use X-I-U-S header to assert what we believe about meta/global's presence (during freshStart)
and last-modified timestamp (in all other cases).

We might encounter a concurrent modification condition, manifesting as a 412 error. If we see such an error:
- on fresh start, we restart globalSession
- on regular upload, we request a re-sync of all stages

MozReview-Commit-ID: 3qyb6rUSOeY
2017-03-20 16:40:13 -07:00
Edouard Oger fb4be5746b Bug 1254643 - Delete FxA device when Fennec Firefox Account is removed. r=Grisha
MozReview-Commit-ID: H4lJlXGYIBg
2017-03-13 14:35:41 -04:00
Julian_Chu ad635dc1d7 Bug 1315937 - Add share item to menu if necessary r=sebastian
3rd-party app could ask to add default share item to menu, and share
the data url to other activities if user click the share-menu-item.

MozReview-Commit-ID: HkDyENJtFn9
2017-03-02 17:05:28 +08:00
Julian_Chu a06f500f39 Bug 1315937 - Add custom items to menu of CustomTabsActivity r=sebastian
If 3rd-party app provides any custom menu items, add them to PopupMenu
and handle corresponding pending intent.

MozReview-Commit-ID: 5STg49hsCWF
2017-03-02 16:44:56 +08:00
Sebastian Kaspari 26ee58e85c Bug 1312016 - Activity Stream: Implement highlights ranking to mirror desktop add-on behavior. r=Grisha
This patch has multiple changes folded into:
* Remove old highlights query
* Add new query for retrieving recent history to consider for highlights
* First version of highlights ranking implementation
* Add new loader implementation that will return a list of Highlight objects instead of a Cursor
* Modify UI code to work with Highlight objects instead of a Cursor.

MozReview-Commit-ID: Pdx2YxrZKA
2017-02-13 18:14:23 +01:00
Andrzej Hunt 4734a16730 Bug 1341527 - Add restrictions mocking to SuggestedSitePreparer test r=sebastian
MozReview-Commit-ID: 6Eii88A5IHN
2017-02-23 14:09:04 -08:00
Andrzej Hunt 488a89b241 Bug 1341527 - Move UserManager mocking into helper class r=sebastian
We need this for more than one test, let's have one copy we can call
from wherever it's needed.

MozReview-Commit-ID: Bd0o38KcqQc
2017-02-23 14:08:51 -08:00
Andrzej Hunt fa91be6536 Bug 1342105 - actually return if suggested site data is missing r=sebastian
MozReview-Commit-ID: GdshIa0e5Cj
2017-02-23 09:17:05 -08:00
Michael Kaply 556c2720b3 Bug 1031210 - Add junit tests for StringUtils.stripScheme. r=snorp 2017-02-27 16:21:47 -06:00
Jing-wei Wu 97abf78000 Bug 1323366 - Create new IconRequest to prevent ConcurrentModificationException, r=sebastian 2017-02-20 09:45:16 +08:00
Grisha Kruglov dc28277d01 Bug 1291821 - Post: remove unused files r=rnewman
MozReview-Commit-ID: 4qM5vx4AQyQ
2016-11-29 13:36:26 -08:00
Grisha Kruglov 37a9189269 Bug 1291821 - Allow BatchingDownloader to resume downloads using offset r=rnewman
BatchingDownloader uses provided RepositoryStateProvider instance in order to track
offset and high water mark as it performs batching.

The state holder objects are initialized by individual ServerSyncStages, and prefixes are used to ensure keys
won't clash.

Two RepositoryStateProvider implementations are used: persistent and non-persistent. Non-persistent
state provider does not allow for resuming after a sync restart, while persistent one does.

Persistent state provider is used by the history stage. It is fetched oldest-first, and records are applied
to live storage as they're downloaded. These conditions let use resume downloads. It's also possible to
resume downloads for stages which use a persistent buffer, but currently we do not have any.

Offset value and its context is reset if we hit a 412 error; it is maintained if we hit a sync deadline, allowing us to
minimize number of records we'll redownload. BatchingDownloaderController owns resuming and context checking logic.

High water mark (h.w.m.) is maintained across syncs and used instead of stage's "last-synced" timestamp if said stage is
set to fetch oldest-first and explicitely allows use of a h.w.m. Server15RepositorySession provides correct timestamp
to RecordsChannel, decoupling BatchingDownloader from this logic.

MozReview-Commit-ID: IH28YrDU4vW
2017-01-19 13:11:18 -08:00
Grisha Kruglov dd5f110508 Bug 1291821 - Track incomplete stages and re-sync them r=rnewman
Stage re-sync is requested if:
- We hit a 412 either during batching download or batching upload
- We hit a sync deadline either during batching download or when merging records from the buffer

SessionStoreDelegate interface was expanded with onStoreFailed,
indicating that not just a particular record failed, but the whole operation did.

onFetchFailed is used to inform delegates of 412/deadline failures during downloads.
Three new exception types were added, to facilitated messaging between different layers.

MozReview-Commit-ID: Ltdi5noEvdV
2017-02-24 13:04:54 -08:00
Grisha Kruglov 6694eb16a3 Bug 1291821 - Move bulk insert logic for new history to BrowserProvider r=rnewman
This commit does two things:

1) It simplifies history insertion logic, which wrongly assumed that history which was
being inserted might be not new. As such, it was necessary to check for collisions of
visit inserts, record number of visits actually inserted, and update remote visit counts
correspondingly in a separate step, making history insert a three step operation (insert
history record, insert its visits, update history record with a count). However, bulkInsert
runs only for records which were determined to be entirely new, so it's possible to drop
the third step.

2) Makes all of the insertions (history records and their visits) run in one transaction.
Prepared statements for both history and visit inserts are used are used as a
performance optimization measure.

MozReview-Commit-ID: 48T4G5IsQNS
2016-11-29 13:42:53 -08:00
Grisha Kruglov 450845fdce Bug 1291821 - Rename repositories/sessions r=rnewman
We're at Sync 1.5 now, so might as well rename the files.

Also, renamed the ConstrainedRepository... to a name that's more reflective
of that session's role after the changes.

MozReview-Commit-ID: 96XCzoBzD5D
2017-02-24 13:04:15 -08:00
Grisha Kruglov c657289982 Bug 1291821 - Get tests to work after sync changes r=rnewman
MozReview-Commit-ID: 3djnmEmzndU
2016-10-11 20:02:02 -07:00
Grisha Kruglov 7ef52aeb7d Bug 1291821 - Split history stage into recent and full history stages r=rnewman
Recent history stage will only run if full history stage did not complete yet.
Bug 1316110 tracks follow up work to make this more efficient.

MozReview-Commit-ID: 7dtbfEFUMGB
2016-11-16 14:53:07 -08:00
Grisha Kruglov 6c724c5e88 Bug 1291821 - Remove total sync limits, refactor batching downloader r=rnewman
MozReview-Commit-ID: 2SYxemfTv9V
2016-10-20 13:34:06 -07:00
Grisha Kruglov 5cefe7fd87 Bug 1291821 - Decouple BatchingUploader from Server11Repository r=rnewman
MozReview-Commit-ID: 7mPy1cmr3vq
2016-11-01 18:55:15 -07:00
Grisha Kruglov 157f1c2da3 Bug 1291821 - Simplify onFetchFailed, clean up some exception code r=rnewman
MozReview-Commit-ID: 11sIAPCfLWk
2016-10-11 19:29:46 -07:00
Grisha Kruglov 7b9c7bffd2 Bug 1291821 - Add onBatchComplete to a FetchRecordsDelegate r=rnewman
Intended to signal that a group of records have been fetched, and more are
to come after a pause.

MozReview-Commit-ID: 8ozZTc6aNdA
2016-10-11 19:29:02 -07:00
Grisha Kruglov e4b277828a Bug 1291821 - Rename RepositorySession's delegate to storeDelegate, for clarity r=rnewman
Otherwise we often end up with delegate meaning both fetch delegate and store delegate
in extending classes, which gets a little confusing.

MozReview-Commit-ID: L4Sd79jLr88
2016-10-08 17:03:38 -07:00
Grisha Kruglov 96b897ab0f Bug 1291821 - Buffering repository middleware r=rnewman
MozReview-Commit-ID: GS3M7k670Po
2017-01-19 13:11:41 -08:00
Grigory Kruglov dd41766931 Bug 1336001 - Refactor BatchingUploader's state-holder objects to fix threading problems r=rnewman
Previous state:
- Two threads were racing to get to batchMeta - one to reset its state, and the other to
read its internal state to construct a network request, and then to update its internal state.
- This resulted in data corruption when payloads had to be split into multiple batches.

A core problem was that there is a lot of state shared across thread boundaries. Specifically,
BatchMeta is being written and read both by record consumer threads running off of a thread pool,
and by the network worker thread(s).

This patch refactors BatchMeta and scheduling of network runnables to ensure that cross-thread access
is minimized, and "who owns/accesses what" is explicit.

- PayloadDispatcher owns scheduling payload runnables and any data they need to share between each other.
- UploaderMeta owns information that's necessary to process incoming records.


MozReview-Commit-ID: 9hFs3fXGaGM
2017-02-22 11:26:35 -08:00
Andrzej Hunt 96a9080853 Bug 1320775 - Add tests for SuggestedSiteLoader/Preparer r=sebastian
MozReview-Commit-ID: GXB4Ott4MAi
2017-02-08 16:37:30 -08:00
Andrzej Hunt 5c62a52f1c Bug 1320775 - Use bundled touch-tiles as favicons for suggested sites r=sebastian
There are a number of ways in which we could supply favicons for the default suggested
sites. Reusing the touch tiles has the advantage that it works for both our own suggested
sites, and also distribution-supplied suggested sites. If we were to add yet another
icon source, distribution supplied sites would end up having no nice icon in AS topsites.

The priority ordering of the SuggestedSitePreparer means icons will be overriden as soon
as a site-supplied favicon is available - these icons will only be used up until the point
where a site has been visited.

MozReview-Commit-ID: CHsinHHpfnw
2017-02-08 15:15:12 -08:00
Andrzej Hunt 5b7058bf0e Bug 1320775 - Pre: move favicon colour fading to color generator r=sebastian
In order to allow for a background which merges into a favicon, we
need to allow for solid (non faded) colours. It is simplest to do this
by letting the colour generator (i.e. either the colour extractor,
or the favicon generator) fade the dominant colour as it wishes.
That also means the colour generator can in future choose to
not fade the colour if appropriate.

MozReview-Commit-ID: LsI8PlZsaGn
2017-02-08 10:12:24 -08:00
Julian_Chu d7f430b05e Bug 1329144 - CustomTabsActivity supports ActionButton r=sebastian
3rd-party-app could launch CustomTabsActivity, and could also configure
a custom action button. Now let CustomTabsActivity supports it by
creating a MenuItem.

MozReview-Commit-ID: 2KuMgBJy2gz
2017-02-03 16:03:21 +08:00
Julian_Chu a9162a54dd Bug 1329144 - IntentUtil can extract ActionButton info from Intent r=sebastian
To support ActionButton in CustomTabsActivity, information should be
extract from intent.

MozReview-Commit-ID: 3C19U0EQfV6
2017-02-03 13:42:13 +08:00