DisplayManagerCompat.java
2.73 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
package android.support.v4.hardware.display;
import android.content.Context;
import android.hardware.display.DisplayManager;
import android.os.Build.VERSION;
import android.view.Display;
import android.view.WindowManager;
import java.util.WeakHashMap;
public abstract class DisplayManagerCompat
{
public static final String DISPLAY_CATEGORY_PRESENTATION = "android.hardware.display.category.PRESENTATION";
private static final WeakHashMap<Context, DisplayManagerCompat> a = new WeakHashMap();
public static DisplayManagerCompat getInstance(Context paramContext)
{
synchronized (a)
{
DisplayManagerCompat localDisplayManagerCompat = (DisplayManagerCompat)a.get(paramContext);
Object localObject = localDisplayManagerCompat;
if (localDisplayManagerCompat == null)
{
if (Build.VERSION.SDK_INT >= 17)
{
localObject = new a(paramContext);
a.put(paramContext, localObject);
}
}
else {
return (DisplayManagerCompat)localObject;
}
localObject = new b(paramContext);
}
}
public abstract Display getDisplay(int paramInt);
public abstract Display[] getDisplays();
public abstract Display[] getDisplays(String paramString);
static final class a
extends DisplayManagerCompat
{
private final Object a;
public a(Context paramContext)
{
this.a = paramContext.getSystemService("display");
}
public final Display getDisplay(int paramInt)
{
return ((DisplayManager)this.a).getDisplay(paramInt);
}
public final Display[] getDisplays()
{
return ((DisplayManager)this.a).getDisplays();
}
public final Display[] getDisplays(String paramString)
{
return ((DisplayManager)this.a).getDisplays(paramString);
}
}
static final class b
extends DisplayManagerCompat
{
private final WindowManager a;
public b(Context paramContext)
{
this.a = ((WindowManager)paramContext.getSystemService("window"));
}
public final Display getDisplay(int paramInt)
{
Display localDisplay = this.a.getDefaultDisplay();
if (localDisplay.getDisplayId() == paramInt) {
return localDisplay;
}
return null;
}
public final Display[] getDisplays()
{
return new Display[] { this.a.getDefaultDisplay() };
}
public final Display[] getDisplays(String paramString)
{
if (paramString == null) {
return getDisplays();
}
return new Display[0];
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/hardware/display/DisplayManagerCompat.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/