ActivityCompat.java
9.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
package android.support.v4.app;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.IntentSender.SendIntentException;
import android.content.pm.PackageManager;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.net.Uri;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.view.View;
import java.util.List;
import java.util.Map;
public class ActivityCompat
extends ContextCompat
{
private static ActivityCompatApi21.SharedElementCallback21 a(SharedElementCallback paramSharedElementCallback)
{
a locala = null;
if (paramSharedElementCallback != null) {
locala = new a(paramSharedElementCallback);
}
return locala;
}
private static ActivityCompatApi23.SharedElementCallback23 b(SharedElementCallback paramSharedElementCallback)
{
b localb = null;
if (paramSharedElementCallback != null) {
localb = new b(paramSharedElementCallback);
}
return localb;
}
public static void finishAffinity(Activity paramActivity)
{
if (Build.VERSION.SDK_INT >= 16)
{
paramActivity.finishAffinity();
return;
}
paramActivity.finish();
}
public static void finishAfterTransition(Activity paramActivity)
{
if (Build.VERSION.SDK_INT >= 21)
{
paramActivity.finishAfterTransition();
return;
}
paramActivity.finish();
}
@Nullable
public static Uri getReferrer(Activity paramActivity)
{
if (Build.VERSION.SDK_INT >= 22) {
paramActivity = paramActivity.getReferrer();
}
Intent localIntent;
Uri localUri;
do
{
return paramActivity;
localIntent = paramActivity.getIntent();
localUri = (Uri)localIntent.getParcelableExtra("android.intent.extra.REFERRER");
paramActivity = localUri;
} while (localUri != null);
paramActivity = localIntent.getStringExtra("android.intent.extra.REFERRER_NAME");
if (paramActivity != null) {
return Uri.parse(paramActivity);
}
return null;
}
public static boolean invalidateOptionsMenu(Activity paramActivity)
{
if (Build.VERSION.SDK_INT >= 11)
{
paramActivity.invalidateOptionsMenu();
return true;
}
return false;
}
public static void postponeEnterTransition(Activity paramActivity)
{
if (Build.VERSION.SDK_INT >= 21) {
paramActivity.postponeEnterTransition();
}
}
public static void requestPermissions(@NonNull final Activity paramActivity, @NonNull String[] paramArrayOfString, @IntRange(from=0L) final int paramInt)
{
if (Build.VERSION.SDK_INT >= 23)
{
if ((paramActivity instanceof ActivityCompatApi23.RequestPermissionsRequestCodeValidator)) {
((ActivityCompatApi23.RequestPermissionsRequestCodeValidator)paramActivity).validateRequestPermissionsRequestCode(paramInt);
}
paramActivity.requestPermissions(paramArrayOfString, paramInt);
}
while (!(paramActivity instanceof OnRequestPermissionsResultCallback)) {
return;
}
new Handler(Looper.getMainLooper()).post(new Runnable()
{
public final void run()
{
int[] arrayOfInt = new int[this.a.length];
PackageManager localPackageManager = paramActivity.getPackageManager();
String str = paramActivity.getPackageName();
int j = this.a.length;
int i = 0;
while (i < j)
{
arrayOfInt[i] = localPackageManager.checkPermission(this.a[i], str);
i += 1;
}
((ActivityCompat.OnRequestPermissionsResultCallback)paramActivity).onRequestPermissionsResult(paramInt, this.a, arrayOfInt);
}
});
}
public static void setEnterSharedElementCallback(Activity paramActivity, SharedElementCallback paramSharedElementCallback)
{
if (Build.VERSION.SDK_INT >= 23) {
paramActivity.setEnterSharedElementCallback(ActivityCompatApi23.a(b(paramSharedElementCallback)));
}
while (Build.VERSION.SDK_INT < 21) {
return;
}
paramActivity.setEnterSharedElementCallback(ActivityCompatApi21.a(a(paramSharedElementCallback)));
}
public static void setExitSharedElementCallback(Activity paramActivity, SharedElementCallback paramSharedElementCallback)
{
if (Build.VERSION.SDK_INT >= 23) {
paramActivity.setExitSharedElementCallback(ActivityCompatApi23.a(b(paramSharedElementCallback)));
}
while (Build.VERSION.SDK_INT < 21) {
return;
}
paramActivity.setExitSharedElementCallback(ActivityCompatApi21.a(a(paramSharedElementCallback)));
}
public static boolean shouldShowRequestPermissionRationale(@NonNull Activity paramActivity, @NonNull String paramString)
{
if (Build.VERSION.SDK_INT >= 23) {
return paramActivity.shouldShowRequestPermissionRationale(paramString);
}
return false;
}
public static void startActivityForResult(Activity paramActivity, Intent paramIntent, int paramInt, @Nullable Bundle paramBundle)
{
if (Build.VERSION.SDK_INT >= 16)
{
paramActivity.startActivityForResult(paramIntent, paramInt, paramBundle);
return;
}
paramActivity.startActivityForResult(paramIntent, paramInt);
}
public static void startIntentSenderForResult(Activity paramActivity, IntentSender paramIntentSender, int paramInt1, Intent paramIntent, int paramInt2, int paramInt3, int paramInt4, @Nullable Bundle paramBundle)
throws IntentSender.SendIntentException
{
if (Build.VERSION.SDK_INT >= 16)
{
paramActivity.startIntentSenderForResult(paramIntentSender, paramInt1, paramIntent, paramInt2, paramInt3, paramInt4, paramBundle);
return;
}
paramActivity.startIntentSenderForResult(paramIntentSender, paramInt1, paramIntent, paramInt2, paramInt3, paramInt4);
}
public static void startPostponedEnterTransition(Activity paramActivity)
{
if (Build.VERSION.SDK_INT >= 21) {
paramActivity.startPostponedEnterTransition();
}
}
public static abstract interface OnRequestPermissionsResultCallback
{
public abstract void onRequestPermissionsResult(int paramInt, @NonNull String[] paramArrayOfString, @NonNull int[] paramArrayOfInt);
}
static final class a
extends ActivityCompatApi21.SharedElementCallback21
{
private SharedElementCallback a;
public a(SharedElementCallback paramSharedElementCallback)
{
this.a = paramSharedElementCallback;
}
public final Parcelable onCaptureSharedElementSnapshot(View paramView, Matrix paramMatrix, RectF paramRectF)
{
return this.a.onCaptureSharedElementSnapshot(paramView, paramMatrix, paramRectF);
}
public final View onCreateSnapshotView(Context paramContext, Parcelable paramParcelable)
{
return this.a.onCreateSnapshotView(paramContext, paramParcelable);
}
public final void onMapSharedElements(List<String> paramList, Map<String, View> paramMap)
{
this.a.onMapSharedElements(paramList, paramMap);
}
public final void onRejectSharedElements(List<View> paramList)
{
this.a.onRejectSharedElements(paramList);
}
public final void onSharedElementEnd(List<String> paramList, List<View> paramList1, List<View> paramList2)
{
this.a.onSharedElementEnd(paramList, paramList1, paramList2);
}
public final void onSharedElementStart(List<String> paramList, List<View> paramList1, List<View> paramList2)
{
this.a.onSharedElementStart(paramList, paramList1, paramList2);
}
}
static final class b
extends ActivityCompatApi23.SharedElementCallback23
{
private SharedElementCallback a;
public b(SharedElementCallback paramSharedElementCallback)
{
this.a = paramSharedElementCallback;
}
public final Parcelable onCaptureSharedElementSnapshot(View paramView, Matrix paramMatrix, RectF paramRectF)
{
return this.a.onCaptureSharedElementSnapshot(paramView, paramMatrix, paramRectF);
}
public final View onCreateSnapshotView(Context paramContext, Parcelable paramParcelable)
{
return this.a.onCreateSnapshotView(paramContext, paramParcelable);
}
public final void onMapSharedElements(List<String> paramList, Map<String, View> paramMap)
{
this.a.onMapSharedElements(paramList, paramMap);
}
public final void onRejectSharedElements(List<View> paramList)
{
this.a.onRejectSharedElements(paramList);
}
public final void onSharedElementEnd(List<String> paramList, List<View> paramList1, List<View> paramList2)
{
this.a.onSharedElementEnd(paramList, paramList1, paramList2);
}
public final void onSharedElementStart(List<String> paramList, List<View> paramList1, List<View> paramList2)
{
this.a.onSharedElementStart(paramList, paramList1, paramList2);
}
public final void onSharedElementsArrived(List<String> paramList, List<View> paramList1, final ActivityCompatApi23.OnSharedElementsReadyListenerBridge paramOnSharedElementsReadyListenerBridge)
{
this.a.onSharedElementsArrived(paramList, paramList1, new SharedElementCallback.OnSharedElementsReadyListener()
{
public final void onSharedElementsReady()
{
paramOnSharedElementsReadyListenerBridge.onSharedElementsReady();
}
});
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/app/ActivityCompat.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/