Commit Graph

111 Commits

Author SHA1 Message Date
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