Commit Graph

41 Commits

Author SHA1 Message Date
Shuhrat Dehkanov
f9237f6e3c Do not set minimum value for mobile data limit dialog higher than the actual set value
When mobile data limit and warning limit are set to 0, pressing mobile data limit text
(0.0 GB) pops up mobile data limit dialog with minimum value 1. But the value set is 0,
which is causing the dialog to show its maximum value 2^31-1.

Change-Id: I79ed4df5fbf095a7e60bda640ff2ca26bcbd3cc4
Signed-off-by: Shuhrat Dehkanov <uzbmaster@gmail.com>
2012-01-26 23:04:02 +09:00
Jeff Sharkey
bdf98e84ab Data usage label width, locking, Wi-Fi fixes.
Avoid wrapping sweep labels when underlying string is long, and avoid
showing blank "^1" sweep labels.  Only offer "restrict data" when
mobile networks are present.  Add locking around UidDetailProvider.

Move to isNetworkSupported() for consistency.

Bug: 5492495, 5471602, 5439402, 5373465
Change-Id: I79f5938d45ffbb4c2c242106424a466042a26c1c
2011-11-10 17:17:24 -08:00
Amith Yamasani
5ba0a0295f Prevent orphaned fragment on the settings stack.
Remove the AppDetailsFragment from the stack if DataUsage is being destroyed.

Bug: 5572241
Change-Id: Ifb2c9233bf75c8cc7b43eec5ea3f0c0b0ba65ffe
2011-11-07 15:20:39 -08:00
Jeff Sharkey
461842a8c0 Data usage strings, sweep touches, fixes.
Change strings around limiting background data.  Move limit/warning
sweeps above inspection sweeps, and teach about additional neighbors
on different axis.

Guard against DialogFragment.show(), fix pie chart to draw edges, and
remove data usage from battery UI.

Bug: 5341374, 5337650, 5337385, 5319465, 5236335
Change-Id: Iea8c2a2ab405b645d85abe34a0178d4b8874cdd5
2011-09-25 18:41:13 -07:00
Jeff Sharkey
a83a24f48a Surface tethering stats in data usage.
Bug: 5244846
Change-Id: Ib4ac03ab634278714576a66ef8d6fdbc6d15c82a
2011-09-16 18:28:39 -07:00
Jeff Sharkey
a53188fe5a Data usage: precise editing, restrict help, D-pad.
Introduce dialogs for precise editing of network policy warning/limit
values, triggered by click on sweep labels.  Show up to 999MB before
rounding to GB, and round to nearest 5MB value when dragging.  Partial
D-pad navigation around chart controls.  Fix jumping when relayout
during drag, and fix sweep overlap bug.

When restricting data without limited networks, show dialog help to
guide user towards network limit.  When reloading chart data, try
restoring to nearest cycle.

Bug: 5289641, 5111701, 5226078
Change-Id: Ic59dee6496c480a64dc56f8534acf4d81b50bca7
2011-09-13 20:24:14 -07:00
Jeff Sharkey
b98c55bd09 Data usage performance, bugfixes.
Optimize launch times by removing unneeded extra work, including
reloading data and tightening chart invalidation.  Fix invalidation
storm when sweeps overlap.  Move chart history into loader instead of
blocking main thread.

Disable "Split 4G" mode until telephony support is ready, and combine
any existing split policies.

Async loading of application details.  Remove alpha transitions to
speed up on some hardware.  Hide menus in detail mode.  Delay kicking
off force-poll.  Fix inset padding on large devices.

Bug: 5284321, 5273918, 5263056
Change-Id: I746d79c05e2a6ea97bbdbdc5d807e208328d1373
2011-09-12 15:48:24 -07:00
Jeff Sharkey
5d70679c02 Larger touch targets, snap to persisted value.
Extend ListView content to screen edges, and use InsetBoundsDrawable
to draw separator and divider with expected padding.  Sweep touch
targets are now much larger.

Snap sweep to persisted value, and fix NFE when parsing label value.

Bug: 5274249
Bug: 5262865
Bug: 5242857
Change-Id: Ifa0f3e622767d5b4dc85a73d6340207e6038a429
2011-09-08 19:02:31 -07:00
Jeff Sharkey
28130d9638 Unify data/power layout, confirm disable, round.
Share consistent layout between data usage and battery usage.  Show
confirmation dialog before disabling mobile data.  Round warning/limit
sweep values to match displayed label.  Suppress fade when switching
data usage tabs.

Bug: 5208510, 5058157, 5038589, 5252816
Change-Id: I3c76f3397445d2d3b173666a41672871df4c61af
2011-09-02 16:15:25 -07:00
Jeff Sharkey
55d18a57e4 Data usage UI fixes; sweeps, combined history.
Fix sweep z-order so that limit are always above inspection range,
and draw shadows behind sweep labels.  Narrower margins for sweeps
with labels; push labels to keep from overlapping.

Generous touch targets on sweeps, and delegate touches to neighboring
sweep if nearer.  Refresh sweep layout during axis zoom, and don't
allow zoom below default minimum.  Let inspection sweeps move beyond
valid data ranges.  Draw less-frequent tick marks when working with
large axis ranges.

Remove Wi-Fi policies but continue showing historical data.  Write
NetworkPolicy if modified during read, and snapshot when async write
requested.

Handle combined UID histories for "Android OS."

Bug: 5191421, 5092579, 5225988, 5221101, 5221065, 5221005, 5150906, 5058025
Change-Id: Id51652e8a10bb90e1345f7a8af01bd70cb8ac677
2011-08-28 16:34:25 -07:00
Jeff Sharkey
b654cbb896 More TabWidget and padding tweaks to match spec.
Also fix NPE in UserDictionarySettings.

Bug: 5184822
Change-Id: I082981c3bcf9b1e6575dcf9f42495a17f0ec8672
2011-08-18 15:30:17 -07:00
Jeff Sharkey
131f9d6e0f Allow data usage policy on Wi-Fi networks.
Create NetworkPolicy when it doesn't already exist.

Bug: 4646471, 5085110
Change-Id: I38b8b03689710df06d1734a4b4d9e12d98794154
2011-08-18 12:01:29 -07:00
Jeff Sharkey
30dde0f5a0 Reinforce limited networks in data usage UI.
When restricting background data, list the networks the restriction
applies to.

Bug: 5131685, 5058106
Change-Id: Idde084dfa5ac6313a8d145cb6f2603aedb154590
2011-08-18 12:01:15 -07:00
Jeff Sharkey
54d0af57fd Foreground/background network stats pie chart.
Load foreground/background network stats, showing combined in chart
series, and also separated in pie chart.  Padding to match spec,
updated action bar tabs, and limit width for wide devices.  Also
clear UI options for requesting fragments.  Move to action bar
overflow menu instead of custom icon.  Show detail chart data outside
current inspection range.

Bug: 5106163, 5143670, 5163064, 5162671, 5148713, 5129036, 5096626
Change-Id: I548fef209e1f714f70ee6bf7098dbdb881692df4
2011-08-15 15:49:38 -07:00
Jeff Sharkey
d39c6e4083 Data usage app icons and details, chart labels.
Add app icons into both summary list and details pane. Also show list
of all applications merged under a UID. Draw dates on chart axis, and
avoid flashing policy sweeps when switching networks in detail mode.

Bug: 5087283, 5038812
Change-Id: I1dcd03ca85b517f8726452af8a46b4be9b3d20f1
2011-08-04 21:20:03 -07:00
Jeff Sharkey
1ae43f922a Data usage disabled state, smaller parcels.
Hide policy controls when low-level bandwidth controls are disabled
or when radio is disabled.  Only request byte counters from history
to reduce parcel size by about 60%.

Bug: 5096903, 5096752
Change-Id: I407b7a01bf60b7105994052cc6e3262054f51184
2011-08-03 17:20:45 -07:00
Jeff Sharkey
e2afc0f283 Data usage axis grow/shrink, other fixes.
When dragging vertical sweeps near edges, grow or shrink axis scale
to give users access to larger limits.  Triggers 10% for each 250ms
that user continues holding.  Change axis math to support arbitrary
ranges beyond [0,5GB].

Show "empty" message when no application details found.  Added strings
that didn't appear in default language.  Better sweep margins using
dip instead of scale units.  Format time ranges in local time instead
of UTC.  Only show dashed estimate when it would reach near warning
or limit.  Extend app usage series until "now" when buckets missing.

Bug: 5096685, 5092538, 5058158, 5058114, 5058024, 4643457
Change-Id: I45cf33f7f3baeba1bfa5b21f31cb0a12006f62fa
2011-08-01 16:36:38 -07:00
Jeff Sharkey
d360e5efaa Data usage fit and finish.
Show time range and data summary based on current sweep selection for
both network and app details.  Fix animations by opting-out of parent
hierarchy animation, since it fights with ListView.

Switch to using NPMS "restrict background" instead of overloading
setBackgroundDataSetting(), and hide app background checkbox when
global background is restricted.

Limit sweeps to valid historical data, and activate sweeps on touch
instead of requiring separate tap.  Fix z-order and avoid animating
sweeps.  Align all elements along vertical edge, and fix item layout
to handle long app title.

Bug: 4979025, 5058107, 5038590, 5079887, 5058108, 5058026, 5037381
Change-Id: Ib45b61ff2a62303f47aa3f47f88d2e688fe4d076
2011-07-27 21:11:39 -07:00
Jeff Sharkey
271ec8a8f8 Move data over-limit dialog, reset policy snooze.
Moved over-limit dialog to SystemUI, and followed Intent changes
to read full NetworkTemplate.  When mutating NetworkPolicy, always
reset any snooze.

Bug: 5057979, 4723336
Change-Id: I9a975eb4ced2f4020c2fe74af67625541cbfcd85
2011-07-27 09:31:51 -07:00
Jeff Sharkey
2412b0f248 Data usage app bars, draw estimated cycle usage.
Show application list with normalized percentage data usage as
horizontal bar chart.  Draw estimated usage for remainder of cycle
to reinforce log scale, and break out received/sent when showing app
details.

Bug: 5038591, 4948713, 4818025
Change-Id: Ib71e73d4f692adc7fe8ae87edd0cec2a8f3976d3
2011-07-17 20:31:54 -07:00
Jeff Sharkey
9549e9f377 More data usage radio combinations, testing.
Offer Ethernet data when present, and better handling of devices
with various radio combinations.  Include "setprop" to help testing
in future.

Adopt new NetworkTemplate building in framework, and avoid crash
when AsyncTask finishes after Fragment is removed.

Bug: 5026016, 5029874
Change-Id: Ib7ab501d0111b9860a91c248193919663d47f2a2
2011-07-14 20:43:30 -07:00
Jeff Sharkey
518bc9df8b Data usage app labels and system clustering.
Cluster all non-applications under single "Android OS" label, and
correctly label uninstalled applications.  Match API changes that now
return correct historical usage around current time.

Bug: 4975314, 4691901
Change-Id: Icec1c54ff3404e1525878516b0a438f757dcb758
2011-07-12 20:20:46 -07:00
Jeff Sharkey
ebae659fc7 Migrate to refactored NetworkStats API.
Change-Id: I76452a67b74df873c88cb9092188e5e4ba83b991
2011-07-12 13:53:11 -07:00
Jeff Sharkey
398b18fca7 Force poll on data usage launch.
When lauching data usage, force NetworkStatsService poll to update
with recent data.  Also move UID summary data to Loader pattern.

Bug: 4515856
Change-Id: Ia8c70d8d0c863da3b8e956e4066d4f69fba30473
2011-07-10 18:56:48 -07:00
Jeff Sharkey
9fab0da184 Roaming and background controls under data usage.
Add action items to control mobile data roaming and background data
controls, along with dialogs to confirm.  Still need to fix telephony
to watch for Settings.Secure changes.

Hide "Change cycle" item when viewing app details.  Handle special
case where data usage doesn't want split action bar.

Bug: 4818009, 4979025, 4948767, 5010948
Change-Id: I363ff76a9daf2528d81573cf8d0687719d664bb0
2011-07-09 17:52:42 -07:00
Jeff Sharkey
2af35fb44d Fix animation bugs, stop disabled sweep touches.
Change sweep drawables to crossfade correctly between states, and
work around 4946591 by nesting container one level deeper.  Also wait
until first layout pass is finished before applying LayoutTransition.

Prevent touches from reaching sweeps when chart is disabled.  Also
bring back log scale for data.

Change-Id: I2194714ab075fd32525681119f30427c1b96fc50
2011-06-24 23:11:51 -07:00
Jeff Sharkey
f54f435f1f More data usage chart iteration, app details.
Moved app details back into single Fragment to support animations and
template tabs.  Show the network in background behind app details
chart series to match designs.

Clamping sweeps at axis boundaries.

Bug: 4813014, 4598460, 4818029
Change-Id: I72c0b21ee1d595e4da31d293ae0dab9e801041f3
2011-06-23 22:30:05 -07:00
Jeff Sharkey
52c3f4461b Iterate on data usage chart UI.
Switched to inflating chart views from XML, using attributes for
configuration.  Start using drawable assets for chart components
instead of manually painting.  Include hand-cut assets, and animate
between states when touched to invoke.

Clamp sweeps to valid chart ranges and prepare for sweep labels.

Bug: 4768483, 4598460
Change-Id: Ic660c35bec826eb5e3f6a1dde3cc04d8c437ef2b
2011-06-23 00:39:47 -07:00
Jeff Sharkey
29d56b303f Detect radios in data usage, control them.
Teach data usage to inspect hardware radios to determine which tabs
and options to display.  Control "Mobile data enabled" state through
ConnectivityManager.  Persist "Show Wi-Fi" state.

Bug: 4599714, 4645276, 4620024, 4599271, 4596812
Change-Id: I4479593d74a8ba744a056767422f1e03182a7a94
2011-06-20 17:23:43 -07:00
Jeff Sharkey
827fde31e8 Match NetworkStatsService refactoring.
Change-Id: Ia5c7fa6e60dd1915939437c859af696fb01498bc
2011-06-19 21:59:01 -07:00
Jeff Sharkey
a662e4975b NetworkTemplate refactoring for data stats.
To match framework changes.

Change-Id: I0f648ae5753149f9774c8096540834451ba41279
2011-06-18 22:22:29 -07:00
Jeff Sharkey
1a3e41d629 Refactor network policy: paid to metered.
Also bind policy checkbox correctly.

Bug: 4691427
Change-Id: Ib05b39c391bf59582106afff5599d62a04c3c75b
2011-06-17 13:39:33 -07:00
Jeff Sharkey
dd6efe17e0 Handle data warning/limit notification actions.
Respond to user interaction with data warning/limit notifications
shown by NetworkPolicyManager.  Show correct tab for the template that
triggered notification.  When data is disabled, prompt user with
dialog and option to re-enable.

Change-Id: I73aeecc0e840fffa2b4cdb90af269115ed0ab56c
2011-06-15 10:31:49 -07:00
Jeff Sharkey
aa5260e40a Load app usage on background thread.
Since stats service loads as needed, this may touch disk, and should
run on background thread.

Change-Id: I1d1d2583250314efa4d3d8f4faa9016c746c29d0
2011-06-14 23:28:03 -07:00
Jeff Sharkey
8e911d7b1a Data usage app labels, protect system, hide empty.
Derive better labels from PackageManager, including for sharedUid
case.  Disable "App settings" button when no ResolveInfo found, and
hide "Restrict" checkbox for system UIDs.  Also hide apps with 0
bytes usage.

Change-Id: I4b0a66f6912c02c56bfcbcb5b46f3ae2ba0df504
2011-06-14 22:45:58 -07:00
Jeff Sharkey
4c72ae5e3d Cycle day editor and other confirmation dialogs.
Create dialog to edit "cycle day" when data usage resets.  Also added
dialogs to confirm enabling limit and restricting an application.

Change-Id: I1e08b17fabd1fcfc2f260807a61435d0ff1a8627
2011-06-14 16:32:06 -07:00
Jeff Sharkey
94a9095eac Read network policy earlier, fix ugly scrollbar.
Read policy before creating options menu, so we correctly populate
checkboxes.  Also clean up Preference views so we don't crash when
returning from app details.

Change-Id: I52c38a3016ea669e27b325bfb6ae1620d2a5ca53
2011-06-13 22:31:09 -07:00
Jeff Sharkey
4dfa66001d First pass at detailed app data usage, policy.
Fragment to show application data usage details, including chart with
inspection ranges.  Button that invokes ACTION_MANAGE_NETWORK_USAGE
towards application, and UID-specific policy controls.  Fragment is
launched when clicking list items from data usage summary page.

Change-Id: Ie1564aa8af98e1a7083817a997059a5a7b1caa50
2011-06-13 00:42:22 -07:00
Jeff Sharkey
05cc0cc4a6 Modifier to combine/split mobile network policy.
Create NetworkPolicyModifier which knows about which mobile network
policies can coexist.  Settings UI uses this modifier to drive UI and
persist policies.

Change-Id: Ib3f3841b0a74c14eefb99209dd644a2e7b7e525d
2011-06-12 23:11:40 -07:00
Jeff Sharkey
8a50364a71 Iterating on data usage; tabs, scrolling, cycles.
Added ActionBar items to control complexity of data surfaced; checked
state causes tabs to be shown/hidden for "Mobile", "2G-3G", "4G", and
"Wi-Fi" network templates.  Loading historical stats and policy from
system services based on selected tab.

Change entire body under tabs to scroll, treating network options and
chart as ListView headers.  Teach chart sweep to disable intercept to
play with ListView, and draw sweep disabled as dashed line.  Hijacking
Preference views for toggles to offer consistency.  No policy updates
are persisted yet.

Based on available historical network stats and policy cycle reset day,
build list of user-selectable cycles.  Wired up chart to display cycle
data and reset inspection region to last week of available data.

Change-Id: Ia561578276fa23908b745fbc06a6ef828d9ccc2e
2011-06-10 16:17:21 -07:00
Jeff Sharkey
ab2d8d3a38 Checkpoint of data usage UI, graphs and lists.
Chart of network usage over time, with draggable "sweep" bars for
inspection region and warning/limits.  Talks with NetworkStatsService
for live data, and updates list of application usage as inspection
region changes.

Change-Id: I2a406e6776daf7d74143c07ec683c10fe711c277
2011-06-09 09:26:30 -07:00