Commit Graph

8896 Commits

Author SHA1 Message Date
Mike Ma
d2239828d6 Record proto to file in am instrument
Add an option -f to record instrumentdata proto produced by am instrument
to a file in addition to printing to stdout. Default path is
/sdcard/instrument-logs/log-yyyyMMdd-hhmmss-SSS.instrumentation_data_proto.
If the file exits, it will be deleted before writing. Path can be changed
via optional <FILE> argument after -f.
If -f and -m are both present, proto will be written to a file and print
to stdout.

Test: build, flash and run:
bit -bi FrameworksCoreTests
adb shell am instrument -w -r -f tmp/tmp.log \
-e class com.android.internal.os.BatteryStatsNoteTest \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Iabc320c066d5995eee842c26416623eeb3d403f4
2017-11-01 14:20:31 -07:00
Dianne Hackborn
ad5570f58d Merge "Fully implement "install" and "install-write" in PackageManagerShellCommand." 2017-10-31 19:55:42 +00:00
TreeHugger Robot
f30e0cfca0 Merge "Simple numbering system selector for LocalePicker." 2017-10-31 19:21:53 +00:00
Dianne Hackborn
ca3872ce36 Fully implement "install" and "install-write" in PackageManagerShellCommand.
We can use the new mechanism to ask the calling shell to open
a file in order to implement the rest of these commands, allowing
you to give the path to an apk to install.  That API is thus
extended to allow you to open readable files, not just opening
file for writing.

Doing this however means we no longer can pass a file path to
AssetManager for the apk to parse, we only have an already open
fd for that.  Extending AssetManager to allow adding apks from
fds is not that hard, however, since the underlying zip library
already supports this.

This main thing this changes is in AssetManager.cpp where we
retrieve the open zip file for a particular apk that has been
added.  This used to look up the zip file by path every time
it was needed, but that won't work anymore now that we can have
things added by fd.  Instead, we keep track of each opened zip
in the AssetManager, so we can just directly retrieve it from
the asset_path representing the item that was added.  As a
side-effect, this means for normal paths we no longer need to
look up by name, but just have the opened zip file directly
accessible.  (This is probably good, but it does mean that we
no longer run the logic of seeing if the zip file's timestamp
has changed and re-opening it if it has.  We probably shouldn't
be relying on that for an active AssetManager anyway, and maybe
it is even good that we don't allow the zip file to change
under it?)

A follow-up change will finally remove the Pm.java implementation
and turn the pm "command" into a simple shell script that runs
cmd package.

Test: manual

Change-Id: Ie103e3bdaa5b706796cc329254f2638151a3924f
2017-10-31 10:54:31 -07:00
Tobias Thierer
e74399de6f Merge "OWNERS: Prefer Jeff Sharkey's @android.com account over @google.com" am: b519569eb3 am: 4f59edb63f
am: 60923f7860

Change-Id: I52d63eac03e32f6d020809cae2cecb7cad0154c0
2017-10-31 14:01:37 +00:00
Tobias Thierer
60923f7860 Merge "OWNERS: Prefer Jeff Sharkey's @android.com account over @google.com" am: b519569eb3
am: 4f59edb63f

Change-Id: If74e0f6783bb38c707a3575821255e8f1ec4d78f
2017-10-31 13:51:26 +00:00
Christine Franks
771cf3cc44 Merge "Respect legacy color mode settings" 2017-10-31 03:16:05 +00:00
Christine Franks
17947177b3 Respect legacy color mode settings
Bug: 68411440
Test: make -j100, verified starting with each of the three options.
Change-Id: I73e701a86733e0f8a5d017949052b16cdf58f398
2017-10-30 17:26:17 -07:00
TreeHugger Robot
15c45c854e Merge "Fix StateMachine init/quit race." 2017-10-30 22:57:47 +00:00
Igor Viarheichyk
025402c5e9 Simple numbering system selector for LocalePicker.
This change introduces minimal changes needed to support selection
of locales with BCP 47 numbering system specification. Two level
selection (Language/Region) schema remains, locales with numbering
systems appear in the region selection list and are displayed as
"region (numbering system)".

Bug: 18340949
Bug: 63754513
Test: manual, experimental UI for review.

Change-Id: I42691f3714c5e5c51fd8d96c034cc3a9f6be93dc
2017-10-30 14:35:06 -07:00
Tobias Thierer
66d1933ce0 OWNERS: Prefer Jeff Sharkey's @android.com account over @google.com
He prefers to use his @android.com account.

Test: Treehugger
Bug: 63673347
Exempt-From-Owner-Approval: Allow @android.com to approve this CL :)

Change-Id: Ie80cc7864de7b91ae44ad57f0bae9b859d034803
2017-10-30 17:53:11 +00:00
Winson Chung
941dcba6e3 Merge "1/ Refactor out logic to fetch assist data asynchronously" 2017-10-30 16:22:26 +00:00
Péter Visontay
23567494d0 Merge "Fix some paths (in comments) pointing to old locations of C++ Binder interfaces." 2017-10-30 11:27:32 +00:00
Winson Chung
da2818fe89 1/ Refactor out logic to fetch assist data asynchronously
- This logic will also be used when the recents component is started to
  fetch assist data associated with the current activity.

Bug: 67864419
Test: com.android.server.am.AssistDataRequesterTest
Test: CtsVoiceInteractionTestCases

Change-Id: I4cb3c2536a104d7071bc0a1fd6e31dfc2c0ce8d0
2017-10-27 13:49:26 -07:00
Peter Visontay
cee763269a Fix some paths (in comments) pointing to old locations of C++ Binder interfaces.
Test: None (comment changes).

Change-Id: I372e38bbb73c9d0a289089b239fa669f130252ba
2017-10-27 18:15:33 +01:00
Christine Franks
8ad7149d1b Support native and srgb for night display
Bug: 68159303
Test: make -j100

Change-Id: Iea4b38bd8c9037f50b7ffa6e3c4f12b0e536a8ce
2017-10-26 15:36:19 -07:00
Calvin On
dce6e5dfd4 Fix StateMachine init/quit race.
The quitNow method places the SM_QUIT_CMD at the front
of the queue. This can cause StateMachine to throw exception
if it has not yet processed the SM_INIT_CMD from start().

Bug: 67370902
Test: make checkbuild
Test: StateMachineTest unittest
Test: build/install on device, toggle bluetooth and wifi
Change-Id: I7cec7bb91e0447e3c565d33cb7c34ccf59566639
2017-10-26 14:07:31 -07:00
Christine Franks
10e9bc5ba7 Merge "DO NOT MERGE - Support native and srgb for night display" into oc-mr1-dev
am: 2d110e6829

Change-Id: I0e805b480a3317548c219eb282fcf399b41b4ff1
2017-10-25 20:28:07 +00:00
Christine Franks
8c9f91eba6 DO NOT MERGE - Support native and srgb for night display
Bug: 68159303
Test: make -j100

Change-Id: Iea4b38bd8c9037f50b7ffa6e3c4f12b0e536a8ce
2017-10-25 12:43:10 -07:00
TreeHugger Robot
d62ff511dc Merge "incidentd: Adding proto dump for AlarmManager." 2017-10-25 18:43:39 +00:00
Michael Wachenschwanz
4b3a7f2987 Merge "Java side setup and access to Binder Proxy Tracking" 2017-10-25 18:20:56 +00:00
TreeHugger Robot
40e1dd673e Merge changes Ifee27c86,I9ffa4b00
* changes:
  Add more atoms to statsd
  Add wakelock atom to statsd
2017-10-25 17:05:44 +00:00
TreeHugger Robot
17e5e2e573 Merge "Add some atoms to statsd" 2017-10-25 17:04:54 +00:00
Andrei Stingaceanu
f3ee5e6e4a [Magnifier - 7] Minor cleanup
Remove uselsess annotations on primitives.

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: I1e15e18d57af23d25a347d644ea57372e32adb59
2017-10-25 10:56:16 +01:00
Bookatz
e588524f89 Add more atoms to statsd
The following events are added to statsd:
WifiLockStateChanged
WifiSignalStrengthChanged
WifiSignalStrengthChanged
PhoneSignalStrengthChanged

Test: manually confirmed these show up in the statslog.
Change-Id: Ifee27c86a28616d8cb9d43bdf11f9cabe2b367c6
2017-10-24 20:10:31 -07:00
Bookatz
d674624aff Add wakelock atom to statsd
The wakelock event is logged in statsd.

Test: manually confirmed that the event appears in statslog.
Change-Id: I9ffa4b0042264aabf3526843b4fb1832d183de61
2017-10-24 18:39:35 -07:00
Michael Wachenschwanz
55182464fb Java side setup and access to Binder Proxy Tracking
Expose Binder Proxy Tracking by Uid from the native side. Enable
 tracking for SYSTEM and killing of any bad behaving uids.

Change-Id: Ifd6d0f30a93fad406417dd83c1495c105bced974
Fixes: 63901963
Test: bit FrameworksCoreTests:android.os.BinderProxyCountingTest
2017-10-24 18:30:57 -07:00
Bookatz
8c6571bde8 Add some atoms to statsd
The following atoms (events) are added:
BatteryLevelChanged
ChargingStateChanged
PluggedStateChanged
DeviceTemperatureReported
DeviceOnStatusChanged
WakeupAlarmOccurred
KernelWakeupReported

Test: manual
Change-Id: I1e7d8a842ee67b5da30f20c9e6976c5bc4e0a0ef
2017-10-24 18:18:19 -07:00
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
Kweku Adams
61e0329207 incidentd: Adding proto dump for AlarmManager.
Test: flash device and check incident.proto output.
Bug: 65750801
Change-Id: If1e42c70908a0b11358cf48766c028e37c0329ae
2017-10-23 17:49:13 -07: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