Commit Graph

123 Commits

Author SHA1 Message Date
László Dávid
0b8bf4ea86 Call to equals() comparing different types
I have found this bug with the FindBugs tool

Change-Id: I7f157063b0a549cb4344c048ddb612a14a915a25
Signed-off-by: László Dávid <laszlo.david@gmail.com>
2012-10-24 23:31:47 +02:00
Guang Zhu
167ba2af93 Prevent sync state changes when user is a monkey
Bug: 7385019

Change-Id: Icf305683e57b83b3260f2587ae0a3d1a6dc3c21d
2012-10-22 11:37:31 -07:00
Amith Yamasani
9627a8ea15 Show more settings and add restrictions/dialogs for secondary users
Bug: 7213029 crash in About>Status
Bug: 7212495 hide System updates for second user
Bug: 7212230 nickname editor should select the text
Bug: 7160487 TTS settings
Bug: 7129411 Settings needs visibility changes for secondary users

Change-Id: Ia2d1229c08b392edfa6b671fce4a382410405b14
2012-09-23 18:43:31 -07:00
Jeff Sharkey
fda48e39d3 Always show auto-sync; user-specific storage.
Auto-sync is per-user, so show it to all users.  Also create user-
specific path when showing misc storage items.

Bug: 7179485, 7177335
Change-Id: I9f6029e22d519a5516a0f1a76e6aa55db3c2832c
2012-09-18 15:09:35 -07:00
Jeff Sharkey
38305fb177 Data usage multi-user support.
Switch to storing policy per-user instead of per-app, meaning each
user has control over their own set of apps.  Summarize the usage of
non-current users.  Only allow owner to make changes to overall
network policy.

Hide auto-sync menu when viewing app details.  Search for
MANAGE_NETWORK_USAGE intent across all package names sharing a UID.

Bug: 7121279, 5419594, 6978663
Change-Id: Ia70f04df70d27da27faccb947cd27021c628a41a
2012-09-14 22:43:51 -07:00
Christopher Tate
5a64c739bf Update Settings app to manipulate now-global settings properly
Change-Id: I6c269051c7d2db87f70f44df74e06456588c3b6f
2012-09-07 13:35:31 -07:00
Dianne Hackborn
bb06a427eb Rename UserId to UserHandle.
Change-Id: I04b86f3777c28fb83f03eb404dd5c2eb18d3da8f
2012-08-16 12:47:09 -07:00
Wink Saville
5543404ae0 Use telephony-common
Change-Id: Ic95136fd5934afdd53a08bfd640d40add67fdb44
2012-07-11 15:08:15 -07:00
Amith Yamasani
665235f6ef Save the auto-sync dialog state for orientation changes
Bug: 6630421
Change-Id: I11447173483da499e23c5ce41c566fa988385e6b
2012-06-07 19:58:34 -07:00
Amith Yamasani
d1ab82807a Account types at toplevel of Settings
Reorganized Account settings to show account types at the top-level
of Settings. Only account types that have accounts added are visible
here. There is an Add account button to add a new account.

Master sync toggle has moved to Data Usage screen in the overflow menu.
It shows additional detail of the function of the auto-sync toggle when
it is toggled by the user.

Account type screen (ManageAccountsSettings) shows list of accounts of
that type and any available authenticator settings. It additionally
verifies any Intents can be resolved before showing the corresponding
entry. This screen now shows last synced time for each account.

You can now sync all accounts of a type by selecting Sync now in the
Account type screen.

Account Sync screen that shows the list of syncable items has minor
tweaks:
 - "Last synced...", "Sync is OFF"
 - Doesn't show the authenticator settings here anymore.

Bug: 6579937

Change-Id: I8139a4c992b525a3e1efc24d2d223c3f5caddc76
2012-06-04 17:01:22 -07:00
Jeff Sharkey
d878909980 Surface metered networks as "Mobile hotspots."
String changes to give clearer definition of metered networks, and
remove metered control for mobile network.  Also fix NPE when testing
hasEthernet() before session is ready.

Bug: 6494976
Change-Id: Ia55ca3362a05977b9f21ab41eb10bbc738e29620
2012-05-29 11:03:55 -07:00
Jeff Sharkey
b67c4a8e73 Only show ethernet when traffic has occurred.
Bug: 6231172
Change-Id: I24dfd5f998b4e96681813c9fd7ce1ed74cf30eb5
2012-05-24 11:01:29 -07:00
Jeff Sharkey
3da415f19b Avoid NPE until we understand better.
Bug: 6450986
Change-Id: I68af8fedc419cd3142ba2bb7530b77aca7718123
2012-05-18 14:00:10 -07:00
Jeff Sharkey
02b327e7f2 Clear references after Data Usage View removed.
Bug: 6450986
Change-Id: Ia28479983fc192cbeefb16b8ce03f67241e4002c
2012-05-15 11:33:59 -07:00
Jeff Sharkey
92811829b3 Avoid animation flashing and fix padding.
Bug: 6446203
Change-Id: Icea64d5d30d894a6438af9278bc2d10b8b921d29
2012-05-04 11:54:31 -07:00
Jeff Sharkey
0bc5b93fe2 Fall back to Wi-Fi data when SIM missing.
Bug: 6427657
Change-Id: I0613b4b89ddbea1cde2fd96ce6dd4bacb0fb4eaa
2012-05-03 15:02:06 -07:00
Jeff Sharkey
a20ec538e5 Merge "Fix data usage settings button visibility." 2012-04-24 11:36:38 -07:00
Jeff Sharkey
d92e0419b1 Fix data usage settings button visibility.
Also check that fragment is attached before launching intent.

Bug: 6385040
Change-Id: If857758acbf6fe17c8ffbd75226114346ffe6c62
2012-04-24 11:35:43 -07:00
Amith Yamasani
b0b37ae21c Help menus for several screens.
Bug: 5144896
Change-Id: Ib2f5146f6f62f2a33261bb165c3bf1bf13b22f38
2012-04-23 15:35:36 -07:00
Jeff Sharkey
34e964dcff Hide tab when disabled, metered strings, fixes.
Hide "Data usage" item when kernel support isn't available and
enabled.  Change "restrict background" strings to reflect metered
status.  Hide app settings button when no package found.  Always
start limit sweep above any warning.  Imply metered state for
networks with limits.

Bug: 6303364, 5465643, 5379686, 6376276, 6368329, 6376276
Change-Id: I4faccc9a50f2f741fd937bb8c361a3ca055135e2
2012-04-21 15:41:48 -07:00
Jeff Sharkey
e557c3349e Show data restricted apps, unify strings.
Always show apps with background data restricted, even when not
used in selected time period.  Combine measurement disclaimer into
single string, and only show for mobile networks.  Unify limit
dialog string.

Bug: 6007276, 5505010, 5495020, 5456087
Change-Id: I0ec307b330838dc9528d7e63e0ac1edd14ba122c
2012-04-13 19:45:02 -07:00
Jeff Sharkey
ad17de32bc Hide body immediately when no tabs.
Also check for valid SIM card when checking 4G radio status.

Bug: 6311752
Change-Id: Ic148f052429cc66bb51237bdc93c09f7c8ba3df1
2012-04-11 11:03:25 -07:00
Jeff Sharkey
76c5ed4f35 Migrate to @Override to remove warnings.
Bug: 6303344

Change-Id: I8f17edc3b12d50cedab2c5f555c63bc07d85bca2
2012-04-09 10:57:29 -07:00
Jeff Sharkey
08ce99e224 Move to INetworkStatsSession with lifecycle.
Explicitly communicate lifecycle, enabling system_server to cache
stats when actively being used.

Bug: 6236498
Change-Id: Ieecc4b1d4fd46aeb5207c4ba9b450e04e9438d00
2012-04-06 11:47:25 -07:00
Jeff Sharkey
313f7d8c57 Controls to set expensive (metered) networks.
Add UI to change metered flag on NetworkPolicy, and support Wi-Fi
policies per-SSID.  Create Wi-Fi policies as needed, but leave cycle
undefined.

Only show and mutate mobile policies when SIM state is ready.

Bug: 3001465, 3291052
Change-Id: I481a202fe0e68fc2f5adfd3b3a6f40347d2b168c
2012-04-05 14:31:43 -07:00
Jeff Sharkey
ef6e1ff728 Cluster apps by user in Data Usage.
When displaying apps that have used data, cluster all app usage
together regardless of profile/user.  Always persist policy rules
using primary UID (the UID under the default user).

Bug: 6140462
Change-Id: Ia00bb42b26987553926f4027583dbe03b3bafba1
2012-03-22 11:10:45 -07:00
Jeff Sharkey
3235ddb7aa Avoid Data Usage AppDetailsFragment ISE.
Bug: 6022913
Change-Id: I4672b327096add4beeeb52f0bb467622b3467fcf
2012-03-15 16:40:31 -07:00
Jeff Sharkey
e5223a0577 Save timezone when setting data cycle reset date.
Bug: 5938567
Change-Id: I9df8da9d030169952098efc04cfde79e3e42e1f8
2012-03-09 18:24:01 -08:00
Jeff Sharkey
f3871fb2b2 Linear bytes scale, time ticks on first week day.
Move bytes to linear instead of logarithmic scale.  Also render time
ticks on first week day based on locale.  Also enable testing of
specific IMSI through setprop.

Bug: 5452612, 5829693
Change-Id: I13200cf58a39bfe0ac343e1f83165e899867641b
2012-02-03 19:29:15 -08:00
Jeff Sharkey
77dae91726 Unify shorthand for byte-based units.
Change-Id: I32f998b5ee1f5416c9cceafd124fd34b7433be42
2012-02-03 14:50:33 -08:00
Jean-Baptiste Queru
05eb9852a9 am 43cbe3ff: am b6e57c1f: Merge "Do not set minimum value for mobile data limit dialog higher than the actual set value"
* commit '43cbe3ffb4f0777d8aa833355c523f4a1ff93818':
  Do not set minimum value for mobile data limit dialog higher than the actual set value
2012-01-27 21:09:22 -08:00
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
3038c52de4 Restrict app data on metered networks.
Paired with framework change that no longer requires NetworkPolicy
to have limit when restricting apps.

Bug: 5571454
Change-Id: I2a5d8446a9278afb183e13d0f41f436ccb3bc9e8
2011-12-15 14:03:37 -08: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