Commit Graph

8867 Commits

Author SHA1 Message Date
TreeHugger Robot
67d50f0b86 Merge "[Magnifier - 6] Simplify API and configuration" 2017-10-24 14:37:53 +00:00
Andrei Stingaceanu
d27c36b870 [Magnifier - 6] Simplify API and configuration
* removed "scale" from the show(...) API
* made the zoom scale a dimension => the widget is
  fully self-configured
* fixed the magnifier not always scaling the content
  to the full pop-up window size

Bug: 63531115
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: Ibf5c571970c8f6bd3cdbc6d46fbe57d08291783c
2017-10-24 11:17:35 +01:00
TreeHugger Robot
7be7878769 Merge "Skip blocking InputConnection APIs after unbind" 2017-10-23 22:10:02 +00:00
TreeHugger Robot
3320de9842 Merge "Add pushing many batterystats events to statsd" 2017-10-23 19:43:50 +00:00
Bookatz
c1a050ad32 Add pushing many batterystats events to statsd
Statsd is now informed for starts/stops/etc of the following events:
BleScan
BleScanUnoptimized
BleScanResult
Sensor
Gps
Sync
ScheduledJob
UidWakelock (aggregate wakelock)
LongPartialWakelock
BatterySaverMode (power save mode)
DeviceIdleMode (doze)
ScreenBrightness
Audio
Video (media codec)
Camera
Flashlight
ProcessLifeCycle

TODO: Note that, although tags are java constants (e.g.
StatsLog.SCREEN_STATE), the values passed in for states do not have java
constants associated with them, so we use literals (0 vs 1 for off vs
on). In the future, when corresponding java constants exist, these can
be updated.

Test: manually confirmed statslog received each type of events
Change-Id: I24282cdb56265bba61dceb0932112804273dcfc8
2017-10-23 10:26:18 -07:00
TreeHugger Robot
1eb19a3b87 Merge "[Magnifier - 5] Auto invalidate and misc" 2017-10-23 14:09:01 +00:00
Andrei Stingaceanu
ca189fe0fa [Magnifier - 5] Auto invalidate and misc
* due to having to make the API public, drop the
  invalidate_by_client strategy in favor of self invalidation
  by polling
* in Magnifier#show(...) stop sending screen coordinates in favor
  of view coordinates
* UI/UX:
** width from 200dp to 164dp
** fixed the shadow depth (elevation)
** fixed the rounded corners (2dp)

Bug: 63531115
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: I6451767b0a618c0c4ea396ba3ee3144523dadc57
2017-10-23 12:25:15 +01:00
Etan Cohen
de7c2e88ad Merge "Add Runnable mechanism to WakeupMessage" am: 5964b55654 am: d870cd33f5 am: b4e455552f
am: 4655548617

Change-Id: Ifb271f45a06399315f55b8fff7abd0e2a56dab8e
2017-10-21 02:46:29 +00:00
Etan Cohen
4655548617 Merge "Add Runnable mechanism to WakeupMessage" am: 5964b55654 am: d870cd33f5
am: b4e455552f

Change-Id: Iff399d348193b8028e3927c1003d887c211470fb
2017-10-21 02:35:29 +00:00
Sunny Goyal
9372ca079f Merge "Binding to the RemoteViewsService directly from the host" 2017-10-21 02:19:53 +00:00
Etan Cohen
d870cd33f5 Merge "Add Runnable mechanism to WakeupMessage"
am: 5964b55654

Change-Id: Iab0414f644223d69602e8e93a636eaa46137d873
2017-10-21 02:17:30 +00:00
Sunny Goyal
e1273ebbb7 Binding to the RemoteViewsService directly from the host
The host passes an IServiceConnection to the AppWidgetManager which
is used to bind to the RemoteViewsService. This allows the host to
recieve the connection callbacks directly instead of proxying it via
the AppWidgetManager. The host is also responsible for unbinding to
the service.

Bug: 26481160
Test: adb shell \
  am instrument -w -e class android.widget.RemoteViewsAdapterTest \
  com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Iac400095a319c3a43714c82fda7516be1ccc68af
2017-10-20 16:43:23 -07:00
TreeHugger Robot
0d769d80a9 Merge "incidentd: dumping batterystats app data to proto" 2017-10-20 23:22:48 +00:00
Etan Cohen
1861ea9df4 Add Runnable mechanism to WakeupMessage
The WakeupMessage object provides a mechanism to create an Alarm
which will wake-up the device and deliver a message to a Handler.

Add a Runnable mechanism as an alternative to the message.

Bug: 67276378
Test: unit test
Change-Id: Icf5f03b2b25a340273f9d3fcd09f182216ea6238
2017-10-20 13:32:00 -07:00
Tarandeep Singh
ef511a8716 Merge "Revert "SearchView focus should be preserved in split-screen."" 2017-10-20 20:13:55 +00:00
Tarandeep Singh
9c7600cd0c Revert "SearchView focus should be preserved in split-screen."
This reverts commit 96d68d45f0.

Reason for revert: This CL fixed the bug but introduced a new one as described in bug 31298450 comment#10
Bug: 31298450
Bug: 31444175
Test: Manually done as follows
  1. Open system settings.
  2. Tap "System"
  3. Tap "Languages & input"
  4. Tap "Languages"
  6. Tap "Add a language"
  7. Select "English"
  8. Tap the back button on the NavBar
  9. Make sure that the user is navigate back to "Add a language" screen.
Change-Id: I1c98476e962a2d767ec8ed6462c50715a95be9bc
2017-10-20 17:55:53 +00:00
TreeHugger Robot
a18447dd4b Merge "FloatingToolbar updates" 2017-10-20 17:16:59 +00:00
Tarandeep Singh
1d113d041f Skip blocking InputConnection APIs after unbind
InputConnectionWrapper has several synchronous methods which have a
timeout. If the application's UI thread hangs, all these synchronous
methods are blocked and IME stays on-screen.

This CL aims to improve the responsiveness of IMEs by rejecting
any blocking calls of InputConnection APIs once
IInputMethod#unbindInput() is issued by InputMethodManagerService
(IMMS).

Currently #unbindInput() is issued only from
IMMS#unbindCurrentClientLocked(), which basically means that the
previous application is losing the IME focus.

Underlying #onUnbindInput() signal is still immediately delivered
to the IME process, but it's just waiting to be consumed on the UI thread.
Hence in theory we can change the behavior of InputConnection seen
from the IME once the signal is delivered to the IME process.

This CL does not interrupt already blocked API calls, which is one of
future work for this scenario. This CL relies on:

 A. IInputMethod is marked as oneway
 B. IMMS guarantees that IInputMethod#bindInput() and
     IInputMethod#unbindInput() are always paired without nesting,
     and IInputMethod#startInput() is called 0 or more times only
     during that pair.

In this case, the system guarantees that IInputMethod methods
will be called back in the IME process in the same order, and only
one IPC thread is handling those IPCs at the same time. See the
JavaDoc of IBinder#FLAG_ONEWAY for details.

Bug: 36897707
Test: Manual: using the apk in the linked bug:
1. Make sure that a valid InputConnection is established between
   the test app and a test IME.
2. Let the test app start blocking the UI thread.
3. Let the test IME call InputConnection#getTextBeforeCursor()
   three times.
4. Tap the Home button on the NavBar.
5. Make sure that the test app is immediately dismissed.
6. Make sure that InputConnection#getTextBeforeCursor() starts
   returning immediately, once after the initial call was timed-
   out after 2 sec (InputConnectionWrapper#MAX_WAIT_TIME_MILLIS)

Change-Id: I0f816c6ca4c5c0664962432b913f074605fedd27
2017-10-19 17:55:41 -07:00
Tobias Thierer
301bf35e2d resolve merge conflicts of 5c9e47d28b to oc-mr1-dev-plus-aosp
Test: This merge conflict was automatically resolved by meld.
      The automatic resolution of the same merge conflict by meld
      from cherrypicking this CL into internal-master has passed
      Treehugger (and was already submitted).
Exempt-From-Owner-Approval: Resolving merge conflicts with no deltas
Change-Id: I61f15aeb79c1ad26cc7c51be2af59ecb7b672a7b
2017-10-19 15:33:17 +00:00
Tobias Thierer
07efe116b1 Merge "Framework: Prefer android.system.Os over libcore.io.Libcore.os"
am: 5f04db96b3

Change-Id: If85216d03022708787a7218e494434453d5548e3
2017-10-19 14:25:12 +00:00
Joachim Sauer
208f0970d5 Merge "Framework: Prefer android.system.Os over libcore.io.Libcore.os" 2017-10-19 11:48:58 +00:00
Yohei Yukawa
930328ca97 Annotate threads for some IME handling methods
This is a preparation to work on Bug 36897707.

For instance, the reason why most of IME-related callbacks in
InputMethodService get called on the main thread is because
IInputMethodWrapper keeps forwarding incoming IPCs into the
main looper of the IME process as follows:

  InputMethodManagerService (IMMS)
        ------
    -> one-way binder IPCs over	IInputMethod
        ------
      -> IInputMethodWrapper (on the binder thread(s))
       -> Handler (to dispatch tasks to main thread)
        -> InputMethodImpl.* (on the main thread)
         -> InputMethodService.* (on the main thread)

By adding explicit annotations such as @BinderThread and @MainThread
in relevant methods, this CL makes that kind of investigation much
easier than before.

Bug: 36897707
Test: compile
Change-Id: I8f9afe9a1986a9fa41fb66fdc64e8f0f67e45c2e
2017-10-18 20:19:53 -07:00
Kweku Adams
103351f9c2 incidentd: dumping batterystats app data to proto
Bug: 65750808
Test: flash device and checkout proto output against csv output
Change-Id: I2dad948d4b43dc904f01dcaef137a3ff947062c6
2017-10-18 12:32:38 -07:00
Tobias Thierer
6217e37d30 Framework: Prefer android.system.Os over libcore.io.Libcore.os
This is a pure refactoring with no a behavior change other than
that these calls now go through android.system.Os, which immediately
delegates to Libcore.os.

This is a first step towards separating framework (via
android.system.Os) vs. libcore (via Libcore.os) clients of these
low level APIs. Separating these is a prerequisite towards moving
the API parts of android.system into framework, and moving the
rest into a different package in libcore.

Test: Treehugger
Bug: 67901714

Change-Id: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
Merged-In: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
2017-10-18 14:53:57 +01:00
Tobias Thierer
96aac9b375 Framework: Prefer android.system.Os over libcore.io.Libcore.os
This is a pure refactoring with no a behavior change other than
that these calls now go through android.system.Os, which immediately
delegates to Libcore.os.

This is a first step towards separating framework (via
android.system.Os) vs. libcore (via Libcore.os) clients of these
low level APIs. Separating these is a prerequisite towards moving
the API parts of android.system into framework, and moving the
rest into a different package in libcore.

Test: Treehugger
Bug: 67901714

Change-Id: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
2017-10-18 10:35:22 +01:00
Andrei Stingaceanu
15af561efd [Magnifier - 3] Reduce number of calls to PixelCopy
* Magnifier#show() takes snapshots of the content and displays
  them in the Magnifier bitmap
* calling show(...) consecutive times with the same arguments is
  a no-op if already showing (to cater with the miriad of motion
  events produced by touch which end up calling show(...))
* introduced Magnifier#invalidate(...) which, if currently
  showing, forces updating the content using the last configuration
* clamped the start horizontal value of the Rect which delimits the
  content to show in order to avoid distorting the rendering of the
  magnifier content
* fixed invalidating the magnifier (invalidate() does not
  automatically call invalidate(RectF) !)

Bug: 63531115
Bug: 67296158
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: I8e53dfb6582d541922fe05b60311658fb07ca880
2017-10-17 12:33:34 +01:00
Bookatz
20e22f6248 Batterystats handles nested unoptimized ble scans
When a ble scan starts, it tells batterystats whether that scan is
unoptimized. When the scan stops, batterystats is not informed of
whether the stopped scan was unoptimized. Because the ble scan call
could not be nested (couldn't call start twice without stopping first),
this was fine, but now nesting is possible, so batterystats needs to
know whether the stopped ble scan is unoptimized.

Bug: 63456783
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Test: no new errors when run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest#testUnoptimizedBleScans

Change-Id: Ia73f294cf1807ddaf20f1c0bcc28add001cac78c
Merged-In: Ia73f294cf1807ddaf20f1c0bcc28add001cac78c
(cherry picked from commit 94c5a313d7)
2017-10-16 23:18:30 +00:00
Abodunrinwa Toki
9c881f227b FloatingToolbar updates
- Replace SHOW_AS_OVERFLOW_ALWAYS with SHOW_AS_ACTION_NEVER
 - MenuItem ordering
 - Allow textAssist items in overflow to show text with images
 - MenuItem label text now standard case (not allcaps)

Bug: 62447250
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I07fa06f433a34adfad20b371417c95ce76422456
2017-10-16 21:27:54 +01:00
TreeHugger Robot
19777ff1d1 Merge "Fix parcelling of Kernel Wakelock/reason" 2017-10-16 17:54:39 +00:00
TreeHugger Robot
0b57d2f561 Merge "[Magnifier - 4] Batch of tweaks" 2017-10-16 16:10:19 +00:00
Andrei Stingaceanu
451f947ffa [Magnifier - 4] Batch of tweaks
* magnifier zoom from 1.5 to 1.25
* max scale from 10 to 4
* magnifier shows over the text if there is no more space above
  instead of showing underneath the cursor
* paused the blink while showing the magnifier and resumed when
  dismissing

Bug: 63531115
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: Ief3e0b7dc9e287e7dd1a9102548b1861598b69c4
2017-10-16 11:53:52 +01:00
Patrik Torstensson
23a3f240c0 Merge "Incorporate slab reclaimable into meminfo" into oc-mr1-dev am: 20fb01eb23
am: 7528452f57

Change-Id: I46c0b4b07044578fe300aaf587973a650628388b
2017-10-15 02:09:14 +00:00
Calin Juravle
576e6c0cbb [framework] Add check that classpath is up to date to getDexOptNeeded
Bug: 62269291
Test: manual, install new apk/splits and force updates.
I used com.android.cts.classloadersplitapp as the test app.
1) install-multiple split apks with dependency: Base -> A -> B
2) push an update for A
3) adb shell cmd package compile
4) check that A & B got recompiled and that B was because a class loader
context mismatch (e.g. "ClassLoaderContext classpath element checksum
mismatch for position 1.").

Change-Id: I4092562966413dc8976c9d41b26a90bbb9e37e1e
2017-10-13 12:13:39 -07:00
Patrik Torstensson
7528452f57 Merge "Incorporate slab reclaimable into meminfo" into oc-mr1-dev
am: 20fb01eb23

Change-Id: Ia6afee63376c98552c3a5a0ee249fa751c3d3603
2017-10-13 07:35:04 +00:00
Patrik Torstensson
20fb01eb23 Merge "Incorporate slab reclaimable into meminfo" into oc-mr1-dev 2017-10-13 01:30:40 +00:00
Robert Benea
5e099800f8 Incorporate slab reclaimable into meminfo
Instead of using the whole slab mem for kernel usage, split the
unreclaimable to kernel and reclaimable to cache (since is freed
under mem. pressure).

Test: tested on gobo
Bug:67753120
Change-Id: I0f5a310bb88603ad7bb28e5398ea57c249c04fc2
2017-10-13 00:41:47 +00:00
Tun Zheng
670ceded12 Fix group divider make chrome crash issue.
ListMenuItemView's group divider is only existed in
popup_menu_item_layout, but Chrome use list_menu_item_layout.
It will make NullPointerException and crash the chrome.
Fix it by check null before using the group divider.

Bug: 66987086
Test: Long click an image from webpage in chrome, click the "Download
image" item, and it works well.

Change-Id: Ie5f19194a968b4fff0126e1cf8bebda5344c8105
2017-10-12 21:55:54 +00:00
TreeHugger Robot
613bc55785 Merge "Checking for errors opening/parsing ALSA "cards" file." 2017-10-12 21:13:50 +00:00
Paul McLean
fd47f4032d Checking for errors opening/parsing ALSA "cards" file.
Test: Manual
Bug: 67590842

Change-Id: I62a5da97776bc7b7f03d3883cb06607cbdf6f6ce
2017-10-12 10:53:03 -06:00
TreeHugger Robot
7c3c3c8bf8 Merge "Expose API for heavy-weight apps and get it working again." 2017-10-11 18:36:06 +00:00
TreeHugger Robot
b34b70b067 Merge "incidentd: Dumping batterystats system data to proto." 2017-10-11 17:56:34 +00:00
Mike Ma
ee1e5ab213 Merge "Attribute UNKNOWN display state to OFF" 2017-10-11 17:36:03 +00:00
Dianne Hackborn
70c95c5674 Expose API for heavy-weight apps and get it working again.
Still very rough UI, but basically does what is intended.
Also add two tests apps for manual tests (CTS test will
be coming).

Bug: 63937884
Test: manual

Change-Id: I45a6a2b122a75f8125510a2027bb1faf57c6956d
2017-10-10 17:57:22 -07:00
Mike Ma
a7724753d7 Attribute UNKNOWN display state to OFF
When device restarts, screen state is set to unknown, all
timebases stop. Then if setBatteryStateLocked() is called
with unplugged state, onBatteryTimeBase starts, but
onBatteryScreenOffTimeBase does not, so does ScreenOnTimer,
since screen state == unknown. So this duration is lost.
This fix attributes unknown state to ScreenOff.

Fixes: 67608353
Test: added a unit test in BatteryStatsNoteTest
Change-Id: Iee68898522564963e7d0b0110f1aee9248aacfe8
2017-10-10 22:39:53 +00:00
Andreas Gampe
df2a7f9f9d Merge "LoggingPrintStream: Make visible for testing" am: 7d1789867b am: dcb8cf8732 am: 0db4c361e3
am: 245ecc9a95

Change-Id: I933617b2bf177c82b69a4908ddeb65074186b52f
2017-10-10 21:38:41 +00:00
Andreas Gampe
245ecc9a95 Merge "LoggingPrintStream: Make visible for testing" am: 7d1789867b am: dcb8cf8732
am: 0db4c361e3

Change-Id: I10e61d65cd05c8d93d43a2fefee841023ec35889
2017-10-10 21:29:12 +00:00
Andreas Gampe
dcb8cf8732 Merge "LoggingPrintStream: Make visible for testing"
am: 7d1789867b

Change-Id: If6e464f6840b66deb6f6c61b0ca96d847444e910
2017-10-10 21:11:10 +00:00
Bookatz
ba78b2bcc7 Fix parcelling of Kernel Wakelock/reason
In BatteryStatsImpl.java:
Previously, if inclUid == false, then kernelWakelockStats and
wakeupReasonStats were not printed to the parcel, but only a single 0
was written in their place. In the parcel-reading code, their sizes are
read, so if they are not present, there should be a 0 for each of them.
In other words, two 0s should be written if they are not present,
instead of just 1.

Test: none
Change-Id: I1d443e9659646f0d30063f275a6a9db42b0a3906
2017-10-10 11:06:33 -07:00
Andreas Gampe
e2456d602f LoggingPrintStream: Make visible for testing
The class must be public to avoid test issues. If the class is
package-private, the test would have to be in the boot class-
path:

 Rejecting re-init on previously-failed class java.lang.Class<com.android.internal.os.LoggingPrintStreamTest$TestPrintStream>: java.lang.IllegalAccessError: Class com.android.internal.os.LoggingPrintStream extended by class com.android.internal.os.LoggingPrintStreamTest$TestPrintStream is inaccessible (declaration of 'com.android.internal.os.LoggingPrintStreamTest$TestPrintStream' appears in /data/app/com.android.frameworks.coretests-SD7GJmYE507ACoE9gu2mnw==/base.apk)
   at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
   at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:334)
   at junit.framework.Test junit.framework.TestSuite.createTest(java.lang.Class, java.lang.String) (TestSuite.java:61)

Test: m
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/LoggingPrintStreamTest.java
Change-Id: I26cead7954cf4309c8b3e16994c35a3f4a9eb798
2017-10-10 09:09:26 -07:00
Kweku Adams
87b19ecf9b incidentd: Dumping batterystats system data to proto.
Also a little code cleanup as I was going through to understand the
dumping code.

Bug: 65750808
Test: flash device and inspect incident.proto output
Change-Id: Ib850db408c98d6a96dc028296e96c75087258904
2017-10-09 14:29:40 -07:00