Commit Graph

62 Commits

Author SHA1 Message Date
Salvador Martinez
030eeeee6d Added guard to logging in AsyncTask
An async task was trying to get the context
in an InstrumentedFragment. This could return
null if the context disappears before the new
thread gets to that line. Logging will now
be aborted if context is null to avoid this.

Test: Manual/Monkey Stability Test
Bug: 31058928
Change-Id: Iae97d389e58a76b0f213a2749415501894ebf649
(cherry picked from commit 566b66e27c)
2016-08-25 17:45:24 +00:00
Doris Ling
bfbb964cb1 Log settings suggestions events only once.
The show/hide settings suggestions events are logged every time Settings
is shown. Save the logged events into the state bundle so that when the
fragment is resumed, it does not re-log the suggestions events.

Also move the logging for the show suggestion event to when the suggestion
is loaded, as the suggestions can be empty when the fragment starts.

Change-Id: I644ea0012bad309e59fed0d48171915c955779cc
Fixes: 30108142
2016-08-23 13:25:06 -07:00
Doris Ling
b7e650c6f7 Check for null activity before getting dashboard categories.
In DashboardSummary, when async task finishes running, ensure that the
fragment is still associated with the activity before getting the
dashboard categories from the activity.

Change-Id: If23cd27a0d3e3429d900ae41ef6f24ed03b9e8d6
Fixes: 30278854
2016-07-21 12:22:17 -07:00
Doris Ling
38d8582abe Combine setCategories() and setSuggestions() in DashboardAdapter.
In DashboardSummary.rebuildUI(), we first update the adapter with the
current categories, then run the async task to update the adapter with
the suggestions. This causes the adapter to first layout the existing
categories, and relayout when the suggestions is available. This causes
the suggestions view and categories view to overlap before the
relayout is complete.

Since categories and suggestions are borh set each time we try to
rebuild the UI, delaying the update for categories until the suggestions
are ready will avoid the unnecessary relayout of the list elements.

Ran app launch test for Settings app with the change and launch time is
between 412ms and 486ms in 10 runs, which does not show much delay in
app launch time with delaying updating the categories.

Bug: 29318104
Change-Id: I03ae2386392315f28fe2c361682f2f3252e9f827
2016-07-15 13:08:56 -07:00
Doris Ling
b76de265a2 Reduce the number of times that dataset changed is triggerd in DashboardAdapter
1. Save the suggestion list and the category list into the instance
state so that it will be available on warm start, and avoid the need
to reload the data.
2. Add the condition list to the constructor parameters for
DashboardAdapter, so that it does not need to setConditions()
separately which will trigger notifyDataSetChanged()

Bug: 30055644
Change-Id: Ia04fa3a25b13d2dacf6baf5f412d662a595fb6dd
2016-07-12 18:02:22 -07:00
Jason Monk
718c84f121 resolve merge conflicts of 67e87fa to nyc-mr1-dev
Change-Id: I8c5a79de3176912a1803a481b8b179faf1dad178
2016-06-01 16:20:01 -04:00
Jason Monk
350a930c68 onResume -> onStart, onPause -> onStop
For SettingsActivity and DashboardSummary

Bug: 28896214
Change-Id: I235d5c82b04b1363bf4416acb5cf5fc1c4db704f
2016-06-01 13:45:25 -04:00
Jason Monk
e3b9c3dd63 Merge "Fix crash from battery saver switch" into nyc-dev
am: 371aec1e92

* commit '371aec1e92aa4b5cf6e4ed2b5f39faf180c17d1f':
  Fix crash from battery saver switch

Change-Id: I0416b92dbc9b18a97c9d6d0617cba636e310690b
2016-05-26 17:53:41 +00:00
Jason Monk
e4d0ed502d Fix crash from battery saver switch
Turns out most things expect the conditions to be loaded immediately
so if the dashboard hasn't been hit, they crash.  Instead load
immediately for everything but the dashboard.

Change-Id: Iaa1114c88b3766e2ac513acb417ef2a55a0f4e7f
Fixes: 28952354
2016-05-26 11:07:53 -04:00
Jason Monk
f241ae5fcf Merge "Protect against case when suggestions haven\'t loaded" into nyc-dev
am: 76f95e82b8

* commit '76f95e82b861441bccb9f452fe77e1c47acc1d3c':
  Protect against case when suggestions haven't loaded

Change-Id: Ie0bc3aa3e696efcec5560860284b457e636bd5bc
2016-05-11 15:16:01 +00:00
Jason Monk
31ecec0ab1 Protect against case when suggestions haven't loaded
Change-Id: I7668ed8af3f1808b619f0fdbd77c2f85da98f607
Fixes: 28691636
2016-05-11 11:01:17 -04:00
Jason Monk
6e9867dcc9 Merge "Make sure TileAdapter always has a SuggestionParser" into nyc-dev
am: a50a14a23a

* commit 'a50a14a23a4f57203d01489ddef607f46f485518':
  Make sure TileAdapter always has a SuggestionParser

Change-Id: I87ee80fa989079c554c60870b9ddc70d3b36c5e4
2016-05-10 20:26:22 +00:00
Jason Monk
a41a8d05ab Make sure TileAdapter always has a SuggestionParser
Since it expects to have one

Change-Id: Ic0dccd2271c011cf7dc877e341af5a8bfea90c37
Fixes: 28689801
2016-05-10 13:03:35 -04:00
Jason Monk
96eedcfdd2 Merge "Dashboard performance work" into nyc-dev
am: 04b25af149

* commit '04b25af149ba8e4c38cfe17fe9caf246a598e8e3':
  Dashboard performance work

Change-Id: I41c9443c997428924b5ef6df2ad632c06bd416a8
2016-05-09 13:40:54 +00:00
Jason Monk
2386dfc18d Dashboard performance work
Push more stuff to backround threads (this will cause conditions/suggestions
to load slightly slower than normal content) and cache more info.

Fixes: 28613950
Bug: 28435146
Change-Id: I1080930e8f31c7f12a2d89f266bfd3236979cf40
2016-05-06 13:17:47 -04:00
Fan Zhang
2869157ba9 Display setting and support in a tab layout - DO NOT MERGE
Bug: 28269035
Bug: 28139604
2016-04-20 11:42:15 -07:00
Jason Monk
5673ced93c Work on settings startup speed
- Cut down on amount stored in conditions xml
 - Remove extra work from dashboard startup
 - Move summary to min priority

Change-Id: I51ca3828e4446632d6faa60dcfbab3446d19d335
Fixes: 28134360
2016-04-12 15:19:50 -04:00
Jason Monk
db3fcfb7cb Merge "Settings tweaks" into nyc-dev 2016-04-08 20:46:49 +00:00
Jason Monk
be8d5aa2b9 Settings tweaks
Change-Id: I68829fa8e49534d4635a008c94dced3c7ab6f4b1
Fixes: 27834471
Fixes: 27834626
Fixes: 27567838
Fixes: 27834676
2016-04-08 16:44:31 -04:00
Suprabh Shukla
b84720c075 Moving HelpUtils to SettingsLib
Moved HelpUtils to SettingsLib in frameworks/base so it can be shared by
packageinstaller as well.

Bug: b/22096093
Change-Id: I8d620abcde8279a3b4d11bbcff8ae9b6f46a1895
2016-04-05 14:37:33 -07:00
Jason Monk
45fda2734a Add metrics for suggestions
Bug: 27851236
Change-Id: Ia5aa1d42a40ba09a19db3c3790f0a7342660e613
2016-03-30 16:05:29 -04:00
Jason Monk
f20c718f19 Add metrics for settings conditionals
Bug: 27851236
Change-Id: I400716457d3f628419410a02c2a457d41d19a067
2016-03-30 15:46:26 -04:00
Jason Monk
decc767f26 Guard against monkey crash.
Bug: 27784445
Change-Id: I4ba6e02e0cdb6857661a824ae0888feac6762a05
2016-03-22 09:17:12 -07:00
Jason Monk
d11cca0168 Fix Settings home lifecycle
Bug: 27330440
Bug: 26268813
Change-Id: Ibb3729c9872be2488db3741ec72ba5a43e66db5f
2016-03-16 14:27:12 -04:00
Udam Saini
aa693f6734 Merge "Adds screen lock as a suggested activity" 2016-01-27 18:08:48 +00:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Udam Saini
7ad4a17c5c Adds screen lock as a suggested activity
Also, fixes a bug where the suggested activity stayed on screen
after the component was disabled causing a crash.

bug:25246207
bug:26770556
Change-Id: I28d784cdc57e464e49887483690ab514ca3bc46a
2016-01-26 17:09:02 -08:00
Jason Monk
91ca519a0f Support changes to SuggestionParser
Change-Id: I002e10cfe2a058f934d2c6218c88c2588654733f
2016-01-26 13:58:25 -05:00
Jason Monk
d4f03ec86f Add suggestions to settings
Use an XML to define the categories that Settings will look for,
and surface enabled activities under those categories as suggestions.

When clicked on the activity will be started for result.  If the result
is not cancelled, then the operation is assumed successful and the
suggestion is disabled.  Users can also use an overflow -> remove
flow to get rid of unwanted suggestions.

Change-Id: I767abf8efe103af0509bc6b6b55888ae82643512
2016-01-07 16:25:34 -05:00
Jason Monk
db4ed191de Add conditionals to Settings
Also add Airplane Mode and Hotspot conditionals (more to come soon)

Change-Id: I11f206db59f7c715f416fb5852b8f0fcb857a247
2015-12-14 10:29:12 -05:00
Jason Monk
fd2c722418 Work on settings launch speed
Move some stuff to the background, avoid doing other things.

Change-Id: I145172efa16f81c2f377f07744c8f88145e2ed1d
2015-12-02 16:10:08 -05:00
Jason Monk
8c4ca41d25 Make sure the dashboard is up to date
Bug: 25794089
Change-Id: I65eaa8e14b3c998ec122eaa9fc4dbbe3749c568c
2015-11-30 15:43:34 -05:00
Jason Monk
3069581512 Summary support for Settings Home
Also add summaries to a few of the major items.

Change-Id: I17924f14941fe095d819e142cdd21cf4b4e9ffd1
2015-11-17 13:51:45 -05:00
Jason Monk
7c7eb70dc3 First pass at restyling dashboard
Still needs summaries, but the things are in the right place-ish.

Change-Id: I1cbc23da9f56589836b5ebd7e202114e8f323adc
2015-11-11 16:46:15 -05:00
Jason Monk
2fe90293a1 Various small crash fixes and guards
Bug: 25501551
Bug: 25583654
Bug: 25510495
Bug: 23575961
Change-Id: Id0e7f6aacdf763bf95b49d281aa8755afcd2e5ef
2015-11-10 15:43:54 -05:00
Jason Monk
4da79e088f First pass at drawer to Settings
Change-Id: I94c3bc69ff773e48c33f59f37bfc0d91139c187a
2015-11-04 11:11:25 -05:00
Jason Monk
15dcebe1e7 Help fallbacks and intent work
- Handle a backup URI, so that if the specified URI is not available,
   another can be used.
 - Add some data to help intents when they are intent URIs
 - Fill in the context with a classname when it isn't present

Bug: 15475009
Change-Id: I7050fa61121901929e650b20bd7a0ae21e8ba207
2015-05-28 09:50:45 -04:00
Jason Monk
47d16e9bf6 Tint dashboard items coming from external tiles
So they can match the Settings theme.

Bug: 20449897
Change-Id: I33ad0d78dad6fbc9dae35552246a559b6508deaf
2015-04-23 12:41:40 -04:00
Jason Monk
23acc2bb8a Allow help to be defined to intent uri
Allow help uris to be either an intent uri or as uri (as they were
before). Also add a default help uri, and specific helps for several
screens.

Bug: 15475009
Change-Id: Iff982892973f01d32ff61ea88d4844e9a7153500
2015-04-14 15:43:20 -04:00
Chris Wren
8a963babe2 log visibility of views
Depends-On: I5b1dccb5d103ece3112acf38889bae16273b092f
Change-Id: I116aed2bb805f723a5bf2ec9eb94257de0b4a7b5
2015-03-27 13:39:07 -04:00
Jason Monk
2ebc8a0169 Allow system apps to add to settings dashboard
Allow system apps to add a tile to the top level of settings that
links to an activity through adding a filter for a specific action.
Determine the info for the tile based off manifest info for the
activity. Also allow the same for managed profiles, but show a dialog
in between to select which profile.

The category in which the item is to be placed must be in meta-data.
The icon and title can be specified through meta-data as well or
if unspecified the activity's label and icon will be used.

Also added an optional <external-tiles> tag to the dashboard
category xml, this allows Settings to put external tiles
in the middle of some categories (Personal does this).

Bug: 19443117
Change-Id: Idc9938d1549d181103a3030a8784b527215a8399
2015-03-25 11:11:36 -04:00
Fabrice Di Meglio
c9ad22c38b More code cleaning for the Home intent filters
- remove the Intent.CATEGORY_HOME as it is not useful and
cannot be used into an Intent filter

Change-Id: I516188ea1c662c3277c64194c229a2e1c03a4e6a
2014-07-23 19:32:57 -07:00
Fabrice Di Meglio
7f5c5e8bb8 Code cleaning
- remove those non usefull Intent.CATEGORY_LAUNCHER

Change-Id: Ib6e5f4a5265633da85423307fac26a104814f05f
2014-07-23 19:03:33 -07:00
Fabrice Di Meglio
b0a464fd2c Fix how Home Activities are refreshed
- remove that HomePackageReceiver from the AndroidManifest
that could force Settings to run
- use a HomePackageReceiver into HomeSettings and DashboardSummary
- fix also the BatteryInfoReceiver for refreshing the Dashboard

Change-Id: Id3891529fc176e7e4c450f2ce723f8ac2af66c58
2014-07-23 18:20:53 -07:00
Alexandra Gherghina
cfc7f9d960 Remove old accounts tile, replaced by a separate screen
Bug: 15815948
Bug: 15819268
Change-Id: I3b6978cff346c73cca1d6a2c209ffe4c71808244
2014-07-14 10:02:14 +01:00
Fabrice Di Meglio
47a25e7640 Update Dashboard layout again
- follow UX spec
- update also the Search Panels (suggestions / results) to
follow the same specs

See bug: #15384992 Setting Dashboard - padding updates

Change-Id: I3d27a3b3d9779644f8ea123990a0c7bed8d4ba74
2014-06-23 13:23:47 -07:00
Fabrice Di Meglio
53d76860a5 Fix bug #15161058 Stability: ISE in Settings:Fragment DashboardSummary{588de71} not attached to Activity
- prevent rebuilding the UI until the fragment got attached

Change-Id: I6d5fcbce2581f3fc9900f1ca4fc8178ee959061e
2014-05-22 11:27:43 -07:00
Fabrice Di Meglio
b644f29313 Optimize Dashboard loading
- prevent loading categories twice
- add some logging to see the time taken for building the Dashboard titles

Change-Id: I31724c0e66fe3b453a87f12476f58db84c73423f
2014-05-22 10:30:03 -07:00
Fabrice Di Meglio
5f995727cc Fix bug #15080198 Enabling developer options requires restart of settings to enter
- fix Dashboard categories refresh issue

Change-Id: I5bb7fc4a1410df8f5c2d2d13f7625a1ccc8893c3
2014-05-19 19:51:31 -07:00
Fabrice Di Meglio
a8072fa6e0 Fix bug 14990524 Add account does not refresh the list of accounts in the Dashboard
- unregister the OnAccountsUpdateListener in Fragment.onDestroy() instead of
in Fragment.onStop()

Change-Id: I07c92f85bb6efb34771d93158f00b60d93f4c90b
2014-05-15 19:32:39 -07:00