| | | |
Offset 1, 20 lines modified | Offset 1, 25 lines modified |
| |
1 | package·com.android.providers.media; | 1 | package·com.android.providers.media; |
| |
2 | import·java.util.Iterator; | 2 | import·android.app.Activity; |
3 | import·java.util.stream.Collector; | 3 | import·java.util.stream.Collector; |
4 | import·java.util.stream.Collectors; | 4 | import·java.util.stream.Collectors; |
5 | import·java.util.function.Predicate; | 5 | import·java.util.function.Predicate; |
6 | import·android.util.Log; | 6 | import·android.util.Log; |
| 7 | import·java.util.Comparator; |
| 8 | import·java.util.function.ToIntFunction; |
7 | import·android.net.Uri; | 9 | import·android.net.Uri; |
8 | import·android.widget.TextView; | 10 | import·android.widget.TextView; |
9 | import·android.text.TextUtils; | 11 | import·android.text.TextUtils; |
10 | import·java.util.ArrayList; | 12 | import·java.util.ArrayList; |
11 | import·java.util.List; | 13 | import·java.util.List; |
| 14 | import·android.graphics.drawable.Drawable; |
| 15 | import·android.graphics.drawable.ColorDrawable; |
| 16 | import·android.widget.ImageView$ScaleType; |
12 | import·android.widget.ImageView; | 17 | import·android.widget.ImageView; |
13 | import·android.content.res.Resources; | 18 | import·android.content.res.Resources; |
14 | import·android.view.View; | 19 | import·android.view.View; |
15 | import·android.os.AsyncTask; | 20 | import·android.os.AsyncTask; |
| |
16 | class·PermissionActivity$DescriptionTask·extends·AsyncTask | 21 | class·PermissionActivity$DescriptionTask·extends·AsyncTask |
17 | { | 22 | { |
Offset 26, 111 lines modified | Offset 31, 131 lines modified |
26 | ····public·PermissionActivity$DescriptionTask(final·PermissionActivity·this$0,·final·View·bodyView)·{ | 31 | ····public·PermissionActivity$DescriptionTask(final·PermissionActivity·this$0,·final·View·bodyView)·{ |
27 | ········this.this$0·=·this$0; | 32 | ········this.this$0·=·this$0; |
28 | ········this.bodyView·=·bodyView; | 33 | ········this.bodyView·=·bodyView; |
29 | ········this.res·=·bodyView.getContext().getResources(); | 34 | ········this.res·=·bodyView.getContext().getResources(); |
30 | ····} | 35 | ····} |
31 | ···· | 36 | ···· |
32 | ····private·void·bindAsFull(final·PermissionActivity$Description·permissionActivity$Description)·{ | 37 | ····private·void·bindAsFull(final·PermissionActivity$Description·permissionActivity$Description)·{ |
33 | ········permissionActivity$Description.bindFull((ImageView)this.bodyView.requireViewById(2131165345)); | 38 | ········final·ImageView·imageView·=·(ImageView)this.bodyView.requireViewById(2131165346); |
| 39 | ········if·(permissionActivity$Description.full·!=·null)·{ |
| 40 | ············permissionActivity$Description.bindFull(imageView); |
| 41 | ········} |
| 42 | ········else·{ |
| 43 | ············imageView.setScaleType(ImageView$ScaleType.FIT_CENTER); |
| 44 | ············imageView.setBackground((Drawable)new·ColorDrawable(((Activity)this.this$0).getColor(2130968662))); |
| 45 | ············permissionActivity$Description.bindMimeIcon(imageView); |
| 46 | ········} |
34 | ····} | 47 | ····} |
35 | ···· | 48 | ···· |
36 | ····private·void·bindAsText(final·List·list)·{ | 49 | ····private·void·bindAsText(final·List·list)·{ |
37 | ········final·ArrayList<CharSequence>·list2·=·new·ArrayList<CharSequence>(); | 50 | ········final·ArrayList<CharSequence>·list2·=·new·ArrayList<CharSequence>(); |
38 | ········for·(int·i·=·0;·i·<·list.size();·++i)·{ | 51 | ········for·(int·i·=·0;·i·<·list.size();·++i)·{ |
39 | ············list2.add(((PermissionActivity$Description)list.get(i)).contentDescription); | 52 | ············list2.add(((PermissionActivity$Description)list.get(i)).contentDescription); |
40 | ············if·(list2.size()·>=·3·&&·list.size()·>·list2.size())·{ | 53 | ············if·(list2.size()·>=·3·&&·list.size()·>·list2.size())·{ |
41 | ················final·int·n·=·list.size()·-·list2.size(); | 54 | ················final·int·n·=·list.size()·-·list2.size(); |
42 | ················list2.add(TextUtils.expandTemplate(this.res.getQuantityText(2131492868,·n),·new·CharSequence[]·{·String.valueOf(n)·})); | 55 | ················list2.add(TextUtils.expandTemplate(this.res.getQuantityText(2131492868,·n),·new·CharSequence[]·{·String.valueOf(n)·})); |
43 | ················break; | 56 | ················break; |
44 | ············} | 57 | ············} |
45 | ········} | 58 | ········} |
46 | ········final·TextView·textView·=·(TextView)this.bodyView.requireViewById(2131165281); | 59 | ········final·TextView·textView·=·(TextView)this.bodyView.requireViewById(2131165282); |
47 | ········textView.setText((CharSequence)TextUtils.join((CharSequence)"\n",·(Iterable)list2)); | 60 | ········textView.setText((CharSequence)TextUtils.join((CharSequence)"\n",·(Iterable)list2)); |
48 | ········textView.setVisibility(0); | 61 | ········textView.setVisibility(0); |
49 | ····} | 62 | ····} |
50 | ···· | 63 | ···· |
51 | ····private·void·bindAsThumbs(final·List·list,·final·List·list2)·{ | 64 | ····private·void·bindAsThumbs(final·List·list,·final·List·list2)·{ |
52 | ········final·ArrayList<ImageView>·list3·=·new·ArrayList<ImageView>(); | 65 | ········final·ArrayList<ImageView>·list3·=·new·ArrayList<ImageView>(); |
53 | ········list3.add((ImageView)this.bodyView.requireViewById(2131165342)); | |
54 | ········list3.add((ImageView)this.bodyView.requireViewById(2131165343)); | 66 | ········list3.add((ImageView)this.bodyView.requireViewById(2131165343)); |
55 | ········list3.add((ImageView)this.bodyView.requireViewById(2131165344)); | 67 | ········list3.add((ImageView)this.bodyView.requireViewById(2131165344)); |
| 68 | ········list3.add((ImageView)this.bodyView.requireViewById(2131165345)); |
56 | ········final·int·size·=·list2.size(); | 69 | ········final·int·size·=·list2.size(); |
57 | ········final·int·size2·=·list.size(); | 70 | ········final·int·size2·=·list.size(); |
58 | ········final·int·n·=·1; | 71 | ········final·int·n·=·1; |
59 | ········int·i·=·0; | 72 | ········int·i·=·0; |
60 | ········int·n2; | 73 | ········int·n2; |
61 | ········if·(size·==·size2·&&·list2.size()·<=·3)·{ | 74 | ········if·(size·==·size2·&&·list2.size()·<=·3)·{ |
62 | ············n2·=·0; | 75 | ············n2·=·0; |
63 | ········} | 76 | ········} |
64 | ········else·{ | 77 | ········else·{ |
65 | ············n2·=·n; | 78 | ············n2·=·n; |
66 | ········} | 79 | ········} |
67 | ········if·(n2·!=·0)·{ | 80 | ········if·(n2·!=·0)·{ |
68 | ············final·View·requireViewById·=·this.bodyView.requireViewById(2131165347); | 81 | ············final·View·requireViewById·=·this.bodyView.requireViewById(2131165348); |
69 | ············final·ImageView·imageView·=·(ImageView)this.bodyView.requireViewById(2131165346); | 82 | ············final·ImageView·imageView·=·(ImageView)this.bodyView.requireViewById(2131165347); |
70 | ············final·TextView·textView·=·(TextView)this.bodyView.requireViewById(2131165348); | 83 | ············final·TextView·textView·=·(TextView)this.bodyView.requireViewById(2131165350); |
| 84 | ············final·View·requireViewById2·=·this.bodyView.requireViewById(2131165349); |
71 | ············list3.remove(0); | 85 | ············list3.remove(0); |
72 | ············list3.add(imageView); | 86 | ············list3.add(imageView); |
73 | ············final·int·n3·=·list.size()·-·Math.min(list2.size(),·2); | 87 | ············final·int·n3·=·list.size()·-·Math.min(list2.size(),·2); |
74 | ············final·CharSequence·quantityText·=·this.res.getQuantityText(2131492869,·n3); | 88 | ············final·CharSequence·quantityText·=·this.res.getQuantityText(2131492869,·n3); |
75 | ············final·CharSequence[]·array·=·new·CharSequence[n]; | 89 | ············final·CharSequence[]·array·=·new·CharSequence[n]; |
76 | ············array[0]·=·String.valueOf(n3); | 90 | ············array[0]·=·String.valueOf(n3); |
77 | ············textView.setText(TextUtils.expandTemplate(quantityText,·array)); | 91 | ············textView.setText(TextUtils.expandTemplate(quantityText,·array)); |
78 | ············requireViewById.setVisibility(0); | 92 | ············requireViewById.setVisibility(0); |
| 93 | ············requireViewById2.setVisibility(0); |
79 | ········} | 94 | ········} |
80 | ········while·(list3.size()·>·list2.size())·{ | 95 | ········while·(list3.size()·>·list2.size())·{ |
81 | ············list3.remove(0); | 96 | ············list3.remove(0); |
82 | ········} | 97 | ········} |
83 | ········while·(i·<·list3.size())·{ | 98 | ········while·(i·<·list3.size())·{ |
84 | ············((PermissionActivity$Description)list2.get(i)).bindThumbnail((ImageView)list3.get(i)); | 99 | ············final·PermissionActivity$Description·permissionActivity$Description·=·(PermissionActivity$Description)list2.get(i); |
| 100 | ············final·ImageView·imageView2·=·(ImageView)list3.get(i); |
| 101 | ············if·(permissionActivity$Description.thumbnail·!=·null)·{ |
| 102 | ················permissionActivity$Description.bindThumbnail(imageView2); |
| 103 | ············} |
| 104 | ············else·{ |
| 105 | ················permissionActivity$Description.bindMimeIcon(imageView2); |
| 106 | ············} |
85 | ············++i; | 107 | ············++i; |
86 | ········} | 108 | ········} |
87 | ····} | 109 | ····} |
88 | ···· | 110 | ···· |
89 | ····protected·List·doInBackground(List...·iterator)·{ | 111 | ····protected·List·doInBackground(List...·iterator)·{ |
90 | ········iterator·=·iterator[0]; | 112 | ········iterator·=·iterator[0]; |
91 | ········final·ArrayList·list·=·new·ArrayList<PermissionActivity$Description>(); | 113 | ········final·ArrayList·list·=·new·ArrayList<PermissionActivity$Description>(); |
92 | ········if·(((List)iterator).isEmpty())·{ | 114 | ········if·(((List)iterator).isEmpty())·{ |
93 | ············return·list; | 115 | ············return·list; |
94 | ········} | 116 | ········} |
95 | ········final·int·size·=·((List)iterator).size(); | 117 | ········final·int·size·=·((List)iterator).size(); |
96 | ········final·boolean·b·=·true; | 118 | ········final·int·n·=·1; |
97 | ········int·n·=·3; | 119 | ········int·n2·=·3; |
98 | ········int·n2; | 120 | ········int·n3; |
99 | ········if·(size·==·(b·?·1·:·0))·{ | 121 | ········if·(size·==·n)·{ |
100 | ············((ImageView)this.bodyView.requireViewById(2131165345)).setVisibility(0); | 122 | ············((ImageView)this.bodyView.requireViewById(2131165346)).setVisibility(0); |
101 | ············n2·=·7; | 123 | ············n3·=·7; |
102 | ········} | 124 | ········} |
103 | ········else·{ | 125 | ········else·{ |
104 | ············((ImageView)this.bodyView.requireViewById(2131165343)).setVisibility(0); | |
105 | ············((ImageView)this.bodyView.requireViewById(2131165344)).setVisibility(0); | 126 | ············((ImageView)this.bodyView.requireViewById(2131165344)).setVisibility(0); |
106 | ············if·(((List)iterator).size()·==·n)·{ | 127 | ············((ImageView)this.bodyView.requireViewById(2131165345)).setVisibility(0); |
107 | ················((ImageView)this.bodyView.requireViewById(2131165342)).setVisibility(0); | 128 | ············if·(((List)iterator).size()·==·n2)·{ |
| 129 | ················((ImageView)this.bodyView.requireViewById(2131165343)).setVisibility(0); |
108 | ············} | 130 | ············} |
109 | ············else·if·(((List)iterator).size()·>·n)·{ | 131 | ············else·if·(((List)iterator).size()·>·n2)·{ |
110 | ················this.bodyView.requireViewById(2131165347).setVisibility(0); | 132 | ················this.bodyView.requireViewById(2131165348).setVisibility(0); |
111 | ············} | 133 | ············} |
112 | ············n2·=·n; | 134 | ············n3·=·n2; |
| 135 | ········} |
| 136 | ········if·(TextUtils.equals((CharSequence)PermissionActivity.access$600(this.this$0),·(CharSequence)"generic")·&&·((List)iterator).size()·>·n)·{ |
| 137 | ············((List<Object>)iterator).sort((Comparator<?·super·Object>)new·-$$Lambda$PermissionActivity$DescriptionTask$byE4X0vuBRjPpFSGsgP-Gw_ItmI((ToIntFunction)-$$Lambda$PermissionActivity$DescriptionTask$82DszBk9KV1YuvIxtc2opZWjU9U.INSTANCE)); |
113 | ········} | 138 | ········} |
114 | ········iterator·=·(Iterator<Uri>)((List<Object>)iterator).iterator(); | 139 | ········iterator·=·((List<Object>)iterator).iterator(); |
115 | ········while·(iterator.hasNext())·{ | 140 | ········while·(iterator.hasNext())·{ |
116 | ············final·Uri·uri·=·(Uri)iterator.next(); | 141 | ············final·Uri·uri·=·(Uri)iterator.next(); |
117 | ············try·{ | 142 | ············try·{ |
118 | ················try·{ | 143 | ················try·{ |
119 | ····················final·View·bodyView·=·this.bodyView; | 144 | ····················final·View·bodyView·=·this.bodyView; |
120 | ····················try·{ | 145 | ····················try·{ |
121 | ························final·PermissionActivity$Description·permissionActivity$Description·=·new·PermissionActivity$Description(bodyView.getContext(),·uri,·n2); | 146 | ························final·PermissionActivity$Description·permissionActivity$Description·=·new·PermissionActivity$Description(bodyView.getContext(),·uri,·n3); |
122 | ························final·ArrayList<PermissionActivity$Description>·list2·=·(ArrayList<PermissionActivity$Description>)list; | 147 | ························final·ArrayList<PermissionActivity$Description>·list2·=·(ArrayList<PermissionActivity$Description>)list; |
123 | ························try·{ | 148 | ························try·{ |
124 | ····························list2.add(permissionActivity$Description); | 149 | ····························list2.add(permissionActivity$Description); |
125 | ····························if·(permissionActivity$Description.isVisual())·{ | 150 | ····························if·(permissionActivity$Description.isVisual())·{ |
126 | ································--n; | 151 | ································--n2; |
127 | ····························} | 152 | ····························} |
128 | ····························if·(n·==·0)·{ | 153 | ····························if·(n2·==·0)·{ |
129 | ································n2·=·0; | 154 | ································n3·=·0; |
130 | ································continue; | 155 | ································continue; |
131 | ····························} | 156 | ····························} |
132 | ····························continue; | 157 | ····························continue; |
133 | ························} | 158 | ························} |
134 | ························catch·(Exception·ex)·{ | 159 | ························catch·(Exception·ex)·{ |
135 | ····························Log.w("MediaProvider",·(Throwable)ex); | 160 | ····························Log.w("MediaProvider",·(Throwable)ex); |
136 | ····························continue; | 161 | ····························continue; |
Offset 155, 10 lines modified | Offset 180, 10 lines modified |
155 | ········} | 180 | ········} |
156 | ········else·if·(!list2.isEmpty())·{ | 181 | ········else·if·(!list2.isEmpty())·{ |
157 | ············this.bindAsThumbs(list,·list2); | 182 | ············this.bindAsThumbs(list,·list2); |
158 | ········} | 183 | ········} |
159 | ········else·{ | 184 | ········else·{ |
160 | ············this.bindAsText(list); | 185 | ············this.bindAsText(list); |
161 | ········} | 186 | ········} |
162 | ········PermissionActivity.access$600(this.this$0).sendAccessibilityEvent(32768); | 187 | ········PermissionActivity.access$700(this.this$0).sendAccessibilityEvent(32768); |
163 | ····} | 188 | ····} |
164 | } | 189 | } |