1388 Commits

Author SHA1 Message Date
Narayan Kamath
fbb32f6440 Better systrace slices for application startup.
This change adds three new timeslices :

- PostFork : As soon as possible after the app forks from the
  zygote. Can be used in conjunction with the system_server
  "Start proc:" event to derive an upper bound on fork() and
  zygote overhead.

- RuntimeInit & ActivityThreadMain for ZygoteInit#runtimeInit
  and ActivityThread#main.

ActivityThread#handleBindApplication and higher level functions
are already well instrumented in systrace. handleBindApplication
should occur immediately after ActivityThread#main.

Note that we use the Activity manager tag to make it easier to
correlate these new events with surrounding events (Start proc
and handleBindApplication) that are already using the AM tag.

bug: 21632700
Change-Id: Ibc01f1721f962c913f3c02a51763b6feb1eb6a4d
2015-06-16 12:06:31 +01:00
Yorke Lee
8cd95ee0d0 Add adb shell telecom get-system-dialer
Bug: 20303674
Change-Id: I7ce52e94c434846c262f2d6cc6d41992e259b45f
2015-06-11 15:49:08 -07:00
Felipe Leme
a6dd714a5a Merge "Added new options (--eial, --elal, --efal, and --esal) to pass multiple extras as ArrayList instead of Array. BUG: 21757911 Change-Id: I7e2a9c81ad4606a8aba90ea4820ba0732a1c8749 modified: src/com/android/commands/am/Am.java On branch handles_array_list Changes to be committed: modified: src/com/android/commands/am/Am.java" into mnc-dev 2015-06-10 20:53:24 +00:00
Felipe Leme
f36a0f5d17 Added new options (--eial, --elal, --efal, and --esal) to pass multiple extras as ArrayList instead of Array.
BUG: 21757911
Change-Id: I7e2a9c81ad4606a8aba90ea4820ba0732a1c8749
	modified:   src/com/android/commands/am/Am.java
 On branch handles_array_list
 Changes to be committed:
	modified:   src/com/android/commands/am/Am.java
2015-06-10 13:44:04 -07:00
Dan Stoza
56b94e1593 Merge "screencap: Rotate images when display is rotated" into mnc-dev 2015-06-10 18:19:54 +00:00
Jeff Sharkey
ab2340996a Flags to select storage volume for app installs.
Remote callers can now provide the "--install-location" value from
the APK to help select a location, or they can explicitly force a
volume by UUID.

Bug: 21676789
Change-Id: Iefc92d770a851fc33e37edbf259fdb8df2b14ae5
2015-06-09 21:42:22 -07:00
Dan Stoza
cf70d71781 screencap: Rotate images when display is rotated
Changes screencap to read the display rotation and use it when
capturing the screenshot so that the output image is oriented
correctly.

Bug: 8433742
Change-Id: I0f7db422399985a1ff17da3faa946ff0943e58f7
2015-06-09 16:53:11 -07:00
Stefan Kuhne
5c6c06bf18 Merge "Adding am send-trim-memory command" into mnc-dev 2015-06-05 23:37:15 +00:00
Stefan Kuhne
16045c24fe Adding am send-trim-memory command
This patch adds a send-trim-memory command to the ActivityManager to allow
for better debugging&testing.

The command is
adb shell am send-trim-memory [--user <USER_ID>] <PROCESS> <LEVEL>
whereas LEVEL can be one of the following:
[HIDDEN|RUNNING_MODERATE|BACKGROUND|RUNNING_LOW|MODERATE|
 RUNNING_CRITICAL|COMPLETE]

Bug: 21633189
Change-Id: I7a41ce02c3c9043ffd3e5aaa791f7b7306a9de49
2015-06-05 16:30:29 -07:00
Yorke Lee
adb53b35cc Add phone permissions to Shell
These are needed for adb shell telecom commands to work on
non-eng builds.

Also fix a couple of typos in telecom documentation.

Change-Id: Ia219ff78f5d65878e43e6b9216f979185495ce7f
2015-06-03 15:48:10 -07:00
Yorke Lee
b9381c790e Add adb shell command to register/unregister phone accounts
Bug: 21583012
Change-Id: I3fd525259860fd9e0f9fda5b77cbb9ee7bfab6ca
2015-06-03 09:33:56 -07:00
Yorke Lee
db6da48621 Allow default dialer changes and phone account enable/disable via ADB
Add commands accessible via adb shell that can be used for CTS tests
without the need for adb root
*set-phone-account-enabled
*set-phone-account-disabled
*set-default-dialer
*get-default-dialer

Modify enablePhoneAccount/setDefaultDialer to indicate success.

Remove now unused functionality in ProtectedEnableAccountPreferenceActivity
and ProtectedChangeDefaultDialerActivity.

Bug: 21583012
Change-Id: I542d145cc969334c004b8344fbbb01f278256f9d
2015-06-02 14:23:21 -07:00
Doris Liu
a9ac835437 Merge "Clean up calls to Rect.intersect()" into mnc-dev 2015-05-28 22:51:42 +00:00
Doris Liu
adb8921453 Clean up calls to Rect.intersect()
This CL checks for the return value for Rect.intersect() for whether
there is actually an intersection before taking the return intersected
rect. In the case of no intersection (Rect.intersect() returns false),
an empty rect will be used as the intersection.

bug: 7368679
Change-Id: Ibda3bfd662f8ca83cb5662748d9be250243b72b2
2015-05-28 15:39:05 -07:00
Evgenii Stepanov
5ca3afa296 Update asan/app_process.
Build both 32 and 64-bit versions and don't limit it to eng.

Change-Id: I5d6cc8005291100d5fe0f1385e8a0b4ba5f4d630
(cherry picked from commit e740b17d2400ed0db17d1f7fce4f052bbbf808ab)
2015-05-28 12:47:30 -07:00
Jeff Sharkey
2177ed407b Merge changes from topic 'bench' into mnc-dev
* changes:
  Command to change force adoptable state.
  Initial pass at storage benchmarks.
2015-05-15 21:55:57 +00:00
Jeff Sharkey
4c099d0c49 Command to change force adoptable state.
Since user builds can't setprop, add an explicit "sm" verb to change
the force adoptable state.

Bug: 21191915
Change-Id: I719d9b18c1a98c97442a5ddb1cc5512e8e4d3d3f
2015-05-15 14:15:35 -07:00
Svet Ganov
4ccca50d7e Fix grant/revoke to act on owner by default and log invalid user id.
bug:21163229

Change-Id: I66d0cc130b37b5752ed06afc73259ed41bfb7830
2015-05-14 16:24:19 -07:00
Nick Kralevich
9831fad676 Merge "Modify how USB connections are handled." into mnc-dev 2015-05-13 22:31:57 +00:00
Nick Kralevich
fcf10f7c12 Modify how USB connections are handled.
* Introduce a new "charger only" mode. In this mode, MTP is disabled,
and no file transfers can occur.
* Make charger only mode the default.
* Modify "persist.sys.usb.config" so it now only holds the adb status.
* Make the USB settings non-persistent. Unplugging the USB connection will
reset the device back to "charger only" mode.
* Fixup wording per UI guidelines.

TODO: Re-implement MDM restrictions for USB / MTP access controls.

Bug: 18905620
Change-Id: I99a50d9132a81e98187f431166fd9fef4d437e4f
2015-05-13 14:28:13 -07:00
Jeff Sharkey
c968e21937 Merge "Determine if we have adoptable disks." into mnc-dev 2015-05-13 20:57:03 +00:00
Jeff Sharkey
0d838a0fad Determine if we have adoptable disks.
Bug: 19993667
Change-Id: I9b21b05736c22d34ca22f5ad6e1a6ebec440cfb6
2015-05-13 13:54:35 -07:00
Jeff Sharkey
44b4add4ce Merge "New "sm" shell tool to call StorageManager." into mnc-dev 2015-05-13 05:27:30 +00:00
Jeff Sharkey
7d2af54a98 New "sm" shell tool to call StorageManager.
Surface basic StorageManager commands through shell tool, like
simple listing of disks and volumes, and commands like mounting and
partitioning.

The output is designed to be parsed by host-side testing tools,
instead of relying on fragile dumpsys parsing.

Bug: 19993667
Change-Id: I993e92ecf57996678965945f0ae648b392a77ea2
2015-05-12 15:52:43 -07:00
Svet Ganov
8c7f700a59 Add permission meta-state flags to support grant/revoke permission policy.
We now maintain a mata-state with each permission in the form of flags
specyfying the policy for this permission. This enables support of the
following use cases:

1. The user denies a permission with prejudice in which case an app cannot
   request the permission at runtime. If an app requests such a permssion
   it gets a denial unless the user grants the permission from settings.

2. A legacy app with disabled app-ops being upgraded to support runtime
   permissions. The disabled app ops are converted to permission revocations.
   The app ops manager is a part of the activity manger which sits on top
   of the package manager, hence the latter cannot have a dependency on the
   former. To avoid this the package installer which is the global
   permission managment authority marks the permission as revoked on
   upgrade and the package manager revokes it on upgrade.

3. A device policy fixing a permission in a granted or revoked state. This
   additional information is folded in the meta-state flags and neither
   apps can request such permissions if revoked not the user can change
   the permission state in the UI.

Change-Id: I443e8a7bb94bfcb4ff6003d158e1408c26149811
2015-05-11 17:13:57 -07:00
Amith Yamasani
a5b2684c25 Merge "Rename *AppIdle to *AppInactive per api-council" into mnc-dev 2015-05-11 16:11:14 +00:00
Amith Yamasani
e5f330456b Rename *AppIdle to *AppInactive per api-council
Change to setAppInactive and isAppInactive in a few places.

Bug: 20823737
Change-Id: Ie57dbc0dd2842e771bb5fd9f69b8041aacaa005c
2015-05-08 13:20:22 -07:00
Chris Elliott
80f232deae am b65b66cc: am 2224eac3: Merge "bootanimation: fix garbage line issue when screen height is odd." into lmp-mr1-modular-dev
* commit 'b65b66ccc251371c817abe75176a73f84565410e':
  bootanimation: fix garbage line issue when screen height is odd.
2015-05-07 17:17:03 +00:00
Chris Elliott
b65b66ccc2 am 2224eac3: Merge "bootanimation: fix garbage line issue when screen height is odd." into lmp-mr1-modular-dev
* commit '2224eac30375a731f4ad38d6930dbc37b0855a0d':
  bootanimation: fix garbage line issue when screen height is odd.
2015-05-07 17:06:47 +00:00
Chris Elliott
d13d504e4b bootanimation: fix garbage line issue when screen height is odd.
bug:20032072

Change-Id: I784fb6f815b22c37dcd7354729aca346726196d9
2015-05-05 13:21:27 -07:00
Jeff Sharkey
275e3e43f2 Migrate primary external storage.
Wire up through MountService to call down into vold.  Watch for
unsolicited events that report progress, including special value "82"
that signals that copy has finished.  We use this value to persist
the volumeUuid in case of unexpected reboot, since it indicates the
new volume is ready.

Wire progress updates through existing callback pipeline.

Update the volume mounting code to match against the persisted UUID
when selecting the primary external storage.

Bug: 19993667
Change-Id: Id46957610fb43517bbfbc368f29b7d430664590d
2015-04-24 18:01:45 -07:00
Amith Yamasani
4bc704655a Merge "Add ability to get and set idle state of apps" 2015-04-24 20:03:02 +00:00
Amith Yamasani
cf76872a62 Add ability to get and set idle state of apps
Add am shell command to set and get idle
Add public API to check if an app is idle

Bug: 20534955
Bug: 20493806
Change-Id: Ib48b3fe847c71f05ef3905563f6e903cf060c498
2015-04-24 12:58:46 -07:00
Jeff Sharkey
620b32b316 Package and storage movement callbacks.
Since package and primary storage movement can take quite awhile,
we want to have SystemUI surface progress and allow the Settings
app to be torn down while the movement proceeds in the background.

Movement requests now return a unique ID that identifies an ongoing
operation, and interested parties can observe ongoing progress and
final status.  Internally, progress and status are overloaded so
the values 0-100 are progress, and any values outside that range
are terminal status.

Add explicit constants for special-cased volume UUIDs, and change
the APIs to accept VolumeInfo to reduce confusion.  Internally the
UUID value "null" means internal storage, and "primary_physical"
means the current primary physical volume.  These values are used
for both package and primary storage movement destinations.

Persist the current primary storage location in MountService
metadata, since it can be moved over time.

Surface disk scanned events with separate volume count so we can
determine when it's partitioned successfully.  Also send broadcast
to support TvSettings launching into adoption flow.

Bug: 19993667
Change-Id: Ic8a4034033c3cb3262023dba4a642efc6795af10
2015-04-23 20:32:17 -07:00
Jeff Sharkey
529f91fc8e Always send volume UUID with installd commands.
Since packages can be moved to other volumes, all relevant commands
to installd now require an explicit volume UUID parameter.

Bug: 20275577
Change-Id: Ie84f5bc43c7aada5800b8d71692c7928b42b965e
2015-04-18 21:11:58 -07:00
Dan Albert
1dfab471ed am a26c8371: am 5682a23e: am fef8bcf9: Merge "Explicitly use clang."
* commit 'a26c83718004c7640827d86b0f6a0fdf33017751':
  Explicitly use clang.
2015-04-17 18:50:41 +00:00
Dan Albert
b9f6b0eec3 Explicitly use clang.
This was implicitly enabled by using ASAN.

Change-Id: I562402a8191e2a3ab3eefd43860fbe7c58d441d8
2015-04-17 10:40:48 -07:00
Wale Ogunwale
0bd2aa7603 Fail early when starting a background user activity.
If it shouldn't be displayed for all users.

Bug: 13507605
Change-Id: I8fe8e5a98759c1ca058cc7d222817f6d580ffa11
2015-04-17 08:37:56 -07:00
Jeff Brown
d46747a1c6 Add support for disabling display scaling for development.
Added two new options to the wm command.

1. Set the screen size based on dips rather than pixels using the
current screen density.

eg. adb shell wm size 320dpx320dp

2. Disable automatic scaling of the contents of the display.
When combined with the previous command, this is useful for seeing
how the UI would behave if the screen remained at its current density
but changed physical size.

eg. adb shell wm scaling off

Bug: 19899223
Change-Id: I545f893ba4861494e995cf0457ebeba1050d28dc
2015-04-15 19:02:36 -07:00
Dianne Hackborn
1e38382b54 Fixes to idle alarm scheduling, package importance.
- Add new API to ask the activity manager what the current
  importance of a particular package name is (along with a few
  new useful importance levels).

- Fix my last alarm manager change to actually execute the
  alarms we have now decided should run even while we are idle.

Change-Id: I1f14712b4e390770d53b185c96a1b36f6aadd687
2015-04-14 10:01:24 -07:00
Benjamin Franz
39fb7fd730 Allow silent package install for device owner.
Allow the device owner to silently install and remove packages using the
PackageInstaller APIs. Show notifications to the user after the
installation / deletion was successful.

Bug: 19422461
Change-Id: I0506e18c510efd9d04c4aea9b60a37456e689615
2015-04-07 11:02:46 +01:00
Jeff Sharkey
b2b9ab8354 Installing packages to expanded storage.
PackageManager now offers to load/unload packages when expanded
volumes are mounted/unmounted.  Expanded storage volumes are still
treated as FLAG_EXTERNAL_STORAGE from a public API point-of-view,
but this change starts treating the INSTALL_EXTERNAL flag as
exclusively meaning ASEC containers.

Start tracking the UUID of the volume where a package is installed,
giving us a quick way to find relevant packages.  When resolving an
install location, look across all expanded volumes and pick the one
with the largest free space.  When upgrading an existing package,
continue preferring the existing volume.  PackageInstaller now knows
how to stage on these volumes.

Add new movePackage() variant that accepts a target volume UUID
as destination, it will eventually move data too.  Expose this
move command through "pm" command for testing.

Automount expanded volumes when they appear.

Bug: 19993667
Change-Id: I9ca2aa328b9977d34e8b3e153db4bea8b8d6f8e3
2015-04-06 21:17:58 -07:00
Amith Yamasani
b677e0a496 Merge "Update command line usage for pm" 2015-04-06 20:24:13 +00:00
Amith Yamasani
3605fac80b Update command line usage for pm
Include the --user flag.

Change-Id: Id2a2bc73f4b7392e308c5946eeb42b21426a1bfd
2015-04-06 13:20:45 -07:00
Dianne Hackborn
d59a5d59df Various fixes and improvements...
Issue #19912529: VI: VoiceInteractor callback ClassCastException

Fix to use correct argument.

Issue #19912636: VI: Documentation for VoiceInteractionSession.onBackPressed

Added documentation.

Issue #19912703: VI: VoiceInteractionSession NPE on Abort Request

Maybe fix this -- don't crash if there is no active session.

Issue #19953731: VI: Add value index to...
...android.app.VoiceInteractor.PickOptionRequest.Option

There is now an optional index integer that can be associated with
every Option object.

Issue #19912635: VI: Behavior of startActivity when in voice...
...interaction is unexpected

We now forcibly finish the current voice interaction task whenever
another activity takes focus from it.

Issue #20066569: Add API to request heap dumps

New ActivityManager API to set the pss limit to generate heap
dumps.

Also added app ops for assist receiving structure and screenshot
data, so that we can track when it does these things.

Change-Id: I688d4ff8f0bd0b8b9e3390a32375b4bb7875c1a1
2015-04-04 17:36:05 -07:00
Mark Salyzyn
222ab66205 am 1c329e85: am 855998d0: am c90a4418: Merge "idmap: scan missing include for sys/stat.h"
* commit '1c329e856a1a7cdef6e55ee0269837a234631f75':
  idmap: scan missing include for sys/stat.h
2015-04-01 17:33:31 +00:00
Mark Salyzyn
6b115be0a2 am fa037c65: am f942e36a: am 5218065d: Merge "app_main missing include for sys/stat.h"
* commit 'fa037c65d37b911024d597415beea3a9368a6fb5':
  app_main missing include for sys/stat.h
2015-04-01 17:27:21 +00:00
Mark Salyzyn
b62286e60c idmap: scan missing include for sys/stat.h
scan.cpp gets sys/stat.h inherited from
private/android_filesystem_config.h it should
not rely on this in the future. The intent is
to move fs_config function into libcutils and
thus deprecate any need for sys/stat.h in this
include file.

Bug: 19908228
Change-Id: If547e86513b06c536972138ae571c3d9c714ffe9
2015-04-01 16:52:14 +00:00
Mark Salyzyn
fc737fb76c app_main missing include for sys/stat.h
app_main.c gets sys/stat.h inherited from
private/android_filesystem_config.h it should
not rely on this in the future. The intent is
to move fs_config function into libcutils and
thus deprecate any need for sys/stat.h in this
include file.

Bug: 19908228
Change-Id: I477b825e582742113f849aaa1df50c41e496b6f6
2015-04-01 16:02:32 +00:00
John Reck
34faab5a54 Add --sampling to am profile start
Change-Id: I00dfdef6a7ac61ab4ce16fefe1ddc5554ace0c88
2015-03-26 11:05:08 -07:00