am c44e33e1: am dc16286f: Merge "Avoid NPE when template rapidly switched." into lmp-dev

* commit 'c44e33e1a03a2b5e92db9329981885da35fe0ab8':
  Avoid NPE when template rapidly switched.
This commit is contained in:
Jeff Sharkey
2014-08-08 17:41:54 +00:00
committed by Android Git Automerger

View File

@@ -1791,10 +1791,12 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
public static void show(DataUsageSummary parent) {
if (!parent.isAdded()) return;
final NetworkPolicy policy = parent.mPolicyEditor.getPolicy(parent.mTemplate);
if (policy == null) return;
final Resources res = parent.getResources();
final CharSequence message;
final long minLimitBytes = (long) (
parent.mPolicyEditor.getPolicy(parent.mTemplate).warningBytes * 1.2f);
final long minLimitBytes = (long) (policy.warningBytes * 1.2f);
final long limitBytes;
// TODO: customize default limits based on network template