| | | |
Offset 1, 232 lines modified | Offset 1, 220 lines modified |
1 | .class·public·Landroidx/work/impl/constraints/trackers/BatteryNotLowTracker; | |
2 | .super·Landroidx/work/impl/constraints/trackers/BroadcastReceiverConstraintTracker; | |
3 | .source·"BatteryNotLowTracker.java" | 1 | .class·public·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister; |
| 2 | .super·Ljava/lang/Object; |
| 3 | .source·"ModelFileManager.java" |
| |
| 4 | #·interfaces |
| 5 | .implements·Lcom/android/textclassifier/common/ModelFileManager$ModelFileLister; |
| |
4 | #·static·fields | |
5 | .field·private·static·final·TAG:Ljava/lang/String; | |
| |
| 6 | #·instance·fields |
| 7 | .field·private·final·fileNamePattern:Ljava/util/regex/Pattern; |
| |
6 | #·direct·methods | |
7 | .method·static·constructor·<clinit>()V | |
8 | ····.locals·1 | 8 | .field·private·final·folder:Ljava/io/File; |
| |
| 9 | .field·private·final·isEnabled:Lcom/google/common/base/Supplier; |
| |
| 10 | .field·private·final·modelType:Ljava/lang/String; |
| |
9 | ····const-string·v0,·"BatteryNotLowTracker" | |
| 11 | #·direct·methods |
| 12 | .method·public·constructor·<init>(Ljava/lang/String;Ljava/io/File;Ljava/lang/String;Lcom/google/common/base/Supplier;)V |
| 13 | ····.locals·0 |
| |
10 | ····.line·1 | 14 | ····.line·1 |
11 | ····invoke-static·{v0},·Landroidx/work/Logger$LogcatLogger;->tagWithPrefix(Ljava/lang/String;)Ljava/lang/String; | 15 | ····invoke-direct·{p0},·Ljava/lang/Object;-><init>()V |
| |
12 | ····move-result-object·v0 | 16 | ····.line·2 |
| 17 | ····iput-object·p1,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->modelType:Ljava/lang/String; |
| |
| 18 | ····.line·3 |
| 19 | ····iput-object·p2,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->folder:Ljava/io/File; |
| |
13 | ····sput-object·v0,·Landroidx/work/impl/constraints/trackers/BatteryNotLowTracker;->TAG:Ljava/lang/String; | 20 | ····.line·4 |
| 21 | ····invoke-static·{p3},·Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern; |
| |
| 22 | ····move-result-object·p1 |
14 | ····return-void | |
15 | .end·method | |
| |
| 23 | ····iput-object·p1,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->fileNamePattern:Ljava/util/regex/Pattern; |
16 | .method·public·constructor·<init>(Landroid/content/Context;Landroidx/work/impl/utils/taskexecutor/TaskExecutor;)V | |
17 | ····.locals·0 | |
| |
18 | ····.line·1 | 24 | ····.line·5 |
19 | ····invoke-direct·{p0,·p1,·p2},·Landroidx/work/impl/constraints/trackers/BroadcastReceiverConstraintTracker;-><init>(Landroid/content/Context;Landroidx/work/impl/utils/taskexecutor/TaskExecutor;)V | 25 | ····iput-object·p4,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->isEnabled:Lcom/google/common/base/Supplier; |
| |
20 | ····return-void | 26 | ····return-void |
21 | .end·method | 27 | .end·method |
| |
| |
22 | #·virtual·methods | 28 | #·virtual·methods |
23 | .method·public·getInitialState()Ljava/lang/Object; | 29 | .method·public·list(Ljava/lang/String;)Ljava/util/List; |
24 | ····.locals·5 | 30 | ····.locals·7 |
| |
25 | ····.line·1 | 31 | ····.line·1 |
| 32 | ····iget-object·v0,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->modelType:Ljava/lang/String; |
26 | ····new-instance·v0,·Landroid/content/IntentFilter; | |
| |
27 | ····const-string·v1,·"android.intent.action.BATTERY_CHANGED" | |
| |
28 | ····invoke-direct·{v0,·v1},·Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V | 33 | ····invoke-virtual·{v0,·p1},·Ljava/lang/String;->equals(Ljava/lang/Object;)Z |
| |
| 34 | ····move-result·v0 |
29 | ····.line·2 | |
30 | ····iget-object·p0,·p0,·Landroidx/work/impl/constraints/trackers/ConstraintTracker;->mAppContext:Landroid/content/Context; | |
| |
31 | ····const/4·v1,·0x0 | 35 | ····if-nez·v0,·:cond_0 |
| |
32 | ····invoke-virtual·{p0,·v1,·v0},·Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent; | 36 | ····.line·2 |
| 37 | ····invoke-static·{},·Lcom/google/common/collect/ImmutableList;->of()Lcom/google/common/collect/ImmutableList; |
| |
33 | ····move-result-object·p0 | 38 | ····move-result-object·p0 |
| |
| 39 | ····goto/16·:goto_2 |
34 | ····const/4·v0,·0x0 | |
| |
35 | ····if-nez·p0,·:cond_0 | |
| |
36 | ····.line·3 | 40 | ····.line·3 |
| 41 | ····:cond_0 |
| 42 | ····iget-object·v0,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->isEnabled:Lcom/google/common/base/Supplier; |
37 | ····invoke-static·{},·Landroidx/work/Logger$LogcatLogger;->get()Landroidx/work/Logger$LogcatLogger; | |
| |
38 | ····move-result-object·p0 | |
| |
39 | ····sget-object·v2,·Landroidx/work/impl/constraints/trackers/BatteryNotLowTracker;->TAG:Ljava/lang/String; | |
| |
40 | ····new-array·v0,·v0,·[Ljava/lang/Throwable; | 43 | ····invoke-interface·{v0},·Lcom/google/common/base/Supplier;->get()Ljava/lang/Object; |
| |
41 | ····const-string·v3,·"getInitialState·-·null·intent·received" | 44 | ····move-result-object·v0 |
| |
42 | ····invoke-virtual·{p0,·v2,·v3,·v0},·Landroidx/work/Logger$LogcatLogger;->error(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V | 45 | ····check-cast·v0,·Ljava/lang/Boolean; |
| |
43 | ····goto·:goto_0 | 46 | ····invoke-virtual·{v0},·Ljava/lang/Boolean;->booleanValue()Z |
| |
| 47 | ····move-result·v0 |
44 | ····:cond_0 | |
45 | ····const/4·v1,·-0x1 | |
| |
46 | ····const-string·v2,·"status" | 48 | ····if-nez·v0,·:cond_1 |
| |
47 | ····.line·4 | 49 | ····.line·4 |
48 | ····invoke-virtual·{p0,·v2,·v1},·Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I | 50 | ····invoke-static·{},·Lcom/google/common/collect/ImmutableList;->of()Lcom/google/common/collect/ImmutableList; |
| |
49 | ····move-result·v2 | 51 | ····move-result-object·p0 |
| |
50 | ····const-string·v3,·"level" | 52 | ····goto·:goto_2 |
| |
51 | ····.line·5 | 53 | ····.line·5 |
| 54 | ····:cond_1 |
| 55 | ····iget-object·v0,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->folder:Ljava/io/File; |
52 | ····invoke-virtual·{p0,·v3,·v1},·Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I | |
| |
53 | ····move-result·v3 | |
| |
54 | ····const-string·v4,·"scale" | |
| |
55 | ····.line·6 | |
56 | ····invoke-virtual·{p0,·v4,·v1},·Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I | |
| |
57 | ····move-result·p0 | |
| |
58 | ····int-to-float·v1,·v3 | |
| |
59 | ····int-to-float·p0,·p0 | |
| |
60 | ····div-float/2addr·v1,·p0 | |
| |
61 | ····const/4·p0,·0x1 | 56 | ····invoke-virtual·{v0},·Ljava/io/File;->isDirectory()Z |
| |
62 | ····if-eq·v2,·p0,·:cond_1 | 57 | ····move-result·v0 |
| |
63 | ····const·v2,·0x3e19999a····#·0.15f | 58 | ····if-nez·v0,·:cond_2 |
| |
64 | ····cmpl-float·v1,·v1,·v2 | 59 | ····.line·6 |
| 60 | ····invoke-static·{},·Lcom/google/common/collect/ImmutableList;->of()Lcom/google/common/collect/ImmutableList; |
| |
65 | ····if-lez·v1,·:cond_2 | 61 | ····move-result-object·p0 |
| |
| 62 | ····goto·:goto_2 |
66 | ····:cond_1 | |
67 | ····move·v0,·p0 | |
| |
68 | ····.line·7 | 63 | ····.line·7 |
69 | ····:cond_2 | 64 | ····:cond_2 |
| 65 | ····iget-object·v0,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->folder:Ljava/io/File; |
70 | ····invoke-static·{v0},·Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean; | |
| |
71 | ····move-result-object·v1 | |
| |
72 | ····:goto_0 | |
73 | ····return-object·v1 | |
74 | .end·method | |
| |
| 66 | ····invoke-virtual·{v0},·Ljava/io/File;->listFiles()[Ljava/io/File; |
75 | .method·public·getIntentFilter()Landroid/content/IntentFilter; | |
76 | ····.locals·1 | |
| |
| 67 | ····move-result-object·v0 |
77 | ····.line·1 | |
78 | ····new-instance·p0,·Landroid/content/IntentFilter; | |
| |
79 | ····invoke-direct·{p0},·Landroid/content/IntentFilter;-><init>()V | 68 | ····if-nez·v0,·:cond_3 |
| |
80 | ····const-string·v0,·"android.intent.action.BATTERY_OKAY" | 69 | ····.line·8 |
| 70 | ····invoke-static·{},·Lcom/google/common/collect/ImmutableList;->of()Lcom/google/common/collect/ImmutableList; |
| |
| 71 | ····move-result-object·p0 |
81 | ····.line·2 | |
82 | ····invoke-virtual·{p0,·v0},·Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V | |
| |
83 | ····const-string·v0,·"android.intent.action.BATTERY_LOW" | 72 | ····goto·:goto_2 |
| |
84 | ····.line·3 | 73 | ····.line·9 |
85 | ····invoke-virtual·{p0,·v0},·Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V | 74 | ····:cond_3 |
| 75 | ····sget·v1,·Lcom/google/common/collect/ImmutableList;->$r8$clinit:I |
| |
86 | ····return-object·p0 | |
87 | .end·method | 76 | ····.line·10 |
| 77 | ····new-instance·v1,·Lcom/google/common/collect/ImmutableList$Builder; |
| |
| 78 | ····invoke-direct·{v1},·Lcom/google/common/collect/ImmutableList$Builder;-><init>()V |
88 | .method·public·onBroadcastReceive(Landroid/content/Context;Landroid/content/Intent;)V | |
89 | ····.locals·4 | |
| |
90 | ····.line·1 | 79 | ····.line·11 |
91 | ····invoke-virtual·{p2},·Landroid/content/Intent;->getAction()Ljava/lang/String; | 80 | ····array-length·v2,·v0 |
| |
92 | ····move-result-object·p1 | 81 | ····const/4·v3,·0x0 |
| |
93 | ····if-nez·p1,·:cond_0 | 82 | ····:goto_0 |
| 83 | ····if-ge·v3,·v2,·:cond_6 |
| |
94 | ····return-void | 84 | ····aget-object·v4,·v0,·v3 |
| |
95 | ····.line·2 | 85 | ····.line·12 |
| 86 | ····iget-object·v5,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->fileNamePattern:Ljava/util/regex/Pattern; |
96 | ····:cond_0 | |
97 | ····invoke-static·{},·Landroidx/work/Logger$LogcatLogger;->get()Landroidx/work/Logger$LogcatLogger; | |
| |
98 | ····move-result-object·p1 | 87 | ····invoke-virtual·{v4},·Ljava/io/File;->getName()Ljava/lang/String; |
| |
99 | ····sget-object·v0,·Landroidx/work/impl/constraints/trackers/BatteryNotLowTracker;->TAG:Ljava/lang/String; | 88 | ····move-result-object·v6 |
| |
100 | ····const/4·v1,·0x1 | 89 | ····invoke-virtual·{v5,·v6},·Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher; |
| |
101 | ····new-array·v1,·v1,·[Ljava/lang/Object; | 90 | ····move-result-object·v5 |
| |
102 | ····invoke-virtual·{p2},·Landroid/content/Intent;->getAction()Ljava/lang/String; | 91 | ····.line·13 |
| 92 | ····invoke-virtual·{v5},·Ljava/util/regex/Matcher;->matches()Z |
| |
103 | ····move-result-object·v2 | 93 | ····move-result·v5 |
| |
104 | ····const/4·v3,·0x0 | 94 | ····if-eqz·v5,·:cond_5 |
| |
105 | ····aput-object·v2,·v1,·v3 | 95 | ····invoke-virtual·{v4},·Ljava/io/File;->isFile()Z |
| |
106 | ····const-string·v2,·"Received·%s" | 96 | ····move-result·v5 |
| |
107 | ····invoke-static·{v2,·v1},·Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; | 97 | ····if-nez·v5,·:cond_4 |
| |
108 | ····move-result-object·v1 | 98 | ····goto·:goto_1 |
| |
109 | ····new-array·v2,·v3,·[Ljava/lang/Throwable; | 99 | ····.line·14 |
| 100 | ····:cond_4 |
| 101 | ····:try_start_0 |
| 102 | ····invoke-static·{v4,·p1},·Lcom/android/textclassifier/common/ModelFileManager$ModelFile;->createFromRegularFile(Ljava/io/File;Ljava/lang/String;)Lcom/android/textclassifier/common/ModelFileManager$ModelFile; |
| |
110 | ····invoke-virtual·{p1,·v0,·v1,·v2},·Landroidx/work/Logger$LogcatLogger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V | 103 | ····move-result-object·v5 |
| |
111 | ····.line·3 | |
112 | ····invoke-virtual·{p2},·Landroid/content/Intent;->getAction()Ljava/lang/String; | 104 | ····invoke-virtual·{v1,·v5},·Lcom/google/common/collect/ImmutableList$Builder;->add(Ljava/lang/Object;)Lcom/google/common/collect/ImmutableList$Builder; |
| 105 | ····:try_end_0 |
| 106 | ····.catch·Ljava/io/IOException;·{:try_start_0·..·:try_end_0}·:catch_0 |
| |
113 | ····move-result-object·p1 | 107 | ····goto·:goto_1 |
| |
114 | ····invoke-static·{p1},·Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object; | 108 | ····:catch_0 |
| 109 | ····const-string·v5,·"Failed·to·call·createFromRegularFile·with:·" |
| |
115 | ····const-string·p2,·"android.intent.action.BATTERY_OKAY" | 110 | ····.line·15 |
| 111 | ····invoke-static·{v5},·Landroid/ext/services/notification/Assistant$$ExternalSyntheticOutline0;->m(Ljava/lang/String;)Ljava/lang/StringBuilder; |
| |
116 | ····invoke-virtual·{p1,·p2},·Ljava/lang/String;->equals(Ljava/lang/Object;)Z | 112 | ····move-result-object·v5 |
| |
117 | ····move-result·p2 | 113 | ····invoke-virtual·{v4},·Ljava/io/File;->getAbsolutePath()Ljava/lang/String; |
| |
118 | ····if-nez·p2,·:cond_2 | 114 | ····move-result-object·v4 |
| |
119 | ····const-string·p2,·"android.intent.action.BATTERY_LOW" | 115 | ····invoke-virtual·{v5,·v4},·Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
| |
120 | ····invoke-virtual·{p1,·p2},·Ljava/lang/String;->equals(Ljava/lang/Object;)Z | 116 | ····invoke-virtual·{v5},·Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
| |
121 | ····move-result·p1 | 117 | ····move-result-object·v4 |
| |
122 | ····if-nez·p1,·:cond_1 | 118 | ····sget-boolean·v5,·Lcom/android/textclassifier/common/base/TcLog;->ENABLE_FULL_LOGGING:Z |
| |
123 | ····goto·:goto_0 | 119 | ····const-string·v5,·"androidtc" |
| |
124 | ····.line·4 | 120 | ····.line·16 |
| 121 | ····invoke-static·{v5,·v4},·Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I |
125 | ····:cond_1 | |
126 | ····sget-object·p1,·Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean; | |
| |
127 | ····invoke-virtual·{p0,·p1},·Landroidx/work/impl/constraints/trackers/ConstraintTracker;->setState(Ljava/lang/Object;)V | 122 | ····:cond_5 |
| 123 | ····:goto_1 |
| 124 | ····add-int/lit8·v3,·v3,·0x1 |
| |
128 | ····goto·:goto_0 | 125 | ····goto·:goto_0 |
| |
129 | ····.line·5 | 126 | ····.line·17 |
130 | ····:cond_2 | 127 | ····:cond_6 |
131 | ····sget-object·p1,·Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean; | 128 | ····invoke-virtual·{v1},·Lcom/google/common/collect/ImmutableList$Builder;->build()Lcom/google/common/collect/ImmutableList; |
| |
132 | ····invoke-virtual·{p0,·p1},·Landroidx/work/impl/constraints/trackers/ConstraintTracker;->setState(Ljava/lang/Object;)V | 129 | ····move-result-object·p0 |
| |
133 | ····:goto_0 | 130 | ····:goto_2 |
134 | ····return-void | 131 | ····return-object·p0 |
135 | .end·method | 132 | .end·method |