Commit Graph

3062 Commits

Author SHA1 Message Date
Dianne Hackborn
ef1971ffc5 Merge "Add APIs to find out the time when a process was created." into nyc-dev 2016-03-03 19:47:56 +00:00
Dianne Hackborn
d98885c128 Add APIs to find out the time when a process was created.
Change-Id: Id0d12c377f278fec6e31a98eab0c865a23c006ec
2016-03-02 17:40:52 -08:00
Vadim Tryshev
c9f0a1103e Merge "Adding getManagedUserBadgedDrawableForDensity() to PackageManager." into nyc-dev 2016-03-03 00:28:17 +00:00
Vadim Tryshev
66ae66a7f7 Adding getManagedUserBadgedDrawableForDensity() to PackageManager.
It allows badging an image regardless of of the user (no
user id parameter). The styling for managed users is applied.

This is useful for new cases where the existing functions
wouldn't badge the icon, but we need it.

Bug: 25192539
Change-Id: I2fd2f226f626fb2e6cda1cfe072013350e12b41c
2016-03-02 14:55:04 -08:00
Eino-Ville Talvala
74989b4d3f Merge "Camera2: Switch to auto-gen C++ binder interfaces" into nyc-dev 2016-03-02 21:47:13 +00:00
Steve McKay
b4672ef6df Merge "Always show intern storage." into nyc-dev 2016-03-02 18:49:28 +00:00
Steve McKay
7c4395804e Always show intern storage.
Only show debug root when devel mode is enabled.
Remove all traces of "advanced".

Bug: 27297398

Change-Id: Ie7e8be282531bd245351d56ababa8ca625c10fd2
2016-03-02 10:47:59 -08:00
Jeff Sharkey
c53962d4ed When system server goes down, crash apps more.
Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: Ife0bcb079636c88d54c44d17eb580409fd79028b
2016-03-01 19:29:16 -07:00
Eino-Ville Talvala
5d2d7788f1 Camera2: Switch to auto-gen C++ binder interfaces
- Move camera AIDL files to frameworks/av
 - Update makefiles to point to new AIDL locations
 - Adjust camera2 implementation to match modifications to AIDL needed
   for native AIDL auto-generation
 - Move Surface.aidl to frameworks/native to allow use in
   native AIDL. Use android::view::Surface in Surface JNI to
   serialize Surface objects to ensure parceling compatibility.
 - Adjust service binder tests to new interface

Bug: 25091611
Change-Id: I85b817374b34a4540fa145328dbe4bbf7f746baf
2016-03-01 17:15:17 -08:00
Fyodor Kupolov
285bec2641 Merge "Disable switching users if the user is in a call" into nyc-dev 2016-03-01 23:21:29 +00:00
Felipe Leme
c50bf8e33e Merge "Created metric events for scoped directory access API." into nyc-dev 2016-03-01 18:58:28 +00:00
Felipe Leme
3e166b27fc Created metric events for scoped directory access API.
BUG: 27334821
Change-Id: I8a1bfc328dcd26b42bb66884d14b34ad11aa232f
2016-03-01 10:12:58 -08:00
Calin Juravle
e1ac71fe99 Merge "Restrict the cases when we profile guided compile an apk" into nyc-dev 2016-03-01 17:59:20 +00:00
Jeff Sharkey
753c347efd Merge "Parcelable classes should always be final." into nyc-dev 2016-03-01 00:02:43 +00:00
Jeff Sharkey
50d1c044b5 Parcelable classes should always be final.
Also hide ConnectivityMetricsEvent which isn't being used yet.

Bug: 27415331
Change-Id: Iacdccddda504f3f669185f807b4f35b8dc2b0212
2016-02-29 16:46:09 -07:00
Colin Cross
414c529a4f Merge "Add dumpsys meminfo --unreachable" into nyc-dev 2016-02-29 22:19:40 +00:00
Fyodor Kupolov
523c404612 Disable switching users if the user is in a call
Also disable "Remove guest" option, which switches the user.

Bug: 20652663
Change-Id: Id3ada14c0b3bfe70e9e1ab7034d27098924d7b45
2016-02-29 10:40:55 -08:00
Polina Bondarenko
0097077396 Merge "Removed IAE from HardwarePropertiesManager." into nyc-dev 2016-02-29 18:34:01 +00:00
Jeff Sharkey
f8880561e6 When system server goes down, crash apps more.
Similar to first patch, but now using new "rethrowFromSystemServer()"
method which internally translates DeadObjectException into
DeadSystemException.  New logic over in Log.printlns() now
suppresses the DeadSystemException stack traces, since they're
misleading and just added pressure to the precious log buffer space.

Add some extra RuntimeInit checks to suppress logging-about-logging
when the system server is dead.

Bug: 27364859
Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123
2016-02-27 17:17:01 -07:00
Jeff Sharkey
49607029be Merge "When system server goes down, crash apps." into nyc-dev 2016-02-26 18:14:52 +00:00
Andreas Gampe
227d7854cc Merge "Frameworks/base: Refactor android.os.Debug" into nyc-dev 2016-02-26 17:39:20 +00:00
Polina Bondarenko
725844d05f Removed IAE from HardwarePropertiesManager.
If unknown temperature type is passed to getDeviceTemperatures, returns
empty array.

Bug: 27365463
Change-Id: I223b5e4e0642aee7b32e44fea84e8dc465b7e90b
2016-02-26 14:17:00 +01:00
Andreas Gampe
8b9f49415f Frameworks/base: Refactor android.os.Debug
Refactor some static fields into a holder. This allows to statically
initialize the class in the boot image. It also has some minimal
positive impact on the class size, a net benefit when tracing is
not used.

Bug: 27248115
Change-Id: I0cdfb6acf916ad8d9a7d82bba32929dba15d4200
2016-02-25 18:03:03 -08:00
Jeff Sharkey
27b2e69787 When system server goes down, crash apps.
Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: If632cc36f68cd399a34de513b2d979abaa36fcaa
2016-02-25 17:40:12 -07:00
Ruchi Kandoi
302710deaa PowerManager: Hide the SUSTAINED_PERFORMANCE API.
Bug: 27365880
Change-Id: Ia84a5af85f6e8ef0740ce4b41dbc5bab4cbeef05
2016-02-25 16:22:54 -08:00
Calin Juravle
d479b52d12 Restrict the cases when we profile guided compile an apk
Do not use profile guided compilation if the apk is loaded by another
app. The decision if an apk was used or not by another app is done
by looking into the foreign profile directory. Apks which where
loaded in others apps will have a file marker in the profile directory.
The marker is  named after the canonical location of the apk file where
'/' is replaced by '@'.

Also, refactor the profile paths to the Environment.

Bug: 27334750
Bug: 26080105
Change-Id: Ic2ac5a7a231670ecb4462166c34fdd5b4c631178
2016-02-25 11:53:54 +00:00
Lenka Trochtova
1ddda4793c Prevent ephemeral user from being re-entered after stop.
Once the ephemeral user stops, the user's deletion is scheduled.
It takes a while before the user actually disappears and it is not
desirable for the user to be re-entered in the meantime.
Mark the user as disabled on stop and check this flag
in the activity manager to prevent the user from being switched
to again. Also hide the user from user-switching UI.

BUG: 26795729
BUG: 26780152

Change-Id: I83a61674958954b5a210114b88ffa5ae55922c1f
2016-02-24 11:55:58 +01:00
Joe Onorato
abded113bd Add unit tests for BatteryStatsImpl.
- Add a Clocks interface to wrap SystemClock.uptimeMillis and
  SystemClock.elapsedRealtime.
- Make the inner classes static so they can be created independently,
  which meant passing explicit pointers to the BatteryStatsImpl and
  the Uid objects in a lot of places.
- Make several fields protected so they can be accessed by the tests (they are
  still @hidden)
- Add a test suite for the battery stats.
- Add the tests

Change-Id: I4e45afedc64f7050985c28a7eb4f5c1ddbaa63fa
2016-02-23 12:44:22 -08:00
Tony Mak
38e638696a Merge "Update javadoc of DISALLOW_OUTGOING_CALLS" into nyc-dev 2016-02-23 10:24:50 +00:00
Tao Bao
9de7952aa9 Merge "Add support for update-on-boot feature." into nyc-dev 2016-02-22 19:24:25 +00:00
Tony Mak
eb83ab52b2 Update javadoc of DISALLOW_OUTGOING_CALLS
It is no longer true that we always forward the intent to personal side
after the introcution of work dialer.

Change-Id: I07b247c15d366278a07afab76b23c9d8847b01ef
2016-02-22 18:36:08 +00:00
Polina Bondarenko
280c5b2155 Merge "Added hardwareproperties SystemService" into nyc-dev 2016-02-22 09:27:21 +00:00
Adam Lesinski
2208e743e4 Remove extraneous field from batterystats dumpsys
Change-Id: Iea913e993e61d114c499e6218ad0abf9a8e80690
2016-02-19 21:03:43 +00:00
Tao Bao
e8a403d57c Add support for update-on-boot feature.
Add a separate system service RecoverySystemService to handle recovery
related requests (calling uncrypt to de-encrypt the OTA package on the
/data partition, setting up bootloader control block (aka BCB) and etc).

We used to trigger uncrypt in ShutdownThread before rebooting into
recovery. Now we expose new SystemApi (RecoverySystem.processPackage())
to allow the caller (e.g. GmsCore) to call that upfront before
initiating a reboot. This will reduce the reboot time and get rid of the
progress bar ("processing update package"). However, we need to reserve
the functionality in ShutdownThread to optionally call uncrypt if
finding that's still needed.

In order to support the update-on-boot feature, we also add new
SystemApis scheduleUpdateOnBoot() and cancelScheduledUpdate() into
android.os.RecoverySystem. They allow the caller (e.g. GmsCore) to
schedule / cancel an update by setting up the BCB, which will be read by
the bootloader and the recovery image. With the new SystemApis, an
update package can be processed (uncrypt'd) in the background and
scheduled to be installed at the next boot.

Bug: 26830925
Change-Id: Ic606fcf5b31c54ce54f0ab12c1768fef0fa64560
2016-02-19 11:31:45 -08:00
Polina Bondarenko
f8754ac212 Added hardwareproperties SystemService
Add HardwarePropertiesManagerService which call native methods to
get CPU, GPU, battery temperatures, CPU usage info, fan speeds.
Restrict hardware properties retrieval only for device and profile
owners.

Bug: 26945055
Change-Id: I4d6b30b78e575532d5e9cfa59ef6cd81355439d4
2016-02-19 18:24:29 +01:00
Colin Cross
c4fb5f9d4b Add dumpsys meminfo --unreachable
dumpsys meminfo --unreachable will search the native heap for
allocations that are unreachable.

Bug: 27208635
Change-Id: I40ab1c261cb222ca71d04ab8408f355bcb18ed94
(cherry picked from commit 84b1e3554b)
2016-02-18 22:30:49 -08:00
Jeff Sharkey
2271ba3627 Push mapping of package name to appId to kernel.
The new sdcardfs kernel driver needs to know this mapping for
deriving UID permissions, so push the data through /config when
supported by the kernel.  This also has the nice benefit of letting
us push only the deltas of what actually changes, instead of
re-parsing the entire "packages.list" file.

The mappings for newly installed apps are pushed before the app is
allowed to run, removing some latent race conditions.  Also cleans
up stale mappings when packages are uninstalled, and whenever the
system server reboots.

Bug: 19160983
Change-Id: Iace92efb69616c96b34c0d9d911e4b54e5fd8a67
2016-02-18 15:01:15 -07:00
Felipe Leme
79c11a8c55 Merge "Fixed typo on Storage Access Framework." into nyc-dev 2016-02-17 22:51:02 +00:00
Felipe Leme
53fcc756d0 Fixed typo on Storage Access Framework.
BUG: 26742218
Change-Id: I9b695ebe2176f186fc63b20f624e40dd9e257bc3
2016-02-17 14:45:52 -08:00
Felipe Leme
014a0d11c7 Merge "Removed Intent.OPEN_EXTERNAL_DIRECTORY." into nyc-dev 2016-02-17 22:43:20 +00:00
Felipe Leme
3c3770d8fe Merge "Initial implementation of StorageManager.getVolumesList()." into nyc-dev 2016-02-17 22:42:40 +00:00
Felipe Leme
34a9d52719 Removed Intent.OPEN_EXTERNAL_DIRECTORY.
Such intent is now encapsulated by StorageVolume.createAccessIntent().

BUG: 26742218

Change-Id: I2e2bd71126ecd74981f77b0af7d069f51aaece74
2016-02-17 14:38:25 -08:00
Felipe Leme
04a5d40cf3 Initial implementation of StorageManager.getVolumesList().
This change makes StorageManager.getVolumesList(),
StorageManager.getPrimaryVolume(),  and StorageVolume public and adds a
buildAccessIntent() in the latter to automatically generate the
ACTION_OPEN_EXTERNAL_DIRECTORY intent, but it doesn't change the
ACTION_OPEN_EXTERNAL_DIRECTORY implementation yet (i.e., it still takes an URI with the physical path of the directory, instead of a StorageVolume and
a directorny name).

BUG: 26742218

Change-Id: I36c59c42b6579e125ec7f03c3af141260875a491
2016-02-17 13:14:39 -08:00
Steve McKay
ab3b8936dc Remove "HOME" directory. Use "Documents" instead.
Use "Folder" as home icon for now.

Bug:27148009
Change-Id: I9f57bba1c8e51ae7887861923f5baa8f69ec2e6e
2016-02-16 14:52:35 -08:00
Philipp Weiß
09f8568059 Merge "DPM.createAndManageUser should work even with DISALLOW_ADD_USER set" into nyc-dev 2016-02-11 17:17:39 +00:00
phweiss
e9c440638e DPM.createAndManageUser should work even with DISALLOW_ADD_USER set
For this, the DPM calls a new function
UserManagerInternal.createUserEvenWhenDisallowed() instead of
UserManager.createUser(). This calls
UserManagerService.createUserInternalUnchecked().

Also, only the system user is allowed to call this method, otherwise
a security exception is thrown.

Bug: 26952210
Bug: 26786199
Change-Id: I69c16354898d68592d13f5f53b840551f7ad4779
2016-02-11 14:43:18 +01:00
Jeff Davidson
7f036f8bce Merge "Expose APIs to analyze UIDs in UserHandle/Process." into nyc-dev 2016-02-11 00:52:02 +00:00
Jeff Davidson
48aa86bd0b Expose APIs to analyze UIDs in UserHandle/Process.
Clients of the NetworkStatsManager public APIs may get UIDs belonging
to other users, and UIDs which don't actually represent applications.
These APIs allow clients to understand whether a given ID belongs to
the same user as themselves, and whether an ID represents an
application or something else (e.g. a system UID).

Change-Id: Ia56d5891521ce98e5594c41da8f9d756819deb66
2016-02-10 15:20:33 -08:00
Jeff Sharkey
8212ae0aee Consistent naming for internal storage APIs.
Also completely remove a few confusingly named deprecated APIs.

Change-Id: Ia7e4ea3190a97f0a7dfa9bebf2118da0866ec38f
2016-02-10 15:03:33 -07:00
Tao Bao
6af1d75a0c Merge "Add system APIs for A/B update." into nyc-dev 2016-02-08 22:07:05 +00:00