Initial commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package androidx.legacy.content;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.PowerManager;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class WakefulBroadcastReceiver extends BroadcastReceiver {
|
||||
private static final SparseArray<PowerManager.WakeLock> a = new SparseArray<>();
|
||||
private static int b = 1;
|
||||
|
||||
public static boolean a(Intent intent) {
|
||||
int intExtra = intent.getIntExtra("androidx.contentpager.content.wakelockid", 0);
|
||||
if (intExtra == 0) {
|
||||
return false;
|
||||
}
|
||||
synchronized (a) {
|
||||
PowerManager.WakeLock wakeLock = a.get(intExtra);
|
||||
if (wakeLock != null) {
|
||||
wakeLock.release();
|
||||
a.remove(intExtra);
|
||||
return true;
|
||||
}
|
||||
Log.w("WakefulBroadcastReceiv.", "No active wake lock id #" + intExtra);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static ComponentName b(Context context, Intent intent) {
|
||||
synchronized (a) {
|
||||
int i = b;
|
||||
b++;
|
||||
if (b <= 0) {
|
||||
b = 1;
|
||||
}
|
||||
intent.putExtra("androidx.contentpager.content.wakelockid", i);
|
||||
ComponentName startService = context.startService(intent);
|
||||
if (startService == null) {
|
||||
return null;
|
||||
}
|
||||
PowerManager.WakeLock newWakeLock = ((PowerManager) context.getSystemService("power")).newWakeLock(1, "androidx.core:wake:" + startService.flattenToShortString());
|
||||
newWakeLock.setReferenceCounted(false);
|
||||
newWakeLock.acquire(60000L);
|
||||
a.put(i, newWakeLock);
|
||||
return startService;
|
||||
}
|
||||
}
|
||||
}
|
47
sources/androidx/legacy/widget/Space.java
Normal file
47
sources/androidx/legacy/widget/Space.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package androidx.legacy.widget;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public class Space extends View {
|
||||
@Deprecated
|
||||
public Space(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
if (getVisibility() == 0) {
|
||||
setVisibility(4);
|
||||
}
|
||||
}
|
||||
|
||||
private static int a(int i, int i2) {
|
||||
int mode = View.MeasureSpec.getMode(i2);
|
||||
int size = View.MeasureSpec.getSize(i2);
|
||||
return mode != Integer.MIN_VALUE ? (mode == 0 || mode != 1073741824) ? i : size : Math.min(i, size);
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
@SuppressLint({"MissingSuperCall"})
|
||||
@Deprecated
|
||||
public void draw(Canvas canvas) {
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
@Deprecated
|
||||
protected void onMeasure(int i, int i2) {
|
||||
setMeasuredDimension(a(getSuggestedMinimumWidth(), i), a(getSuggestedMinimumHeight(), i2));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Space(Context context, AttributeSet attributeSet) {
|
||||
this(context, attributeSet, 0);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Space(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user