2435 Commits

Author SHA1 Message Date
TreeHugger Robot
7c8ab2651b Merge "Remove unnecessary casts on calls to findViewById" into oc-dev 2017-04-14 16:56:28 +00:00
Alan Viverette
51efddbd3b Remove unnecessary casts on calls to findViewById
Just frameworks/ this time. More paths to come.

Bug: 24137209
Test: make -j32
Change-Id: Iff27abd26fa43296ac2fff8f534fc6742d2ae80c
2017-04-14 11:15:50 -04:00
TreeHugger Robot
c223d70e64 Merge "Add Java API for libvintf." into oc-dev 2017-04-14 02:02:08 +00:00
Yifan Hong
becc56d7ea Add Java API for libvintf.
android.os.VintfObject has two methods:

- report: return device info that can be reported to OTA server
- verify: verify that metadata for a given OTA package is
          compatible.

Test: pass
Test: adb shell am instrument -w -e class android.os.VintfObjectTest \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Bug: 36814503

Change-Id: Iff8fae289eec8ae9cfc327d0d0d36a1cdd5e6800
2017-04-13 18:04:05 -07:00
TreeHugger Robot
a8fc7bff5a Merge "Collect background stats: syncs" into oc-dev 2017-04-13 21:20:14 +00:00
Bookatz
2bffb5bb3a Collect background stats: syncs
Added background times and counts for an app's sync usage.

Bug: 35669746
Test: runtest -x
frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java

Change-Id: I1c01c5044064277b97e8d330386454da3e8204da
2017-04-13 11:59:33 -07:00
TreeHugger Robot
7f0d8c8076 Merge "Remove support for auto-paging of cursors." into oc-dev 2017-04-13 18:12:14 +00:00
Hyunyoung Song
76c13a5fce Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev 2017-04-13 16:53:43 +00:00
TreeHugger Robot
061db23b79 Merge "Introduce FontsContract.fetchFonts and expose URI for watching." into oc-dev 2017-04-13 13:22:10 +00:00
Tadashi G. Takaoka
d280bfea23 Merge "Remove supportsDismissingSelfWindow attribute of IME" into oc-dev 2017-04-13 07:41:34 +00:00
Steve McKay
927b01371b Remove support for auto-paging of cursors.
Auto-paging of cursors is being removed in favor of a support lib component.
Rationale:
    1) Auto-paging as implemented has potential to negatively impact system health.
    2) Similar functionality w/o system health concerns can be provided
       specific to RecyclerView.

Test: Removed. CTS coverage updated.
Bug: 30927484
Change-Id: I43e62181d8ceeeba6265d44536967a2102751320
(cherry picked from commit 4677c2b7f0ec847f32acba067f9d2486bca56439)
2017-04-13 00:35:42 +00:00
Roozbeh Pournader
d39388219f Merge "Revert "Make selection end handle stick to selection at line end."" into oc-dev 2017-04-12 23:22:40 +00:00
Hyunyoung Song
92e3da2354 Update API, add more documentation on AdaptiveIconDrawable
and fix multiple miscellaneous bugs.

Bug: 37079814
Bug: 37100106
Bug: 34829216

Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java
Test: $ runtest --path=frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/grpahics/drawable/AdaptiveIconDrawableTest.java

Change-Id: I0f5b2232853031bf3860ebea2736e894d17e4d2e
2017-04-12 16:06:45 -07:00
Seigo Nonaka
69754bf66d Introduce FontsContract.fetchFonts and expose URI for watching.
FontsContract.fetchFonts provides a low level font access with fonts
provider.
This CL also includes:
- Introduce new class FontFamilyResult/Font as the inner static class
of FontsContract which are used to for result value of fetchFont..
- Introduce a functionality to FontsContract to be able to create
Typeface from an array of FontResult.
- Expose URI of each file entries to be able to register ContentObserver

Bug: 36494487
Bug: 36085028
Test: android.provider.FontsContract passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.fonts.cts.FontResultTest passes

Change-Id: Id6f85039d0e86be063ef099d7ec6bfd97e4424c5
2017-04-12 13:52:37 -07:00
TreeHugger Robot
684b5381e9 Merge "Rename WEB_ACTION_ENABLED to INSTANT_APPS_ENABLED" into oc-dev 2017-04-12 19:39:16 +00:00
Kang Li
7c37964cf2 Updates reportChooserSelection to be synchronized with queryUsageStats
in UsageStatsService, to fix a flaky test.

Bug: 35763877
Test: manually ran the flaky tests for 50 times, to verify that it is
stable.

Change-Id: I56d355bb283275f33bf7a24d0cc5b6454b99a35e
(cherry picked from commit 434f76a8d739060b5c8e96b4824687c19b94ee79)
2017-04-12 15:56:40 +00:00
Jesse Evans
fc1bfc442c Rename WEB_ACTION_ENABLED to INSTANT_APPS_ENABLED
Renames the instant apps setting to reflect what it is for.

Adds the SystemApi annotation to make this field visible
to the resolver and installer.

Test: existing tests

Change-Id: I1651bb101d69bdfdaa63c004435025c68a33cd8e
2017-04-12 07:00:51 -07:00
Roozbeh Pournader
7557a5a090 Revert "Make selection end handle stick to selection at line end."
This reverts commit 7c263ddd582abacbbe9c71341a6ef4c704d12100.

Fixes: 35944608
Bug: 21305922
Test: Manual
Test: Updated CTS and core tests pass.
Change-Id: Ic840f8771c3d5850f4f6f44ea199b144cac740c0
2017-04-11 18:40:44 -07:00
Bookatz
4a3eda992b Fix double-detach DualTimer bug
DualTimer attempted to detach its subTimer twice when reset(true) was
called, once explicitly and once via a call to the main timer. This
fixes that problem by getting rid of the explicit detach in reset.

Bug: 37208694
Test: runtest -x
frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
and manually looked for "Removed unknown observer" error in logcat.

Change-Id: Ic5ff7d799d46236a74ab0825e108bef40bac0360
2017-04-10 14:28:00 -07:00
Bookatz
ceebafe41a Fix counting problems in StopwatchTimer.
Changed StopwatchTimer so that its count only increases if the timer is
started when its time base is running. Previously, if the time base was
off, the timer was started, the time base was turned on, and then the
timer was stopped, the count would be increased; now, it will not
(because the time base was off when the timer started). Moreover, this
likely fixes the count==-1 bug that previously could occur, since the
count will no longer be decremented if the timer is stopped after a reset.

Fixes: 36730213
Bug: 30099724
Test: runtest -x
frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java

Change-Id: Iad195e431618629ce432074e0c1bd217f9818cb1
2017-04-07 11:12:54 -07:00
Tadashi G. Takaoka
46699675aa Remove supportsDismissingSelfWindow attribute of IME
This partially reverts CL I0f6b130a7df57557e40b52a7b7ac00be965a17c3.

Fixes: 34133139
Test: Confirm that unit test passed.
    adb install out/target/product/.../data/app/FrameworksCoreTests/FrameworksCoreTests.apk
    adb shell am instrument -w \
        -e class android.view.inputmethod.InputMethodInfoTest \
        com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I2b94263b2a0bf330bf9973567fea2d35176754d7
2017-04-07 10:43:43 +09:00
TreeHugger Robot
f68766f666 Merge "Collect background stats: scheduled jobs" into oc-dev 2017-04-05 22:13:10 +00:00
Seigo Nonaka
fe04aa840e Pass weight/italic pair instead of style.
Typeface.NORMAL/BOLD/ITALIC/ITALIC_BOLD is used for specifying relative
from current Typeface. For example

  Typeface face = Typeface.create("serif");
  Typeface thickerFace = Typeface.create(face, Typeface.BOLD);
  Typeface moreThickerFace = Typeface.create(tickerFace, Typface.BOLD);

For the purpose of providing font information, we should use weight/italic
value instead of style in Typeface.
The Columns.STYLE field was kept for preventing runtime crash of demo
apps.

Test: Manually
Change-Id: I732e8ee04a66f61321fc0a98dbfb8fdc0a4dd7a4
2017-04-04 10:12:55 -07:00
TreeHugger Robot
2ac9698271 Merge "Reorganize font enumeration API." into oc-dev 2017-04-04 16:49:56 +00:00
Seigo Nonaka
ff55115121 Reorganize font enumeration API.
This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
  This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.

Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
2017-04-03 13:55:07 -07:00
Bookatz
aa4594aad2 Collect background stats: scheduled jobs
Added background times and counts for an app's scheduled job usage.
Changes DualTimer to be a subclass of Timer so that background timers
can be easily accessed from the main timer (which is convenient for
jobs, whose ArrayMap of Timers is directly accessed outside of
BatteryStatsImpl).

Bug: 35669746
Test: runtest -x
frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java

Change-Id: Ic1d85db34346ebda94ed39f134fc0794a5877815
(cherry picked from commit d253f537a0cc15851fb0308f3ea287e6bd93dfe6)
2017-04-03 17:24:40 +00:00
Makoto Onuki
99302b55c6 Revert "Push chooser targets to the shortcut manager."
This reverts commit 58fc95dc578244b7beb687a48184045dcce788b8.

Bug 36186790
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 CtsShortcutHostTestCases
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 CtsShortcutManagerTestCases

Also all unit tests, except for the known failrues.
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: I733ee7e12a419ee7ea17ca67c56afe7b039d189a
2017-03-31 15:16:43 -07:00
Daichi Hirono
812c95d37d Allow apps to process ProxyFDCallback asynchrnously.
Previously callback methods of ProxyFileDescriptorCallback were invoked
on a background thread prepared in the framework. So all methods were
invoked and processed synchronously. This was problem because if it took
time to fetch bytes of one file, operations for other files were also
blocked.

The CL changes ProxyFileDescriptorCallback methods to be invoked on
Handler passed by apps. Now application can prepare a Handler per file
so that one file does not block others.

Bug: 35229514
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest#testOpenProxyFileDescriptor_async
Change-Id: Ibadc4aad4c0373a3da586459a8f775e40288c895
(cherry picked from commit 4f156065c860d916b649e2b464e9405cafc732e9)
2017-03-29 00:14:16 +00:00
TreeHugger Robot
9a8eb3db62 Merge "Add honored args when auto-paging." 2017-03-28 03:26:01 +00:00
Stephen Chen
31484af101 Remove ACTION_CONFIGURE_WIFI_SETTINGS and ACTION_WIFI_SAVED_NETWORK_SETTINGS.
ConfigureWifiSettings page will instead use WIFI_IP_SETTINGS intent.
Intent for SavedAccessPointsSettingsActivity is unused and can be
removed.

Bug: 34392691
Bug: 36516068
Test: make
Change-Id: I86547df387b41241d531e361014581d0763008ee
2017-03-27 13:18:27 -07:00
TreeHugger Robot
bfc4d59bf8 Merge "Replace possibly-expensive size() == 0 with isEmpty()" 2017-03-27 17:15:25 +00:00
Steve McKay
d39da943da Add honored args when auto-paging.
Increase test coverage.

Test: Improved!
Change-Id: Icba97c5e821e6cb60157e0c8a5b204d0d2813bc8
2017-03-25 07:43:37 -07:00
Sudheer Shanka
d292c15558 Merge "Update AMS to use NetworkManagementInternal.isNetworkRestrictedForUid." 2017-03-25 08:01:13 +00:00
TreeHugger Robot
cb34b96796 Merge "Collect background stats: bluetooth, wifi, sensors" 2017-03-24 23:04:07 +00:00
Mike Tsao
c74ee2f8d3 Replace possibly-expensive size() == 0 with isEmpty()
Bug: 36596458
Change-Id: Ieb0ea65be056bb8ce0613280e6213c330fbf783c
Test: added ContentValuesTest
2017-03-24 15:10:41 -07:00
Sudheer Shanka
5918c6700b Update AMS to use NetworkManagementInternal.isNetworkRestrictedForUid.
And add global setting WAIT_FOR_NETWORK_TIMEOUT_MS.

Bug: 27803922
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
      cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests
      runtest -c android.provider.SettingsBackupTest frameworks-core
      and manual

Change-Id: I6949cd517255670e2ce21ab2de24271082461b11
2017-03-24 13:05:27 -07:00
Amith Yamasani
3945202dc8 Some logging for settings reset
If settings db gets reset because it disappeared/got corrupted,
then write the Build.ID of the OTA, so we know when it was reset.

Bug: 36365648
Test: manual
Change-Id: I499a7f65f07a61c0e4651dbd046fc5b16408c09d
2017-03-23 17:43:39 -07:00
Dan Shi
874a0916fc Merge "Add test configs to apct tests under frameworks/base" 2017-03-22 17:55:58 +00:00
Bookatz
867c0d72af Collect background stats: bluetooth, wifi, sensors
Added background times and counts for an app's bluetooth scans, wifi
scans, and sensor usage. Note that the original times for these three
are pooled (i.e. represent the blame apportioned to an app for using
these, rather than the actual time an app used these). Since background
times are not pooled, and are therefore incomparable to the original
times, an extra time, to represent the actual time, had to also be added
in the form of 'total duration' to which background times can be
compared.

Note that this total duration is now a feature of all DurationTimers and
can be used, e.g., to track actual wakelock time (not just
apportioned wakelock times). The total duration is the time used since
reset, and does not give other 'which' times (such as 'since
unplugged').

Bug: 35679958
Bug: 35677312
Bug: 35673525
Test: runtest -x
frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java

Change-Id: I4b6943f76517cf5cc9420684857a5592cc7495be
2017-03-22 10:18:43 -07:00
Clara Bayarri
fb483cc90c XML Support for non system font providers
The certs needed to identify non preinstalled providers
can now be declared in XML, using a resources array.

Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
Bug: 35025705
Change-Id: Ibf12ad409aa5a873ddb32b1383c147728e664c23
2017-03-22 11:47:51 +00:00
TreeHugger Robot
e6bd88625b Merge "Update PageViewCursor to correctly load window." 2017-03-22 02:57:23 +00:00
Wei Wang
86e4497982 Merge "Remove bg_non_interactive cgroup" am: c6c19bd6c0 am: 4ff81206e0
am: 98fa720826

Change-Id: If655104c7fcf319155bae82d0a3a2310f119a455
2017-03-22 00:34:11 +00:00
TreeHugger Robot
713b869aad Merge "Expose Typeface creation APIs with ttc and font variation." 2017-03-21 22:50:20 +00:00
Steve McKay
f3be60a6b3 Update PageViewCursor to correctly load window.
Bug: 36485764
Test: CTS updated and passing.
Change-Id: I2b615d97fdaedef441065889ce3a2988b718795c
2017-03-21 15:33:38 -07:00
Wei Wang
4ff81206e0 Merge "Remove bg_non_interactive cgroup"
am: c6c19bd6c0

Change-Id: I35917ee0c52720138c901fd638e07f84ae4c3cf3
2017-03-21 22:19:41 +00:00
Seigo Nonaka
20e5d91739 Expose Typeface creation APIs with ttc and font variation.
Introduce Builder class for creating Typeface from various
sources with optional TTC index and font variation settings.

Bug: 33062398
Test: Manually verified new Builder create Typeface.
Change-Id: Ia23ee6a73516707d854c7387fe75fbb22f80673d
2017-03-21 13:27:33 -07:00
Dan Shi
7f2afd2dff Add test configs to apct tests under frameworks/base
TouchLatency is needed by test TouchLatencyJankTestWear
UiBench is needed by test UiBenchJankTests

Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
make -j32 TouchLatency TouchLatencyJankTestWear  && \
tradefed.sh run template/local --template:map test=TouchLatencyJankTestWear \
      --test-tag testname --log-level-display VERBOSE
make -j32 UiBenchJankTests UiBench  && \
tradefed.sh run template/local --template:map test=UiBenchJankTests \
      --test-tag testname --log-level-display VERBOSE

Change-Id: I63f23e3a21ad1343607953958fb7bb0a5fb8c343
2017-03-21 00:05:14 -07:00
Wei Wang
3adba7202f Remove bg_non_interactive cgroup
Bug: 34193533
Test: mma
Change-Id: I0d255f47eaded15eda02a4654193a4e49c63a2c5
2017-03-20 22:16:29 -07:00
Craig Donner
dc4796c209 Allow setting a persistent VR thread.
Bug: 36215076
Test: adb shell am instrument -w -e class \
android.os.SetPersistentVrThreadTest \
com.android.frameworks.coretests/\
android.support.test.runner.AndroidJUnitRunner
cts-tradefed run cts -m CtsVrTestCases -t android.vr.cts.VrSetFIFOThreadTest
Change-Id: If2f3a5f1c8593c74ac35964f68dcbe75b4da472e
2017-03-20 13:04:36 -07:00
Jeff Sharkey
683bcd30ef Use allocatable space when measuring for install.
The system is often willing to clear cached data to make room for
incoming installs, so use StorageManager.getAllocatableBytes() when
making "does it fit?" style decisions.

Add new INSTALL_ALLOCATE_AGGRESSIVE flag, which will flow through
to use StorageManager.FLAG_ALLOCATE_AGGRESSIVE when making allocation
related requests.  (This can be used by installers to indicate
packages that are critical to system health or security.

Test: runtest -x frameworks/base/core/tests/coretests/src/android/content/pm/PackageHelperTests.java
Bug: 36131437
Change-Id: If8118762fd1ca1f497d2cdd1787bdb3c9759dcc0
2017-03-18 17:54:54 -06:00