Avoid NPE when template rapidly switched.
Monkeys can race and end up swapping template before the dialog is shown. Bug: 16660160 Change-Id: I301784d707ee3998c38cf2874f7016a5c5350825
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user