Offset 1, 232 lines modifiedOffset 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·18 .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·114 ····.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·v016 ····.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·124 ····.line·5
19 ····invoke-direct·{p0,·p1,·p2},·Landroidx/work/impl/constraints/trackers/BroadcastReceiverConstraintTracker;-><init>(Landroid/content/Context;Landroidx/work/impl/utils/taskexecutor/TaskExecutor;)V25 ····iput-object·p4,·p0,·Lcom/android/textclassifier/common/ModelFileManager$RegularFilePatternMatchLister;->isEnabled:Lcom/google/common/base/Supplier;
  
20 ····return-void26 ····return-void
21 .end·method27 .end·method
  
  
22 #·virtual·methods28 #·virtual·methods
23 .method·public·getInitialState()Ljava/lang/Object;29 .method·public·list(Ljava/lang/String;)Ljava/util/List;
24 ····.locals·530 ····.locals·7
  
25 ····.line·131 ····.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;)V33 ····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,·0x035 ····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·p038 ····move-result-object·p0
  
 39 ····goto/16·:goto_2
34 ····const/4·v0,·0x0 
  
35 ····if-nez·p0,·:cond_0 
  
36 ····.line·340 ····.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;)V45 ····check-cast·v0,·Ljava/lang/Boolean;
  
43 ····goto·:goto_046 ····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·449 ····.line·4
48 ····invoke-virtual·{p0,·v2,·v1},·Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I50 ····invoke-static·{},·Lcom/google/common/collect/ImmutableList;->of()Lcom/google/common/collect/ImmutableList;
  
49 ····move-result·v251 ····move-result-object·p0
  
50 ····const-string·v3,·"level"52 ····goto·:goto_2
  
51 ····.line·553 ····.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,·0x156 ····invoke-virtual·{v0},·Ljava/io/File;->isDirectory()Z
  
62 ····if-eq·v2,·p0,·:cond_157 ····move-result·v0
  
63 ····const·v2,·0x3e19999a····#·0.15f58 ····if-nez·v0,·:cond_2
  
64 ····cmpl-float·v1,·v1,·v259 ····.line·6
 60 ····invoke-static·{},·Lcom/google/common/collect/ImmutableList;->of()Lcom/google/common/collect/ImmutableList;
  
65 ····if-lez·v1,·:cond_261 ····move-result-object·p0
  
 62 ····goto·:goto_2
66 ····:cond_1 
67 ····move·v0,·p0 
  
68 ····.line·763 ····.line·7
69 ····:cond_264 ····: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>()V68 ····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·373 ····.line·9
85 ····invoke-virtual·{p0,·v0},·Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V74 ····:cond_3
 75 ····sget·v1,·Lcom/google/common/collect/ImmutableList;->$r8$clinit:I
  
86 ····return-object·p0 
87 .end·method76 ····.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·179 ····.line·11
91 ····invoke-virtual·{p2},·Landroid/content/Intent;->getAction()Ljava/lang/String;80 ····array-length·v2,·v0
  
92 ····move-result-object·p181 ····const/4·v3,·0x0
  
93 ····if-nez·p1,·:cond_082 ····:goto_0
 83 ····if-ge·v3,·v2,·:cond_6
  
94 ····return-void84 ····aget-object·v4,·v0,·v3
  
95 ····.line·285 ····.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·p187 ····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,·0x189 ····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·v293 ····move-result·v5
  
104 ····const/4·v3,·0x094 ····if-eqz·v5,·:cond_5
  
105 ····aput-object·v2,·v1,·v395 ····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·v198 ····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;)V103 ····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·p1107 ····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;)Z112 ····move-result-object·v5
  
117 ····move-result·p2113 ····invoke-virtual·{v4},·Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
  
118 ····if-nez·p2,·:cond_2114 ····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;)Z116 ····invoke-virtual·{v5},·Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  
121 ····move-result·p1117 ····move-result-object·v4
  
122 ····if-nez·p1,·:cond_1118 ····sget-boolean·v5,·Lcom/android/textclassifier/common/base/TcLog;->ENABLE_FULL_LOGGING:Z
  
123 ····goto·:goto_0119 ····const-string·v5,·"androidtc"
  
124 ····.line·4120 ····.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;)V122 ····:cond_5
 123 ····:goto_1
 124 ····add-int/lit8·v3,·v3,·0x1
  
128 ····goto·:goto_0125 ····goto·:goto_0
  
129 ····.line·5126 ····.line·17
130 ····:cond_2127 ····: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;)V129 ····move-result-object·p0
  
133 ····:goto_0130 ····:goto_2
134 ····return-void131 ····return-object·p0
135 .end·method132 .end·method