4310 Commits

Author SHA1 Message Date
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
Adam Powell
2442841819 Implement ChooserTargetService querying for ChooserActivity
First cut at querying services provided by apps that offer
ChooserTargetServices. This first implementation provides no ranking.

Bind to a limit of 5 ChooserTargetServices and offer the
ChooserTargets they provide as options in the system
ChooserActivity. The chooser now presents targets as a grid and
displays the activity icon from the referrer activity.

Change-Id: I45db829f184fc78d4f18d42b2a60b25bc301eba8
2015-04-13 16:51:16 -07:00
John Spurlock
cbcf902a4a Merge "Zen: Support external condition providers." 2015-04-13 23:14:04 +00:00
Christopher Tate
9310e4285b Avoid zero-payload backups in local transport
The local debugging transport now implements
BackupTransport.checkFullBackupSize() to detect and reject backup attempts
for which no actual file content will be committed.  The documentation for
checkFullBackupSize() has also been expanded to document the transport's
responsibilities in this regard.

The local transport now lazy-creates the destination file when data is
first delivered for an approved backup operation, rather than doing it
proactively in performBackup(), to ensure that changes in the datastore
are only attempted after the transport has positive confirmation that
data is indeed flowing.

Change-Id: I6e47a7e72cd938fc0ed31da4bc490540c71f9e65
2015-04-13 22:13:23 +00:00
Alan Viverette
0cdd4a93a4 Merge "Fix control alignment for single- and multi-select dialogs" 2015-04-13 19:28:00 +00:00
Alan Viverette
147931e3f9 Merge "Fix date picker dialog size" 2015-04-13 18:13:48 +00:00
John Spurlock
39581cc16d Zen: Support external condition providers.
- Manage provider subscriptions for external condition providers
   within ZenModeConditions.
 - Move "is automatic rule active" check into common location.
 - Add constant for external rule setting configuration page.
 - Consolidate log tags.
 - Reset rule snoozing on boot.

Bug: 20064962
Change-Id: Ida207dbf363f61e1727974e611f43f27c23accfb
2015-04-13 12:12:46 -04:00
Jeff Sharkey
59d577a518 Browse mode for DocumentsUI, removed volume state.
The existing management mode is too specific, and requires that
storage backends add queryChildDocumentsForManage(), etc.  Instead,
to offer more natural browsing support, add a new BROWSE_ROOT intent.

It behaves mostly like MANAGE_ROOT, except that it doesn't mutate
its Uris with setManageMode(), and it shortcuts straight to VIEW on
clicked documents.

It can be launched like this:

$ adb shell am start -a android.provider.action.BROWSE_ROOT
    -d content://com.android.externalstorage.documents/root/8405-1DFB
    -c android.intent.category.DEFAULT

Also rename a MetricsConstants to make it clearer, and don't
auto-mount all emulated volumes.

Fix bugs around parceling of DiskInfo/VolumeInfo.  Method to resolve
the best description for a VolumeInfo, which might need to fall
back to DiskInfo.

Add back "removed" volume state so we send broadcast when a volume
is destroyed, matching the expected public API behavior.

Bug: 19993667
Change-Id: I13aff32c5e11dfc63da44aee9e93a27f4690a43f
2015-04-12 16:03:50 -07:00
Alan Viverette
816aa14202 Fix date picker dialog size
Also fixes date picker instance state restore and cleans up the fade
animations.

Bug: 20110268
Change-Id: I503e2f81253077f22f1619834dc2f2634138ae4e
2015-04-10 15:41:10 -07:00
Adam Lesinski
eaa6a3fba8 Merge "Fix deadlock issue in BatteryStatsHelper." 2015-04-10 21:33:50 +00:00
Adam Lesinski
1739076ef9 Fix deadlock issue in BatteryStatsHelper.
It was assumed that BatteryStatsHelper could safely call into system services.
Because it is used when dumping information from the BatteryStatsService,
this assumption was incorrect.

Now the BatteryStats object carries around the state of the energy reporting
for Bluetooth and WiFi, so BatteryStatsHelper avoids a query into WiFiManager.

b/19729960

Change-Id: I8745cf6aafeea8e862e34fe63b20056f6ba54b40
2015-04-10 13:17:47 -07:00
Chris Wren
250662a4ae Merge "Support ad hoc counters in the framework" 2015-04-10 14:12:25 +00:00
John Spurlock
ec88e8956c Merge "An update on Downtime." 2015-04-10 01:48:06 +00:00
John Spurlock
b2278d6571 An update on Downtime.
The update is that Downtime is obsolete.  Replaced by the
ability to define multiple named schedule calendars.

 - Make changes to ZenModeConfig to properly model manual
   and automatic rules.
 - Refactor the zen mode helper (and supporting classes) to
   properly handle / report multiple claims on zen mode.
   The "manual" rule (specified by the user in the UI) vs
   one or more automatic rules.
 - Automatic rules are still backed by condition providers,
   but the layering is now cleaner.  ConditionProviders is now
   completely generic, has no ties to zen mode.
 - Specifically, the new layering for zen mode (below noman) is:
   ZenModeHelper: Source of truth for zen state
     ZenModeFiltering: Subhelper dedicated to filtering rules.
     ZenModeConditions: Subhelper dedicated to managing automatic rules.
       ConditionProviders:  Underlying engine for reporting named boolean state.
 - Migration story for users with existing downtime config, migrated
   to a single new calendar named downtime.
 - For users with no existing downtime, two default calendars are created
   for weeknights + weekends (icu4j for all locales will be done in a followup).
 - Remove obsolete DowntimeConditionProvider/NextAlarmConditionProvider and tracking.
 - Clean up obsolete resources.
 - Add common zen summary description string computation.
 - Add proper noman wrappers for the new model.
 - Change the semantics of the global zen setting.  It is now read-only.  Setters
   must call noman, added a "reason" to all calls for better attribution.
 - Update zenmodepanel + volumedialog to the new model.
 - Display the one or more automatic rules in the new zen footer summary.
 - "Snooze" the automatic rules when the user explicitly turns zen off.

Bug: 20064962
Change-Id: Idd9deb865a6035ad0cfae660198dccb517e6d7cc
2015-04-09 21:45:08 -04:00
Dianne Hackborn
24f683523e Merge "More work on device idle mode and other power stuff." 2015-04-09 22:35:36 +00:00
Dianne Hackborn
4870e9d5eb More work on device idle mode and other power stuff.
Add idle mode support to the alarm manager.  Introduce
a new concept of flags associated with alarms to tell
the alarm manager how to treat the alarm -- they allow
everything from the alarm that will bring us out of idle
mode, to alarms that are allowed when idle or should
also bring us out of idle.  The standalone boolean is
now also a flag.

(Note there is currently no protection from user space
setting the flags however it wants; I will be working
on that in a follow-up change.)

When in idle mode, the alarm manager pushes all alarms
that shouldn't execute during that time over to a
separate list that is not executed until out of idle.
To help with this, I reworked a bit how Alarm objects
are managed, so that when rebatching or moving between
lists we don't have to allocated new objects but can
just use the same existing instance.

Also tweaked the sync manager to deal with idle mode,
which currently just means doing the same thing as when
low on storage -- turning off sync.

Add new ACTION_CHARGING and ACTION_DISCHARGING broadcasts
that apps can listen for to know when the device is actively
charging and discharging.  These are better than the old
POWER_CONNECTED and POWER_DISCONNECTED ones because we only
report charging when we actually see that there is enough
power being provided to charge the battery (and will report
discharging if there is not enough power).

The job controller uses these new actions for scheduling
jobs that want to run while plugged in.  Removed the
"stable charging" stuff while doing so, since the new
charging state serves as an even better signal for that.

Introduced two new process states: FOREGROUND_SERVICE and
TOP_SLEEPING.  This will allow us to treat foreground services
specially (such as still allowing network access to them for
background music playback) while not mixing them together with
whatever happens to be the top activity while the device is
asleep.

Also some other small cleanup here and there.

Change-Id: I7a9808b578bad6f50deb8e1baf919298512a0d3a
2015-04-09 14:05:17 -07:00
Mike Lockwood
d954fbb967 Merge "Add support for Bluetooth MIDI devices" 2015-04-09 21:02:09 +00:00
Mike Lockwood
427a90c57a Merge "Add support for flushing MIDI all scheduled MIDI events on a port" 2015-04-09 21:01:44 +00:00
Chris Wren
723aa768f6 Support ad hoc counters in the framework
with some examples in NotificationManagerService.

New counters in this CL:
  note_with_people
  note_dismiss_longevity
  note_click_longevity

Bug: 20137009
Change-Id: I10b769ff4872d50f4c1c3828ea519f9712be7bc2
2015-04-09 16:33:06 -04:00
Chris Wren
531d5ab59d Merge "update metrics constants" 2015-04-09 20:13:27 +00:00
Chris Wren
f6b9fe55a8 update metrics constants
Change-Id: I73ea3fe98a3b41b1072688a846ef1c396a9e9a30
2015-04-09 15:39:19 -04:00
Mike Lockwood
f0a41d1c59 Add support for Bluetooth MIDI devices
The Bluetooth MIDI devices are handled in the BluetoothMidiService APK.
Apps wishing to connect to Bluetooth MIDI devices call MidiManager.openBluetoothDevice()
which binds to BluetoothMidiService in a similar way as virtual devices are implemented.

Change-Id: Ie3fbca757928fd7873a009f9bf9e0ce0be487da6
2015-04-09 11:49:51 -07:00
Mike Lockwood
b6f50d357b Add support for flushing MIDI all scheduled MIDI events on a port
Change-Id: I39d7862540d4d4b9e2df1265f9dd253541adb4c2
2015-04-09 11:49:45 -07:00
Abodunrinwa Toki
22e67b55b2 Merge "FloatingToolbar with overflow. -Implemented the toolbar overflow -Refactored a bit to make the concepts clear and component easier to understand and maintain -Floating toolbar now uses a clipped popup window that allows touch events to go through the transparent parts" 2015-04-09 15:04:41 +00:00
Richard Uhler
a1b19b7b66 am 00ff42a0: am 7f757130: am f324d245: Merge "Reuse dexopt method for both dex2oat and patchoat."
* commit '00ff42a0ca9d17c4b7ee89d900cf86c9a25c00eb':
  Reuse dexopt method for both dex2oat and patchoat.
2015-04-09 14:51:13 +00:00
Richard Uhler
7f7571308d am f324d245: Merge "Reuse dexopt method for both dex2oat and patchoat."
* commit 'f324d245fdd07ac14ab312d1a5fa04a4e8dfcceb':
  Reuse dexopt method for both dex2oat and patchoat.
2015-04-09 14:31:10 +00:00
Richard Uhler
f324d245fd Merge "Reuse dexopt method for both dex2oat and patchoat." 2015-04-09 14:13:29 +00:00
Abodunrinwa Toki
517adad1c4 FloatingToolbar with overflow.
-Implemented the toolbar overflow
-Refactored a bit to make the concepts clear and component easier to understand and maintain
-Floating toolbar now uses a clipped popup window that allows touch events to go through the transparent parts

Change-Id: I84794e45a8a10f004654550fe976585f9e62bdb5
2015-04-09 14:42:23 +01:00
Alan Viverette
8990083b19 Fix control alignment for single- and multi-select dialogs
Clean up some code in AlertController.

Change-Id: I0e4978c4c14dd838188cb23565eb231903c82afe
2015-04-08 12:45:54 -07:00
Benjamin Franz
f63afe7b33 Merge "Allow disabling the lock screen when multiple users are present" 2015-04-08 15:02:43 +00:00
Clara Bayarri
2f92e9710a Merge "Floating toolbar: Create the FloatingActionMode and use it in DecorView." 2015-04-08 08:00:01 +00:00
Adam Lesinski
e08af19fcc Adding per UID WiFi power distribution.
Change-Id: I88c539074607d7261f6c5cf1dbae47c3cf53f253
2015-04-07 11:37:10 -07:00
Dmitriy Ivanov
aa94389ba2 am d95e58cb: Merge "Load libraries directly from apk"
* commit 'd95e58cb609228c4c4b231e00d6bb648e9dcaf71':
  Load libraries directly from apk
2015-04-07 17:49:12 +00:00
Dmitriy Ivanov
d95e58cb60 Merge "Load libraries directly from apk" 2015-04-07 17:28:15 +00:00
Dmitriy Ivanov
dec4688f40 Load libraries directly from apk
Introduced new 'extractNativeLibs' attribute to manifest/application.
 Setting it to false prevents installer from extracting library from apk.

 The default value for extractNativeLibs is true.

Bug: 8076853
(cherry picked from commit ff193d642eea7128faad837d19e347cd25212c27)
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-04-07 17:25:23 +00:00
Benjamin Franz
51ed794e2f Allow disabling the lock screen when multiple users are present
Disallowing disabling the lock screen when multiple switchable users
are present on the device was a legacy from the time when the lock
screen was the only way of switching between users. As we offer other
ways to switch users now, e.g. quick settings, we no longer need this
check.

Also introduce a per user version of disabling the lock screen.

Bug: 19962043
Change-Id: I131568a5dadd1706762b8a626e8f9b06e973b7ae
2015-04-07 16:34:56 +01:00
Narayan Kamath
9d1878674c Merge "Don't set userSetLocale from Configuration.setLocale." 2015-04-07 13:08:18 +00:00
Clara Bayarri
838e36cda7 Floating toolbar: Create the FloatingActionMode and use it in DecorView.
This CL
- Creates a new FloatingActionMode
- Uses it for action mode requests of type floating
- Plumbs in the positioning invalidation logic

Change-Id: I379de5b0a87b256946d0a6d8014299cfb78e6734
2015-04-07 11:24:06 +01: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
Bart Sears
80ac603651 Merge "Revert "Adding per UID WiFi power distribution."" 2015-04-07 06:19:55 +00:00
Bart Sears
e9b9b73ab5 Revert "Adding per UID WiFi power distribution."
This CL is breaking the clockwork settings app in master.  Reverting
until Adam has a chance to investigate.

This reverts commit b943fabfc8ddb581dc2fd7288f87428dcb5d27b7.

Change-Id: Ieb11423c11cf9874a6175dce49843d0e1080c590
2015-04-07 06:14:04 +00: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
Adam Lesinski
0dce2acbe8 Merge "Adding per UID WiFi power distribution." 2015-04-07 01:53:00 +00:00
Adam Lesinski
b943fabfc8 Adding per UID WiFi power distribution.
Change-Id: Ia3d97e0a1c3352127185c18626d8ba8221c9ab40
2015-04-06 18:36:06 -07:00
Christopher Tate
e012a23556 Back up / restore preferred app configuration
Bug 19848104

Change-Id: I84cdfcc44b48a9732984955d7eedf745b5586bdd
2015-04-06 17:36:25 -07:00
Dianne Hackborn
5164608195 Merge "Various fixes and improvements..." 2015-04-06 20:21:58 +00:00
Raph Levien
f1f9902b19 Merge "Load hyphenation data at Zygote init" 2015-04-06 20:02:16 +00:00
Raph Levien
c3dd1c1b91 Load hyphenation data at Zygote init
Loading hyphenation data on demand can cause UI jank (and can be a
strict mode violation). This patch explicitly loads the data at
Zygote init time. It also chooses /system/usr/hyphen-data as the path
for this data.

Bug: 20060770

Change-Id: Idac68e3971f8638f1d70960594bf6c1050bb23d6
2015-04-06 19:53:30 +00:00
Jeff Sharkey
16c9c249d5 Fix up ExternalStorageFormatter.
It's not going to be around for much longer, so just fix enough to
work correctly.

Also teach about new "unmountable" state from vold.

Bug: 19993667
Change-Id: Ib72c3e134092b2a895389dd5b056f4bb8043709a
2015-04-04 21:37:47 -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