Commit Graph

5523 Commits

Author SHA1 Message Date
Jeff Sharkey
ddff807b76 Consistent "low storage" behavior.
When answering the question "how much space is free", use the same
logic for Settings UI and StorageManager.getAllocatableBytes().  That
is, the reported free space is usable bytes plus any cached data the
system is willing to delete automatically.

This does *not* include any reserved cache space, since we don't want
abusive apps to penalize other well-behaved apps that are storing
their data in cache locations.  Callers freeing cached data need to
now explicitly request defiance of the reserved cache space.  (Most
callers are already doing this by using FLAG_ALLOCATE_AGGRESSIVE.)

Rewrite the core logic of DeviceStorageMonitorService to understand
this new "reserved" cache space, and to be easier to understand.  It
also now handles cached data on adopted storage volumes, which had
been ignored until now.  Also fix bug where we had skipped "low"
broadcasts when the device skipped directly from/to "full" state.

Bug: 38008706
Test: cts-tradefed run commandAndExit cts-dev -m CtsJobSchedulerTestCases -t android.jobscheduler.cts.StorageConstraintTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Change-Id: Icbdcf3b52775f7ada1ceaeff2f96094c8d8052f9
2017-05-30 22:17:23 -06:00
Adam Lesinski
24c18af14a Merge "Add ResourceId validation helper method" into oc-dev 2017-05-26 18:45:28 +00:00
Tenghui Zhu
36d6a985cd Merge "Create a new drawable after caching the DrawableContainer" into oc-dev 2017-05-26 16:10:25 +00:00
Adam Lesinski
9553fb3240 Add ResourceId validation helper method
An invalid, 'null' resource ID is defined as 0. Apps often use -1.

Add a helper method that makes checking valid IDs easy and more
centralized.

Eventually make it public API.

Bug: 38393777
Test: manual
Change-Id: I969ec4a45e86bdab3d7f57d357d475b77c7f8a78
2017-05-24 15:39:23 -07:00
TreeHugger Robot
1de10d6602 Merge "System installed launcher can see instant apps" into oc-dev 2017-05-24 20:38:56 +00:00
Todd Kennedy
3051caac52 System installed launcher can see instant apps
Change-Id: I97f791b61f9b4f7ed33305345bf3d92394b40ae4
Fixes: 38202759
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Test: Manual. Create sample app that replaces the launcher to test ability to see ephemeral apps.
2017-05-24 07:34:55 -07:00
Adam Lesinski
4fed971437 Resources: fix race with creating theme
Bug: 38353957
Test: none
Change-Id: Id78770b475b979635da6a4067db6269e3a1b04d6
2017-05-23 13:14:54 -07:00
Dianne Hackborn
ad6dde65ff Merge "Fix issue #38393543: Not allowed to start service Intent" into oc-dev 2017-05-22 20:03:33 +00:00
Dianne Hackborn
3e6e3855ea Fix issue #38393543: Not allowed to start service Intent
Turns out there was another path in to the activity manager
to trigger a PendingIntent, which needs to be modified to
now also pass in the whitelist token of that pending intent.

Test: manual
Change-Id: I755ff87db1b782fa6974d404dcb490786053c5e0
2017-05-19 16:12:08 -07:00
ztenghui
ee7e8f13ea Create a new drawable after caching the DrawableContainer
fix:37135264

Test: Add new CTS test
bit
CtsGraphicsTestCases:android.graphics.drawable.cts.DrawableContainerStateTest,
CtsGraphicsTestCases:android.graphics.drawable.cts.DrawableContainerTest,
CtsGraphicsTestCases:android.graphics.drawable.cts.Drawable_ConstantStateTest

Change-Id: I8bb868d16a944f746ec41d3e37ae4215b964d949
2017-05-19 12:29:14 -07:00
TreeHugger Robot
01d5b3d2af Merge "Introduce early exit path for non resource path." into oc-dev 2017-05-18 23:30:24 +00:00
Makoto Onuki
ad623015a1 Restrict access to instant app data in usage stats
- Events are obfuscated based on whether the app was instant or not at
the time each event was logged.

- UsageStats are obfuscated based on whether each app is instant or
not at the moment.

Bug 38202133
Test: Manual test using UsageStatsTest and instant apps

Change-Id: I3c74309196b88d010d317cb0dd6749bf4624e876
2017-05-16 12:33:43 -07:00
Seigo Nonaka
2ea169a2ec Introduce early exit path for non resource path.
Developer can specify android:fontFamily with three ways, pre-defined
font family name, e.g. "sans-serif", path to the font file in resource
directory, e.g. "res/fonts/Roboto-Regular.ttf", or path to the XML font
family file, e.g. "res/fonts/Roboto.xml".

Resources.getFont treats font files and XML files but pre-defined family
name is handled by TextView. Thus, we can early exit if the passed value
is not likely resource path.

This improves the inflation performance.
The score without this patch:
gfx-avg-frame-time-50: 6.9
gfx-avg-frame-time-90: 9.4
gfx-avg-frame-time-95: 10.4
gfx-avg-frame-time-99: 16.7

The score with this patch:
gfx-avg-frame-time-50: 7.0
gfx-avg-frame-time-90: 8.9
gfx-avg-frame-time-95: 9.7
gfx-avg-frame-time-99: 16.5

Measured on bullhead-userdebug.

The APCT perf test improves from
String FontFamily: 200,086 -> 132,561
File FontFamily  : 199,256 -> 161,843
XML FontFamily   : 203,681 -> 158,553

Measured on angler-userdebug.

Bug: 38232467
Test: UiBenchmark
Change-Id: Ia601ae7207ae8c60848c9efdbb9396267a57257c
2017-05-16 10:14:56 -07:00
TreeHugger Robot
e04765998e Merge "Support recursive static shared lib dependency" into oc-dev 2017-05-15 23:49:07 +00:00
Svet Ganov
58c99f0207 Support recursive static shared lib dependency
Test: Updated the static shared lib CTS tests to verify that
      All static shared lib CTS tests pass

bug:35359862

Change-Id: Id4a0dabbc9d8e98962e92b6f537f6ffffa63b585
2017-05-15 14:43:17 -07:00
Dianne Hackborn
c75bd416e9 Merge "Fix issue #38210653: Few more tweaks of job scheduler" into oc-dev 2017-05-13 20:08:25 +00:00
Dianne Hackborn
bfc2331f2f Fix issue #38210653: Few more tweaks of job scheduler
- Now keep track of the time a job was enqueued, and order
  the pending list by that.
- Added configuration constants for rescheduling: maximum
  times to reschedule, minimum backoff times.
- Fixed printing of active jobs -- the method to get the current
  JobStatus was old and didn't require the caller to hold a
  lock, so made a copy, which didn't contain all the data we were
  interested in.  Now with our simple locking, we can just make
  that require the caller hold a lock and return the real
  JobStatus object.
- Include oom_adj and procstate when printing information about
  processes being killed.
- Expanded documentation of BroadcastReceiver.goAsync().

Test: bit CtsJobSchedulerTestCases:*

Change-Id: I2e45f181e45be9836c74cbff1b844ffdf6e93019
2017-05-12 17:29:04 -07:00
TreeHugger Robot
2a34734131 Merge "Add command to retrieve the instant app resolver" into oc-dev 2017-05-12 23:11:51 +00:00
TreeHugger Robot
b9a098aeb6 Merge "Update ShortcutManager/Service javadoc/impl around sizing" into oc-dev 2017-05-12 23:01:35 +00:00
Hyunyoung Song
4703746f50 Update ShortcutManager/Service javadoc/impl around sizing
to account for AdaptiveIconDrawable type of shortcuts

Test: builds for now.. If Makoto is happy with this change, will add tests

b/37743074

Change-Id: Ieecd95d621db57f858fac449d3bcedd173c8607c
2017-05-12 11:45:06 -07:00
Sunny Goyal
a31a74b993 Setting Session commited broadcast when an existing apk is enabled for
a different user

Test: Manual tests and CTS
Bug: 38204385
Change-Id: Ic3bddbc2e6070c11b11f0685077db7737f2b8849
2017-05-12 10:00:30 -07:00
TreeHugger Robot
c3db339987 Merge "System/root/shell need to explicitly ask for static libs to get them" into oc-dev 2017-05-12 03:46:58 +00:00
Svet Ganov
9e77977ffa System/root/shell need to explicitly ask for static libs to get them
Test: manual - settings no longer shows static shared libs
      all shared lib CTS tests pass

bug:36632271

Change-Id: If3363059b5f5300e309b61899af8c2559af317fe
2017-05-11 15:41:39 -07:00
TreeHugger Robot
7d75f49175 Merge "Fix support for @empty in style resolution" into oc-dev 2017-05-11 21:55:24 +00:00
Adam Lesinski
32e7501a27 Fix support for @empty in style resolution
If @empty is encountered in XML, do not fallback
to searching through the theme.

Bug: 36891052
Test: make aapt2_tests
Test: bit CtsContentTestCases:android.content.res.cts.TypedArrayTest
Change-Id: Ie3bf7b70af9c7913513a1092afd95d26bec5e635
2017-05-11 11:28:29 -07:00
Dianne Hackborn
983055231b Fix issue #37360626: Apps can schedule alarms (and other things) with temp whitelist
There is now an IBinder "token" that must be specified when setting
the whitelist duration for an Intent.  To have the whitelist supplied,
the caller to send a PendingIntent must pass in the same token.  The
PendingIntent and IntentSender classes now internally maintain this token
to pass in when their send() is called.

The big complexity for making this work is we now need to associate this
whitelist token correctly with the actual PendingIntent objects that
applications and other code is getting.  To do this, we propagate the
token in the Notification object, and have a new API on Parcel that allows
us to make it available to PendingIntent when it is unmarshalled.  And
this allows to deal with PendingIntents appearing in nested bundles, as
we can propagate that information from the original Parcel to the new
Parcel that Bundle keeps to delay unmarshalling.

Test: manual
Change-Id: Idda00490ccfe2be37e4ab21354b9ab7528a52750
2017-05-10 17:23:02 -07:00
TreeHugger Robot
31ef139466 Merge "Offload saving bitmaps from binder threads" into oc-dev 2017-05-10 22:24:14 +00:00
Makoto Onuki
475c36539d Offload saving bitmaps from binder threads
Bug 34691191
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases
Test: Manual test with the phone app

Change-Id: Ibccf8ca162eae9179ee4cbdf0307ff34a6953aa1
2017-05-09 16:53:01 -07:00
Bryce Lee
3979159456 Prevent non-fullscreen activities from influencing orientation
This changelist enforces that activities targeting O and beyond
can only specify an orientation if they are fullscreen. The
change ignores the orientation on the server side and throws an
exception when the client has an orientation set in onCreate or
invokes Activity#setRequestedOrientation.

Fixes: 33483680
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testNonFullscreenActivityProhibited
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testLegacyNonFullscreenActivityPermitted
Change-Id: I4f7f79744918fad6465a537633dfadec8d05c6df
2017-05-09 16:13:51 -07:00
Abodunrinwa Toki
3de110bbb7 Remove redundant TextClassificationService
Text classification is now being done entirely in the app's proccess.
See android.view.textclassifier.TextClassificationManager
Reverts Ic428d00f291e268211866b3fc6b7acbc3eb04e1e

Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Fixes: 36852122
Change-Id: Iffff3ab6e7d3b761576eb6bdcd5032db34b7a1b2
2017-05-09 13:51:03 +01:00
Todd Kennedy
0a3f081b22 Add command to retrieve the instant app resolver
Bug: 33073536
Test: gts-tradefed run commandAndExit gts-dev -m GtsPackageManagerHostTestCases -t com.google.android.pm.gts.PackageManagerHostTest
Change-Id: I3050fb083da2f85c7226291ec5c7794ed95a13ef
2017-05-08 14:43:15 -07:00
Philip P. Moltmann
ff6d6d9492 Persistable accessibility ID from ContextWrappers
Only IDs beyond LAST_APP_ACCESSIBILITY_ID can be reliably used for
autofilling. Other ids might change occasionally.

All Views attached to activities get usable IDs. Hence if a
ContextWrapper wraps an activity forward the goodness.

Also make sure that we don't accidentially autofill an unsafe view.

Test: Before the messaging handed out unusable Ids because it uses a
      Contextwrapper. Now it hands out good ideas (accoring to dumpsys)
      CtsAutoFillServiceTestCases
Bug: 38070352
Change-Id: Ibc72c84d77197019939abd231e8960988af7a592
2017-05-08 13:29:17 -07:00
Makoto Onuki
9ccb15a351 Merge "Show warning log when ShortcutInfo is re-published" into oc-dev 2017-05-05 20:11:08 +00:00
TreeHugger Robot
4804e41574 Merge "Create auxiliary info for local instant apps" into oc-dev 2017-05-05 19:35:32 +00:00
TreeHugger Robot
1ea3a2600b Merge "Resolve styles by font table if not specified." into oc-dev 2017-05-05 18:51:25 +00:00
Todd Kennedy
c0dd03a666 Create auxiliary info for local instant apps
This reverts commit a1d8051fa2.

Change-Id: Ic471a4efe64406dd75cc0bf1d6464276a94347d8
Fixes: 37947648
Test: Manual
Test: Install an instant app [https://www.nytimes.com/crosswords/game/mini]
Test: Try to run installed instant app from gMail
2017-05-05 10:34:28 -07:00
Seigo Nonaka
a5fa9e8a63 Resolve styles by font table if not specified.
android:fontStyle and android:fontWeight is an optional attribute.
If they are missing, we are using non-italic 400 weight, but this is
not good idea. We should resolve these style value from font metadata.

Bug: 37988154
Test: am instrument -w -e class android.content.res.cts.ResourcesTest
      android.content.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: I80a436cd3632d8c58fa3d8bdaedac73b95f61a8c
2017-05-05 09:30:34 -07:00
Bryce Lee
8cfb1a95da Merge "Revert "Create auxiliary info for local instant apps"" into oc-dev 2017-05-05 15:46:37 +00:00
Bryce Lee
a1d8051fa2 Revert "Create auxiliary info for local instant apps"
This reverts commit e15e7cb592.

Change-Id: I116904fd8c2b28df7e03bc5ec2414ed67761b380
2017-05-05 15:38:44 +00:00
TreeHugger Robot
d14e67656f Merge "Don't set the failure extra on split install" into oc-dev 2017-05-05 14:21:18 +00:00
TreeHugger Robot
d55670bcf5 Merge "Create auxiliary info for local instant apps" into oc-dev 2017-05-05 14:20:51 +00:00
Makoto Onuki
bf563b63e5 Show warning log when ShortcutInfo is re-published
Bug 37986391
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Change-Id: Id9ca30068440915d2e86850fe2ed3684c0ce2af8
2017-05-04 10:28:47 -07:00
Vladislav Kuzkokov
253984ed8c Store "block uninstall" flag separately from the rest of package state.
This allows to set "block uninstall" prior to installation and avoid the
inevitable race that happens when Device Policy app tries to force install and
then immediately block uninstall.

BUG=31043188
Test: Block com.chrome.beta in TestDPC. install, fail to uninstall through adb, unblock, uninstall

Change-Id: I5ffa2abcb003982eccfb77585c43b59532dd501d
(cherry picked from commit 1fff9dcb9d)
2017-05-04 15:54:08 +00:00
Todd Kennedy
7dd99e3d46 Don't set the failure extra on split install
Change-Id: I2f836b5ebc9f377ae8fe0a0d4a60541dd1666011
Fixes: 37852108
Test: Manual
Test: Install and run pico blast
Test: Note that the failure extra is set
Test: Click "New" to install a split
Test: Note that the failure extra isn't set
2017-05-03 16:12:49 -07:00
Todd Kennedy
e15e7cb592 Create auxiliary info for local instant apps
Change-Id: I73fc6f36f666a0f4fd538e1d3c541ce10443902d
Fixes: 37947648
Test: Manual
Test: Install an instant app [https://www.nytimes.com/crosswords/game/mini]
Test: Try to run installed instant app from gMail
2017-05-03 14:56:57 -07:00
Bartosz Fabianowski
40a006285b Add more explicit documentation for install reason
This CL adds more explicit documentation of the install reason argument /
return value to PackageInstaller.SessionInfo.

Bug: 37324584
Test: None

Change-Id: I2450cc669b194e611c5dc07c6a0a5cd78a98c039
2017-05-03 15:17:36 +02:00
Calin Juravle
5f016f6705 Merge "Make PM#notifyDexLoad oneway" into oc-dev 2017-05-02 19:03:22 +00:00
TreeHugger Robot
b3e92234fa Merge "Fix NPE happens if no source was specified to font element." into oc-dev 2017-05-02 17:23:03 +00:00
TreeHugger Robot
22c1275c89 Merge "Don't send configuration that app doesn't support to it." into oc-dev 2017-05-02 13:58:59 +00:00
Seigo Nonaka
5e0aed49a8 Fix NPE happens if no source was specified to font element.
This also fixes unexpected fallback to the old implemntation by calling
allowUnsupportedFont() which is only for backward compatibility.

This CL also remove getResourceId() method. Nobody uses this method.

Bug: 37865521
Bug: 37844248
Test: am instrument -w -e class android.content.res.cts.ResourcesTest\
      android.content.cts/android.support.test.runner.AndroidJUnitRunner
Change-Id: I987448add728c53c916f24a2ea8f337be417248f
2017-05-01 23:23:50 -07:00