Commit Graph

618 Commits

Author SHA1 Message Date
Makoto Onuki
0e86dfb802 Merge "Merge "ShortcutManaegr: bug fixes" into nyc-mr1-dev am: 5b9d876ef5" into nyc-mr1-dev-plus-aosp
am: ccf9c83765

* commit 'ccf9c8376595ddbed64cedd236349cb99a2e8708':
  ShortcutManaegr: bug fixes

Change-Id: I2aeb67ca5f46165b63e685c90d8acf6cb909b351
2016-05-04 22:09:57 +00:00
Makoto Onuki
8569452603 ShortcutManaegr: bug fixes
Fixes 28590035
Fixes 28586105

Change-Id: Ia11d29e4996ad5b47b279a3c04d9586695cdc0a5
2016-05-04 13:00:41 -07:00
Hui Shu
eeba24d9a0 Merge "Fix the unit tests for WebView downgrade logic" 2016-05-03 21:08:07 +00:00
Chih-Hung Hsieh
d53e3bed1c Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I080090d50f1a368a4e7c1a0732297bb6a295e34f
2016-05-03 10:02:51 -07:00
Makoto Onuki
d1bc17aacd Merge "Merge "ShortcutManager: finishing touches" into nyc-dev am: 7d164d35a4" into nyc-mr1-dev am: 59cfcb502d
am: 2c0af8597d

* commit '2c0af8597dd3edb155893453dbb03027dc95135e':
  ShortcutManager: finishing touches

Change-Id: Id54d01e50b8120b898263a674b1886e2f5c16ac4
2016-05-03 16:45:09 +00:00
Makoto Onuki
4d36b3a8c5 ShortcutManager: finishing touches
- Change back the throttling quota to 10 calls / day
- Foreground apps are no longer throttled, and when an app comes to
foreground the call counter will be reset.
- When the system locale changes, reset throttling for all packages
for all users.
  See LocalService.onSystemLocaleChangedNoLock() for how it's performed.
  Because the reset must happen before any other apps have a chance to
  publish shortcuts, the logic is not straightforward.

- Added an internal API to reset the throttling upon inline-reply
from a notification.

- Stop supporting icons from "content:" URIs
- Improved javadoc on several APIs.

Also internal refactor needed to this:
- ShortcutUser.getAllPackages()/getAllLaunchers() are no longer
accessible to outer code to prevent accidentally adding/removing the
content.  Outer code should use forAllPackages() / forAllLaunchers().

Bug 27923857

Change-Id: I002511193d1d33718163bb1dabe77610bde58198
2016-05-02 12:02:19 -07:00
Hui Shu
826a24b296 Fix the unit tests for WebView downgrade logic
Shift the branch numbers by 5 digits to construct the versionCode according to
Chromium versionCode scheme.

Changed "non-system version" to "candidate version" because a package under
comparison could be a system package too.

Also add a new test for the fallback being used case.

BUG: 28050853
Change-Id: I25becb713a8840e579ded55b8882224c6b69e1bb
2016-04-29 11:41:34 -07:00
Makoto Onuki
5cc48412b2 Merge "ShortcutManager: When app\'s data is cleared, remove all shortcuts," into nyc-dev am: d1c30db548 am: 07f8d94c6e
am: a1bca975ef

* commit 'a1bca975efce3830d3c97a98db785151daeda465':
  ShortcutManager: When app's data is cleared, remove all shortcuts,

Change-Id: Ib8af31efc5117528d2599fa03bd5ed74f6606fe7
2016-04-28 20:20:53 +00:00
Makoto Onuki
9ac59d0438 ShortcutManager: When app's data is cleared, remove all shortcuts,
as if it's uninstalled.

Fixes 28196831

Change-Id: I1a410372f9e344a10567b00057fa0770eac9fd76
2016-04-28 10:52:02 -07:00
Makoto Onuki
b483bd391f Merge "When app is updated, save the new version code, and update shortcuts with resource based icons." into nyc-dev am: 711ffe6 am: b1acc71
am: 41c1df9

* commit '41c1df9de514eb2f959a275cef36ebed37d754a6':
  When app is updated, save the new version code, and update shortcuts with resource based icons.

Change-Id: I1039c773715c4fdfd5fbba484dc425dfcd3b07d6
2016-04-26 00:37:10 +00:00
Makoto Onuki
711ffe620e Merge "When app is updated, save the new version code, and update shortcuts with resource based icons." into nyc-dev 2016-04-26 00:07:59 +00:00
Paul Jensen
8923eb742d Merge "Cap number of NetworkRequests a UID can make to 100" into nyc-dev am: 3f45105353 am: eedfc5457f
am: 3e3de5d7d7

* commit '3e3de5d7d7379d4aa296a43ca41df4c1ded0858b':
  Cap number of NetworkRequests a UID can make to 100

Change-Id: I72fe474d3618c2900e972cefdc85e80767610405
2016-04-21 13:59:20 +00:00
Paul Jensen
3f45105353 Merge "Cap number of NetworkRequests a UID can make to 100" into nyc-dev 2016-04-21 13:47:13 +00:00
Fyodor Kupolov
bd17290395 Merge "Test coverage for new FBE functionality" into nyc-dev am: 366a457 am: fb91c83
am: fdb8147b44

* commit 'fdb8147b44caf5be4223d6c9859cdbb1f25885df':
  Test coverage for new FBE functionality

Change-Id: I2eb142f6e8a6c33cce69366a0387a8295ceb1759
2016-04-21 00:22:36 +00:00
Fyodor Kupolov
390802b6d3 Test coverage for new FBE functionality
Added testRemovedAccountSync, which removes account when the user is locked,
and verifies that syncDeCeAccountsLocked works as expected.

Added testPreNDatabaseMigration to test that pre-N database with existing
data is properly upgraded and migrated.

Bug: 26279712
Change-Id: I3846c626f616b1c4830965c9f0cb27fa32ce6f54
2016-04-20 10:47:58 -07:00
Paul Jensen
4e1d3fdf7a Cap number of NetworkRequests a UID can make to 100
This prevents DoSing ConnectivityService with too many requests.

Fixes: 27253080
Change-Id: Id0480d220b2f01b9ef1146bef8ead2fc8287e28d
2016-04-20 10:52:47 -04:00
Robin Lee
b0cde5b7c7 Merge "Unit test for UidRange.java and UidRange.cpp" into nyc-dev am: 79c4dca am: 71edae1
am: fcf5f4c

* commit 'fcf5f4c9bf34666c87dd589df41aaff118241143':
  Unit test for UidRange.java and UidRange.cpp

Change-Id: Id7eaab8ce6a2758f175fd855ff7e552c73f08bd9
2016-04-19 19:41:16 +00:00
Robin Lee
79c4dca2a8 Merge "Unit test for UidRange.java and UidRange.cpp" into nyc-dev 2016-04-19 19:25:41 +00:00
Robin Lee
cfe2669028 Unit test for UidRange.java and UidRange.cpp
Verifies that:
 - UidRange only accepts non-negative UIDs
 - UidRange only accepts start UID <= stop UID
 - Native implementation is in sync with java implementation (via JNI)

Change-Id: I8b412781efe9cfda6d5e666e37fe0d8f5e2b6ecc
2016-04-19 00:44:12 +01:00
Gustav Sennton
18c9e151fd Add unit tests verifying the webview package versioncode validation
We recently added functionality for ensuring that a webview package
cannot be used unless its version code is at least as high as the
minimum of the version codes of the default webview packages.
This CL contains unit tests for verifying this functionality.

Bug: 28050853
Change-Id: Iaf6d5999e420a7eddc4df06aaeefd68ee545422e
2016-04-18 14:58:33 +00:00
Makoto Onuki
36f4afbcca Merge "ShortcutManager: Categories should be Set, not List." into nyc-dev am: e2be9f4
am: 2870094

* commit '2870094a86531e977898681aef503bb393b24a3e':
  ShortcutManager: Categories should be Set, not List.

Change-Id: I114c3ac304bed3b237128c2e330dec0fe19f6613
2016-04-16 15:28:06 +00:00
Makoto Onuki
be73a8068f ShortcutManager: Categories should be Set, not List.
Bug 27923857

Change-Id: Ife859da8e66478174f6c4463316886a23e5aa4e0
2016-04-15 17:15:29 -07:00
Makoto Onuki
39686e8cde When app is updated, save the new version code, and update shortcuts
with resource based icons.

Bug 28152054

Change-Id: I14f537c08b1a0ba48dd508b0c42fc1d3ed4f5eb0
2016-04-15 12:33:15 -07:00
Makoto Onuki
da18a4cabb Merge "Remove all icon bitmaps when a publisher is uninstalled." into nyc-dev am: 1c685d2
am: 0da2457

* commit '0da2457a9b917b215e925dd6d33f5790e67beb70':
  Remove all icon bitmaps when a publisher is uninstalled.

Change-Id: I2af330494fe9a69328cb65a246497bbfb4182273
2016-04-15 16:42:51 +00:00
Makoto Onuki
0033b2a190 Remove all icon bitmaps when a publisher is uninstalled.
- Also show the directory sizes on dumpsys.

Bug 28196831

Change-Id: I3202fcd3151da3b26b436732e8103caf93aba525
2016-04-14 17:42:32 -07:00
Gustav Sennton
ed63a70163 Merge "Fix the behaviour for explicitly switching WebView provider" into nyc-dev am: 4f9ad45
am: a660929

* commit 'a66092918e707d4fa934eb8c08e55404048fe2cf':
  Fix the behaviour for explicitly switching WebView provider

Change-Id: I2807de28aada663b8ba3aca25051bebd4d63c1eb
2016-04-14 19:36:31 +00:00
Gustav Sennton
efdd58b1df Merge "Update persistent WebView packages setting only when user changes it." into nyc-dev am: 45e2966
am: c08ac79

* commit 'c08ac79a21722bf793d328e652e6f64118d90fca':
  Update persistent WebView packages setting only when user changes it.

Change-Id: Ied22fed362a718cff0b1892dc199ac74e336de03
2016-04-14 19:28:23 +00:00
Gustav Sennton
95f7e8e06d Fix the behaviour for explicitly switching WebView provider
Before this CL when we tried to change WebView provider through the Dev
setting and failed we would then have the setting point to the provider
used before the change. With this CL we instead let the setting point to
the intended target but also switch to the package which the
WebViewUpdateService see as most fit (rather than just reverting back to
the original choice).

Add unit tests to verify we kill processes depending on WebView
packages when switching WebView provider.

Add unit tests to ensure we can recover from trying to change provider
when there are no providers available.

Bug: 27673076
Bug: 27635535
Change-Id: Ie7bb6afdf8acf4344cfb363947929c0b492775fb
2016-04-14 16:50:32 +01:00
Gustav Sennton
45e2966da9 Merge "Update persistent WebView packages setting only when user changes it." into nyc-dev 2016-04-14 10:58:42 +00:00
Gustav Sennton
a9159040c8 Update persistent WebView packages setting only when user changes it.
To ensure that we don't permanently change WebView implementation if the
current package is temporarily uninstalled (e.g. when being replaced) we
don't update our persistent setting unless the user explicitly changes
WebView implementation (and on boot!).

Unfortunately this will means that the Dev Setting for changing WebView
implementation will work in a slightly less intuitive way. The
persistent setting is now persistent across uninstalls and installs.
I.e. the Dev Setting shows the current WebView implementation though
that could differ to the value chosen by the user since the package
chosen by the user could be uninstalled or disabled. In this case
installing/enabling that package would again make the Dev Setting point
to it.
However, as a compromise, we do change the setting at boot so that if
the currently chosen package is not valid we will change the setting so
that it points to the package we currently use instead.

Also ensure we only use WebView packages that are available-by-default
if no WebView packages are enabled.

Add unit test to ensure that if a user-chosen provider is uninstalled we
switch back to using that provider when it is installed again.
Add unit test to ensure we switch user-chosen provider at boot if the
chosen one is uninstalled.

Bug: 27673076
Change-Id: Icd27ae302798ebf695b9ef4bd4d5fd47fe4be02c
2016-04-13 16:30:03 +01:00
Paul Jensen
45dd59b0f1 Merge "If Internet probe is redirected, pass redirect destination to NetworkAgent." into nyc-dev am: 3e6a6fc
am: 2c1f03a

* commit '2c1f03ade023a61428b7d9101bc10e4c88ae941a':
  If Internet probe is redirected, pass redirect destination to NetworkAgent.

Change-Id: I4c5f5cb8591d8729de9036a6c2aabacd4aba0f39
2016-04-13 02:02:13 +00:00
Paul Jensen
3e6a6fc60e Merge "If Internet probe is redirected, pass redirect destination to NetworkAgent." into nyc-dev 2016-04-13 01:33:37 +00:00
Makoto Onuki
a9a8d44cdc Merge "ShortcutManager: Address API review feedback." into nyc-dev am: 1d616f0
am: 9d25ead

* commit '9d25ead98b6b09611fd95dfdd2b49ef5191ea030':
  ShortcutManager: Address API review feedback.

Change-Id: I663034ac1ae3bdb7b0757efae0396235784b8dce
2016-04-12 23:07:29 +00:00
Makoto Onuki
1d616f0d88 Merge "ShortcutManager: Address API review feedback." into nyc-dev 2016-04-12 22:34:17 +00:00
Makoto Onuki
b6d3523dfb ShortcutManager: Address API review feedback.
- "delete" -> "remove"
- add/deleteDynamicShortcut() now takes a list.
- Throttling default settings is now 2 calls / hour.

- Add categories to ShortcutInfo.
- getIconResourceId() is now public

Bug 27923857
Bug 27548047

Change-Id: I8457b30e4b2f7c63ab2988648b37178fd16ea45b
2016-04-12 10:35:20 -07:00
Ricky Wai
1add1e29b0 Merge "Add tests for profile keys in LockSettingsStorage" into nyc-dev am: 321cfa3
am: fbf7eda

* commit 'fbf7edafdc9b35c63374ca1ac2fe59557efb7b0d':
  Add tests for profile keys in LockSettingsStorage

Change-Id: I13e982d279bdfc67f3ac478efbafcc58180a2cfb
2016-04-12 17:02:11 +00:00
Ricky Wai
321cfa3791 Merge "Add tests for profile keys in LockSettingsStorage" into nyc-dev 2016-04-12 16:42:56 +00:00
Gustav Sennton
8ff7fa922a Merge "Add initial unit tests for WebViewUpdateService." into nyc-dev am: ce2cb76
am: bfac3f5

* commit 'bfac3f5ec6cd7a78600dbece8cb451d6866de5e1':
  Add initial unit tests for WebViewUpdateService.

Change-Id: If8d72fb7caafdb1a1b43e763b09a806971772417
2016-04-12 15:34:31 +00:00
Gustav Sennton
53b78241ff Add initial unit tests for WebViewUpdateService.
The logic in the WebViewUpdateService is now more complex and there
are lots of edge cases that should be tested to make sure we don't
regress anything.

Also refrain from running fallback logic on boot if fallback logic not
enabled (bug found through a failing test, yeeah buddy!).

Catch uncaught MissingWebViewException (very timing-dependent!) and add
test for this.

Add tests for:
Some package setups (single package, non-default vs. default packages,
    valid vs. invalid packages).
Ensure correct error codes used
Switching provider through settings-method
Switching provider through adding more prioritized provider
Switching provider in the middle of already running webview preparation
Ensure fallback logic is run when enabled and not run when disabled (at
    boot, packageStateChanged, and when adding a new user).

Bug: 27635535

Change-Id: I275ecb0f6129f71258da0fa053e7f7b36a675886
2016-04-12 14:25:38 +01:00
Paul Jensen
2324373124 If Internet probe is redirected, pass redirect destination to NetworkAgent.
Transport may use the redirect to make additional determination about network
state.

Bug: 25203607
Change-Id: I07d8918f13fdcbe0b6fd757536bfc1850a2a244f
2016-04-12 08:54:36 -04:00
Ricky Wai
a46b40fd5c Add tests for profile keys in LockSettingsStorage
Bug: 27940135
Change-Id: Iade153f6607db4c75385bed6f20d3120c10674b0
2016-04-12 11:26:27 +00:00
Makoto Onuki
1187239423 Merge "ShortcutManager: First cut of CTS" into nyc-dev am: bc20320
am: 0beb56d

* commit '0beb56d4e49f433759f7c825374c90442f2aed53':
  ShortcutManager: First cut of CTS

Change-Id: I048150bf9451e8d28dc599673321bd31f8d119a1
2016-04-11 23:30:43 +00:00
Makoto Onuki
bc20320f7f Merge "ShortcutManager: First cut of CTS" into nyc-dev 2016-04-11 23:11:41 +00:00
Fyodor Kupolov
4108e269f2 Merge "Make AccountManagerServiceTest work again" into nyc-dev am: 518bae5
am: 3c4a3bb

* commit '3c4a3bb3c55a68146b3bb5febb2fee674fddd8e7':
  Make AccountManagerServiceTest work again

Change-Id: Iad16fed7ec0514f62d9cef91e3aeda3b0e7f04e8
2016-04-11 22:49:49 +00:00
Fyodor Kupolov
eeca6584cf Make AccountManagerServiceTest work again
It was broken for quite a while. Introduced the following changes:
- Use mockito to mock AppOpsManager and UserManager
- Use MockContext directly and override what is necessary.
  RenamingDelegatingContext doesn't work with absolute file names for
  database paths, which is the case for system server DBs.

Bug: 26279712
Change-Id: I9f2a3892f9bd7a882d78f0bb7beb8669f7dc8c6f
2016-04-11 15:33:45 -07:00
Makoto Onuki
5ba0d3e3a3 ShortcutManager: First cut of CTS
Bug 27548047

Change-Id: Idd7a768ea4fee44c2cf6e3bd473cea9e67f5f7cd
2016-04-11 14:48:44 -07:00
Makoto Onuki
b29ec1a7e4 Merge "Add UserHandle to ShortcutInfo, and simplify LauncherApps APIs." into nyc-dev am: 390a813
am: 9a98e46

* commit '9a98e4679a64e8293a8b74677bb6b2839dae6a31':
  Add UserHandle to ShortcutInfo, and simplify LauncherApps APIs.

Change-Id: Ifb1f6d3331af119893007b46909e0e5ffcb210fc
2016-04-11 17:01:07 +00:00
Fyodor Kupolov
d0dba8b973 Merge "Added getProfileIds method returning array of userIds" into nyc-dev am: 4c74334
am: 036bdca

* commit '036bdcac4499b3ce6932f1ed237797332609c329':
  Added getProfileIds method returning array of userIds

Change-Id: If88d4c3d480be43fedae6a976467706bfbaf37b7
2016-04-11 16:50:59 +00:00
Makoto Onuki
390a81302f Merge "Add UserHandle to ShortcutInfo, and simplify LauncherApps APIs." into nyc-dev 2016-04-11 16:45:10 +00:00
Fyodor Kupolov
4c74334c44 Merge "Added getProfileIds method returning array of userIds" into nyc-dev 2016-04-11 16:40:55 +00:00