Commit Graph

2254 Commits

Author SHA1 Message Date
Hugo Benichi
b5c5b9d36c Merge "Merge "Add convenience methods to IpPrefix and LinkAddress" am: 2ad60c88f1 am: ea2defe62b am: 4d7787a310 am: e9291de0c4" into oc-mr1-dev-plus-aosp
am: 4351aecb2d

Change-Id: I3b2b7dcb1a9a194fc08643b27bbb5a0e84e01412
2017-08-16 19:22:46 +00:00
TreeHugger Robot
5eb8bfdd15 Merge "Fixed coretest DisabledTest" 2017-08-16 17:40:52 +00:00
TreeHugger Robot
7e7dceb8ab Merge "Change test assumptions about formatting the GMT timezone" 2017-08-16 16:58:57 +00:00
Hugo Benichi
202cc407c2 Merge "Add convenience methods to IpPrefix and LinkAddress" am: 2ad60c88f1 am: ea2defe62b am: 4d7787a310
am: e9291de0c4

Change-Id: Ied0cc53ac34c7c5f5539507b1979cbf9c215262e
2017-08-16 15:20:59 +00:00
Hugo Benichi
e9291de0c4 Merge "Add convenience methods to IpPrefix and LinkAddress" am: 2ad60c88f1 am: ea2defe62b
am: 4d7787a310

Change-Id: I8d6dd5efd226a8b1c4b05d1e1102362b58e094a1
2017-08-16 15:09:12 +00:00
Hugo Benichi
ea2defe62b Merge "Add convenience methods to IpPrefix and LinkAddress"
am: 2ad60c88f1

Change-Id: I6d3f3c50eaec44e3a0787e849ab28e89f6f4a72d
2017-08-16 14:49:27 +00:00
Hugo Benichi
1dfb6b6755 Add convenience methods to IpPrefix and LinkAddress
Also moving relevant test files into tests/net as part of runtest
framworks-net.

Also removes testHashCode in LinkAddress() because this test relies on
the assumption that hashCode() is stable across releases or jdk
versions, which is absolutely not true.

This creates maintenance work for little benefit since hashCode is
already tested as part of the equality test.

For instance this test is now broken because hashing for InetAddress
changed.

Bug: 62988545
Bug: 62918393
Test: runtest frameworks-net, added coverage in tests
Change-Id: I695bc3f0e801bf13bc4fc0706565758f12b775b4
2017-08-16 21:42:21 +09:00
Evan Rosky
1ed8bdaa0c Fixed coretest DisabledTest
Was asserting that disabled view has focus, but disabled views
are no-longer focusable.

Bug: 64678306
Test: DisabledTest#testSetUpConditions
Change-Id: I028c4d050fa8fc578165c193928d5bb9a8d0cd1f
2017-08-15 15:40:54 -07:00
Roozbeh Pournader
5e730abeaf Change test assumptions about formatting the GMT timezone
The test assumed a certain format, which was changed with a recent
update in ICU.

Change-Id: Ib324142b7aec4e0296f49d0b4d5d53de200a4da1
Fixes: 64677938
Test: bit FrameworksCoreTests:android.text.format.
2017-08-15 14:31:50 -07:00
Lei Yu
ebd39077b5 Merge "Write currentDuration into Parcel" into oc-mr1-dev am: bd6ff3d3e5
am: 240a70f1e5

Change-Id: If1adf2162182fa178d6ea01989a57e96a9411ebe
2017-08-14 22:54:36 +00:00
Lei Yu
bd6ff3d3e5 Merge "Write currentDuration into Parcel" into oc-mr1-dev 2017-08-14 22:28:26 +00:00
Roozbeh Pournader
c9c6ee667f Merge "Support multiple languages per font in fonts.xml" 2017-08-11 23:27:50 +00:00
Roozbeh Pournader
99975a3e25 Support multiple languages per font in fonts.xml
Minikin already supports multiple languages specified per font in
I7f13b51464c9b01982bb573251d77052b9ddbd70. This CL adds a couple of
such cases into fonts.xml and clarifies in the method and the
variable names and parameters that the frameworks is handling a
multi-language string when it is.

Fixes: 26687969
Test: make -j checkbuild
Test: bit FrameworksCoreTests:android.graphics.TypefaceSystemFallbackTest
Change-Id: Ifa540a95f87921983f9069330d1dd0892538a8df
2017-08-11 12:34:26 -07:00
Sudheer Shanka
b8ad594300 Use cpu freq times to calculate power consumed by an uid.
Initially we used to approximate times spent by an uid at a particular
freq using total time spent by the uid but since now the freq times
are directly available from the proc file, we can use these to
calculate power.

Bug: 62240247
Test: bit FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Test: cts-tradefed run singleCommand cts-dev -m CtsIncidentHostTestCases -t \
      com.android.server.cts.BatteryStatsValidationTest
Test: Used some apps and verified that battery usage is attributed to
      those apps in Battery settings.
Change-Id: Ia8e2eb07fd778b8a8c83a6acec711e7b97aefdc0
2017-08-11 00:04:50 -07:00
jackqdyulei
610a0a09f2 Write currentDuration into Parcel
This cl writes currentDuration to Parcel, so in battery settings we could
use this data in anomaly detection.

Also note that in getTotalDurationMsLock(aka method1), the logic is:

result = mTotalDurationMs + getCurrentDurationMsLocked(aka method2)

Since now method2 is not zero, we also tweaked the value for
mTotalDurationMs to make method1 return the same value compared with
before.

Since getMaxDurationMsLocked depends on mNesting, which is always zero,
so we don't need to tweak value for mMaxDurationMs

All these methods are covered in BatteryStatsDurationTimerTest

Bug: 64255589
Test: runtest -x BatteryStatsTest
Change-Id: I9168be099d00bb68fedbc5bfbb7bf7f0d9aae85a
2017-08-10 16:44:30 -07:00
Abodunrinwa Toki
d762f32201 Merge "Fix failing Framework TextView tests." 2017-08-10 15:31:54 +00:00
Garry Boyer
478f94ba7f Merge "Revert multi-package APK flag to off." into oc-mr1-dev 2017-08-09 23:24:28 +00:00
TreeHugger Robot
f54f1f06a1 Merge "Make sure Layout doesn't modify the paint" 2017-08-09 19:40:49 +00:00
TreeHugger Robot
b5380b0066 Merge changes from topic 'time_format_settings'
* changes:
  Extract is24HourLocale method.
  Allow null value for TIME_12_24 setting.
2017-08-09 19:06:47 +00:00
Joachim Sauer
20c5ef73ca Extract is24HourLocale method.
This method is needed in settings to avoid code duplication.

Add a test to verify that is24HourLocale does not take the 12/24h clock
system setting into account.

Bug: 32761619
Test: bit CtsTextTestCases:android.text.format.cts.DateFormatTest
Test: adb shell am instrument -w -e class android.text.format.DateFormatTest \
        com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I21a871c11149550c7cf91aea299724a8b4fbff78
2017-08-09 20:04:44 +01:00
Tony Mak
fe931c058b Merge "Optimize filterByLanguage by caching locale objects" into oc-mr1-dev am: cb5a109d17
am: 3c5890286b

Change-Id: Ie6f1892cb334433e1bc38f9bce1a42bf23456d80
2017-08-09 18:52:23 +00:00
TreeHugger Robot
cb5a109d17 Merge "Optimize filterByLanguage by caching locale objects" into oc-mr1-dev 2017-08-09 18:35:01 +00:00
Tony Mak
afcd19c71e Optimize filterByLanguage by caching locale objects
According to traceview, most of the time spent in filterByLanguage
is calling getLocaleObject to create java.util.Locale objects.
The solution is to cache the object to save the cost. Note that both
mSubtypeLangugageTag and mSubtypeLocale are final, so it is fine to
cache the locale object.

Test: bit FrameworksCoreTests:android.view.inputmethod.InputMethodSubtypeTest
Test: bit FrameworksCoreTests:com.android.internal.inputmethod.LocaleUtilsTest
Test: Try to switch user back and forth, and tap a textview to show IME.

Bug: 37647204
Fix: 37647213

Change-Id: Ib6ff7e97b17fc547c8109af8177f05fc3ea41b08
2017-08-09 15:50:57 +00:00
Abodunrinwa Toki
4a056a5895 Fix failing Framework TextView tests.
. Fix TextViewActivityTest.testToolbarAndInsertionHandle
 . Suppress TextViewActivityMouseTest

Bug: 29591177
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityMouseTest
Change-Id: I51edcf4d7e4f179a8b02316cc1cb6314b209baad
2017-08-09 15:34:13 +01:00
Roozbeh Pournader
b1f0365dc4 Make sure Layout doesn't modify the paint
Previously, Layout would modify the HyphenEdit of the Paint passed to it
for its internal operations, potentially leaving the Paint in a different status than when
it was created. Now we use an internal copy of the Paint to modify.

Fixes: 64452136
Test: bit CtsTextTestCases:android.text.cts.
Test: bit FrameworksCoreTests:android.text.
Change-Id: I0b95a10c05711350950d6c8d6501f6af9414d413
2017-08-08 16:21:46 -07:00
TreeHugger Robot
20e6c27a46 Merge "Adding BatteryStatsUserLifecycleTests to BatteryStatsTests" 2017-08-08 21:33:18 +00:00
Siarhei Vishniakou
bf567be4e0 Merge "Remove unused code that has a potential data race." 2017-08-08 17:33:56 +00:00
Fyodor Kupolov
88f14dd257 Merge "API Review update for SQLiteDatabase" into oc-mr1-dev am: 3102245b62
am: 7aaf486267

Change-Id: I5bddc3a272a637c8c5a158a7d871087929075213
2017-08-08 17:03:42 +00:00
Fyodor Kupolov
3102245b62 Merge "API Review update for SQLiteDatabase" into oc-mr1-dev 2017-08-08 16:46:24 +00:00
Hugo Benichi
41494c10e6 Fix flaky IpPrefixTest.
Test: IpPrefixTest passes
Bug: 32561414
Merged-In: Ib4bffe9d33a6d4f5c2bd97798073de0f66d77645

(cherry pick from commit 32c6870403)

Change-Id: Ibaf11aae9b13af868bebff820c9e7615b63c8eb2
2017-08-08 14:54:08 +09:00
Suprabh Shukla
a7ae1cae35 Adding BatteryStatsUserLifecycleTests to BatteryStatsTests
Test: bit FrameworksCoreTests:com.android.internal.os.BatteryStatsTests

Fixes: 63936128
Change-Id: I309093a8206ffe3c3bf6d90ac4f40849a0406c0d
2017-08-07 18:47:42 -07:00
Adam Bookatz
ce58090c00 Merge "Package wakeup alarms are now on screen-off timebase" into oc-mr1-dev am: 0a1ae1bc56
am: e4fa69b956

Change-Id: I98043b43051f84cf99cf21d0b83ebf75b6076ab9
2017-08-07 23:42:05 +00:00
Adam Bookatz
0a1ae1bc56 Merge "Package wakeup alarms are now on screen-off timebase" into oc-mr1-dev 2017-08-07 23:22:31 +00:00
Garrett Boyer
476725d011 Revert multi-package APK flag to off.
Disable tests when multi-package APK is disabled.

Test: Ran framework tests with flag both on and off.
Change-Id: I0aae693816af06eebe1bc6cdeebf8dad4c179260
(cherry picked from commit 17041530bf)
2017-08-07 23:15:07 +00:00
Makoto Onuki
c7421baee7 Merge "Reduce duplicate strings due to the package cache." into oc-mr1-dev am: ce3e863f31
am: a0518fb7ac

Change-Id: I02cfeba937fac4815c55ea158dfdc9723a2a2031
2017-08-07 21:41:12 +00:00
Siarhei Vishniakou
acf07d23d3 Remove unused code that has a potential data race.
The function waitForWindowFocus is accessing hasWindowFocus()
that may change during the synchronized block. The function
is currently not used. Use PollingCheck instead if necessary.

Bug: 29591177
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Change-Id: Ib5399c4b00bf5ea468715ff99fb36235a87767cc
2017-08-07 12:42:41 -07:00
Fyodor Kupolov
76436c04a4 API Review update for SQLiteDatabase
SQLiteDatabase openDatabase -- should take File for first parameter
  instead of a String path

SQLiteDatabase.OpenParams.Builder -- make sure the javadocs says what
  the default openFlags is and default idle connection timeout

SQLiteDatabase createInMemory -- throw if it has trouble instead of
  returning null.

Test: cts/SQLiteDatabaseTest
Bug: 64331777
Bug: 64331778
Bug: 64330914

Change-Id: Ibecf4f4a6498795f9a5d12b94b77481e5745b523
2017-08-07 11:12:38 -07:00
Bookatz
98d4d5cf3f Package wakeup alarms are now on screen-off timebase
Previously, wakeup alarms (for an app) were using the battery-on
timebase. Now they will instead use the battery-on-screen-off timebase.
In this way, apps won't be penalized for wakeups that occurred when
the device was being actively used anyway.

Also bumps up report version to 25.
Also bumps up parcel version.

Change-Id: I1b692a9137ff28d535e7a06b539f713b54a85ea9
Fixes: 64149996
Test: manually verified count doesn't increase when screen-on
2017-08-04 15:23:51 -07:00
Makoto Onuki
4501c61d65 Reduce duplicate strings due to the package cache.
Change from the previous attempt:
- Fixed the helper class.  The original version had a few bugs.
- Bundle.readFromParcel() now handles a Parcel with a read-write helper
properly.

** Comparison **
The following charts are the actual measurement with and without the fix,
using "dumpsys system".
- The red bar is "total private dirty".
- The X axsis is time since boot.

Without fix:
- #1 First boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=1971317391
-- Private dirty stabilizes at ~16.8M.
-- Loading system packages took 1.8 seconds.

- #2 Second boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=982210726
-- Private dirty stabilizes at ~17.5M.
-- Loading system packages took 0.5 seconds.

With fix:
- #3 First boot:
-- https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=791764875
-- Private dirty stabilizes at around the same level as #1.
-- Loading system packages took 1.9 seconds.

- #4 Second boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=1820894299
-- Private dirty stabilizes at around the same level as #1.
-- Loading system packages took 0.7 seconds.

Package manager start up time with and without the fix:
- (Ignored ones that are too fast; probably the thermal throttling didn't kick in.)
- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=499396796
- Before: 3.5 seconds (average of 5 reboots)
- After: 3.6 seconds (average of 5 reboots)

Package scan speed comparison:
- With the fix, first boot.
08-03 08:49:56.851  1000   779   779 I PackageManager: Finished scanning system apps. Time: 2133 ms, packageCount: 143 , timePerPackage: 14 , cached: 0
08-03 08:49:56.971  1000   779   779 I PackageManager: Finished scanning non-system apps. Time: 121 ms, packageCount: 11 , timePerPackage: 11 , cached: 0

- With the fix, second boot.
08-03 08:53:29.387  1000   779   779 I PackageManager: Finished scanning system apps. Time: 484 ms, packageCount: 143 , timePerPackage: 3 , cached: 143
08-03 08:53:29.424  1000   779   779 I PackageManager: Finished scanning non-system apps. Time: 37 ms, packageCount: 11 , timePerPackage: 3 , cached: 11

** Conclusion **
- This CL wil slightly slow down the boot time (0.2 seconds on a thermal-throttled bullhead), but
the system server's ram consumption will go down to the no-cache level.

- Using the package cache is still faster than not using it.

Test: build, boot, reboot, adb-install, reboot
Test: bit FrameworksCoreTests:android.content.pm.PackageParserTest
Test: bit FrameworksServicesTests:com.android.server.pm.PackageParserTest
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsOsTestCases -t android.os.cts.BundleTest

Bug: 64112468
Change-Id: I30691a032cb1dd1c7f6c1966a096c2f0d07a09cb
2017-08-04 14:19:32 -07:00
TreeHugger Robot
f45256ad63 Merge "Set and restore default timezone in DateUtilsTest" 2017-08-03 23:09:42 +00:00
Abodunrinwa Toki
213791f74d Merge "Remove LangId related code." into oc-mr1-dev am: 38bbbdfae6
am: 2566e91f9f

Change-Id: Ic481522e134d17bbaaa3741208a3fee5426ce688
2017-08-03 18:19:23 +00:00
Roozbeh Pournader
26baa6a6e9 Set and restore default timezone in DateUtilsTest
Previously, the tests assumed a GMT timezone without ever setting it.
Now we set the timezone to GMT on setup and restore the original
timezone on teardown.

Change-Id: Ia168335eac28f33c094581af2437ac635cb38bd9
Fixes: 64149941
Test: bit FrameworksCoreTests:android.text.format.DateUtilsTest (with non-GMT timezone)
2017-08-03 11:11:17 -07:00
TreeHugger Robot
38bbbdfae6 Merge "Remove LangId related code." into oc-mr1-dev 2017-08-03 17:54:29 +00:00
Sudheer Shanka
d0b09dc73d Merge "Refactor BatteryStatsImpl.updateCpuTimeLocked." 2017-08-03 05:53:03 +00:00
Sudheer Shanka
3838323df6 Refactor BatteryStatsImpl.updateCpuTimeLocked.
Bug: 62240247
Test: bit FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: I666c44ef9cb4e0720564b161da0ff1c94f15d5b9
2017-08-02 18:22:04 -07:00
Dake Gu
06b1283394 Merge "View: fix setTransientState" into oc-mr1-dev am: 8eb3a3979f
am: 8701a3231b

Change-Id: Id7c933c23d472184ff7d8b91d1587bcb0853207e
2017-08-02 17:34:16 +00:00
Dake Gu
8eb3a3979f Merge "View: fix setTransientState" into oc-mr1-dev 2017-08-02 17:18:00 +00:00
Garrett Boyer
17041530bf Revert multi-package APK flag to off.
Disable tests when multi-package APK is disabled.

Test: Ran framework tests with flag both on and off.
Change-Id: I0aae693816af06eebe1bc6cdeebf8dad4c179260
2017-08-01 14:17:49 -07:00
Dake Gu
43ad57e548 View: fix setTransientState
Following four steps with RecyclerView - CardView - ImageView:
a. fade in imageview in onBind:
calling imageView.setTransientState(true)
b. RecyclerView animate the item: calling
cardView.setTransientState(true)
c. fade-in finishes, calling imageView.setTransientState(false)
d. RecyclerView animation finishes: calling
cardView.setTransientState(false)

After these four steps, RecyclerView unexpectedly has transient
state.

The problem is in step b, when calling cardView.setTransientState()
it incorrectly calls parent.childHasTransientStateChanged(this, true)
which causes RecyclerView's mChildCountWithTransientState increased
to 2. And it's decreased to 1 in step d and stay as 1 forever.

The child should only call childHasTransientStateChanged() when
actual hasTransientState() changed.

Bug: 64235615
Test: ViewTransientStateTest
Change-Id: I99ed35cc9c49e54d36590d8f1d206501fd3288f2
2017-08-01 14:17:39 -07:00
Abodunrinwa Toki
5820875975 Remove LangId related code.
FYI: We have plans to reintroduce this in some form in the near future.

Fixes: 62571798
Fixes: 64096360

Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Change-Id: I864d6c1143af6a2485cabdfe85116b5922a3e315
2017-08-01 21:22:46 +01:00