1415 Commits

Author SHA1 Message Date
Sebastien Hertz
9a010d0a41 Merge "Allow debugging only for apps forked from zygote" into mnc-dev 2015-08-18 07:41:50 +00:00
Christopher Tate
56f0ff3c48 Make "Ask every time" actually work that way
..in link-opening behavior.  If a candidate is marked as "ask
every time," then the user is guaranteed to get a disambiguation
prompt including that candidate even when some other candidate
app is in the "always prefer this over a browser" state.

Bug 23147746

Change-Id: I904d8697a992b3f16f32b1c1b49c2bf9424c7137
2015-08-13 18:56:05 -07:00
Sebastien Hertz
7a09b8322c Allow debugging only for apps forked from zygote
When starting the runtime from app_process, we only pass JDWP options
if starting zygote. It prevents from opening a JDWP connection in
non-zygote programs while Android apps (forked from zygote) remain
debuggable.

Bug: 23050463
Change-Id: If8ea719063a65db4cdeed69a838b52e87b078b08
2015-08-10 20:39:13 +02:00
Roshan Pius
d3586e174f Add a command to register SIM Phone account.
Phone accounts with SIM_SUBSCRIPTION capabiltiy needs system permission.
Hence adding a command to add sunc phone accounts for CTS testing of
remote connections.

BUG: 20303674
Change-Id: Ieb7349f906ec8209776ffbe39ed3633f01ba1e7c
2015-07-28 15:49:42 -07:00
John Reck
6b66a4a8a3 use findProcess instead of getProcess
Bug: 22701182
Change-Id: I2ec56c55c49401f2f213bbd318e867fd73b37672
2015-07-24 00:37:23 +00:00
Tim Kilbourn
f40c66d1a1 Add a wm command to dismiss the keyguard.
If the user has a screen lock, the user is prompted to authenticate.
Otherwise the keyguard is dismissed.

Bug: 22694837
Change-Id: I783fc6f08fb21977aa4f1e884b0a4354a3154805
2015-07-23 14:51:41 -07:00
Jeff Sharkey
f6e9a3ede5 Merge "More info to support CTS, fix reconcile bug." into mnc-dev 2015-07-22 19:40:44 +00:00
Jeff Sharkey
85ced63268 More info to support CTS, fix reconcile bug.
Surface more details and commands for storage volumes to support
CTS testing.  Fix user reconciliation bug that skipped user setup on
empty volumes.

Bug: 22658804, 22633097
Change-Id: I4221312d1cce24d1f5a2c108095cf3cf471598ed
2015-07-22 11:11:50 -07:00
Kenny Guy
2ba3fec6e0 Merge "Support waiting for adb shell am stop-user to complete." into mnc-dev 2015-07-22 13:49:20 +00:00
Kenny Guy
2c7836befc Support waiting for adb shell am stop-user to complete.
Use stop user callback to wait for AM.stopUser to complete
if -w flag is passed to adb shell am stop-user

bug: 22599411
Change-Id: I8adbfdbb1ba69a88a67431da65f0a85035587c2d
2015-07-21 18:22:28 +01:00
Christopher Tate
387225ff01 Add 'pm' operation to set a package's app-linking state
Set an app's state:

  pm set-app-link [--user USER_ID] PACKAGE {always|ask|never|undefined}

Read an app's current state:

  pm get-app-link [--user USER_ID] PACKAGE

The latter prints to stdout one of the strings usable as an argument to
set-app-link.  If an error is encountered, the string printed to
stderr begins with "Error: ".

Bug 19628527

Change-Id: I68b6dc24445917807345a8cf5baa2078490740af
2015-07-20 17:45:17 -07:00
Dianne Hackborn
280a64e793 Improve tracking of screen on reasons.
- New screen on app op to record the last time each app has
  caused the screen to be turned on.
- New battery stats event that tells us the reason the screen
  has been asked to turn on.
- Propagate out power manager API to specify the reason a caller
  is asking to have the screen turned on.

Note that currently the window flag to turn the screen on bypasses
much of this because it is being handled in the window manager by
just directly telling the power manager to turn the screen on.  To
make this better we need a new API where it can specify who it is
calling the API for.

Change-Id: I667e56cb1f80508d054da004db667efbcc22e971
2015-07-15 09:59:07 -07:00
Fyodor Kupolov
d4fd8c766d Added sendBroadcastMultiplePermissions method
Added Context.sendBroadcastMultiplePermissions(Intent intent, String[]
receiverPermissions) method, which allows an array of required permissions
to be enforced.

Bug: 21852542
Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
2015-07-14 17:25:42 -07:00
Jeff Sharkey
396080dd02 Add grant flag support to "install-create" verb.
This matches the "install" behavior.

Bug: 22331569
Change-Id: I07bfe067bd4be01fc92126750b0ff25a5c5ba5c9
2015-07-09 09:16:07 -07:00
Seigo Nonaka
9d3cd8484e Merge "Add libhidcommand_jni.so to required module." into mnc-dev 2015-07-08 03:25:33 +00:00
Svetoslav
3e7d977ff7 Grant installer and verifier install permissions robustly
bug:22248271

Change-Id: I3a47ae9a112ba7d88b421fcb5f9651d1168ba7a5
2015-07-07 14:02:51 -07:00
Seigo Nonaka
edbeacc562 Add libhidcommand_jni.so to required module.
To install libhidcommand_jni.so and hid command at the same time,
set libhidcommand_jni as a required module of hid command.

Bug: 22131060
Change-Id: I73ad1954eb73896425362a63fab0e63a61b9c0a0
2015-07-02 17:58:29 +09:00
Svet Ganov
99b6043dad Teach receivers, activities, providers, and services app ops.
Perform app op check in addition to the permisison check for all four
paltform components - activities, content providers, broadcast receivers,
services - if they are guarded by a permssion that has an associated app
op. This ensures that legacy apps will behave correctly if the permission
of the caller has been revoked, i.e. the app op for that permission was
disabled.

bug:22199666

Change-Id: Ia22d1c38d58b3cd6aabdc655cb7c7bddd85da7a2
2015-07-01 16:20:00 -07:00
Dianne Hackborn
ca8e6da41c Fix issue #22023824: Download folder is not created in internal storage
The media provider and some other things need to be given storage access.

Also, seems like we should give storage access to the camera app as well.

And add a dump dump command that will dump data about a particular
permission name.

Change-Id: Idaaa9bba2ff4dc95290cf6d17e5df933df91e909
2015-06-26 13:28:29 -07:00
Adam Lesinski
c30454c104 Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()
Bug:22055550
Change-Id: I1e732e95698daf44bcb223cafde3d3c22746d232
2015-06-24 13:35:46 -07:00
Wale Ogunwale
f5ad42f432 Update surfaces secure flag on screen capture setting change
Also, added 'wm screen-capture [userId] [true|false]'
command.

Bug: 20934462
Change-Id: I14711003d7691fc4495428c12c9ff3457cd3773c
2015-06-23 09:08:29 -07:00
Michael Wright
121197326c Merge "Add new hid command." into mnc-dev 2015-06-23 12:45:12 +00:00
Christopher Ferris
bf30b4fd92 Merge "Add libwilhelm to app_process." into mnc-dev 2015-06-19 23:46:55 +00:00
Christopher Ferris
ad81791641 Add libwilhelm to app_process.
If an app exposes new/delete from a shared library, the libwilhelm
shared library can wind up using the new from the app shared library,
and the delete from libc++. It is completely legal for the app to
export new/delete in this way, so in order to avoid this situation,
preload libwilhelm in the zygote. This forces libwilhelm to always
resolve the new/delete from libc++.

This library cannot be added to android_runtime since libwilhelm
has a shared library which depends on android_runtime.

Bug: 21032018
Change-Id: Id89c196df62d98d62855a1421f397b75a7e990a9
2015-06-17 15:30:29 -07:00
Dianne Hackborn
a750a63d63 Fix issue #21814207 and issue #21814212 (alarm manager)
Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks.

Introduce a whole new infrastructure for providing options when
sending broadcasts, much like ActivityOptions.  There is a single
option right now, asking the activity manager to apply a tempory
whitelist to each receiver of the broadcast.

Issue #21814212: Need to allow configuration of alarm manager parameters

The various alarm manager timing configurations are not modifiable
through settings, much like DeviceIdleController.  Also did a few
tweaks in the existing DeviceIdleController impl.

Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
2015-06-17 11:41:45 -07:00
Narayan Kamath
4600dd053d ZipFileRO: Use precise widths for zip file types.
getEntryInfo crashes on 64-bit devices because "long" types
were being passed int pointers (that pointed to a stack frame)
that were reinterpret_cast'ed to long* (sigh.). To fix this issue
once and for all, use types with explicitly defined widths.

This change also removes some dead invariant checking from
Asset.cpp instead of cleaning it up.

Note that we've introduced a wart in NativeLibraryHelper, where
we need to deal with zlib's uLong type, which is "at least 32 bits
wide".

bug: 21622286

Change-Id: Iae675a9601db7aae03a8b80b40321d2cc1d97f50
2015-06-17 08:40:25 +00:00
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
Michael Wright
1f2c7688c1 Add new hid command.
This allows the shell user to inject HID events.

Change-Id: I37faff576299ff14092b61ed39f2a1c086f672a5
2015-06-12 11:49:29 +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