File tree Expand file tree Collapse file tree 4 files changed +18
-8
lines changed
java/com/lcl/lclmeasurementtool Expand file tree Collapse file tree 4 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ protected void onCreate(Bundle savedInstanceState) {
44
44
45
45
46
46
47
- NetworkManager mNetworkManager = new NetworkManager (this );
47
+ mNetworkManager = new NetworkManager (this );
48
48
mCellularManager = CellularManager .getManager (this );
49
49
50
50
if (!mNetworkManager .isCellularConnected ()) {
Original file line number Diff line number Diff line change @@ -135,14 +135,23 @@ public void removeAllNetworkChangeListeners() {
135
135
* @return true if the current device is connected to the internet via cellular; false otherwise.
136
136
*/
137
137
public boolean isCellularConnected () {
138
- return capabilities .hasTransport (NetworkCapabilities .TRANSPORT_CELLULAR );
138
+ return capabilities != null &&
139
+ capabilities .hasTransport (NetworkCapabilities .TRANSPORT_CELLULAR );
139
140
}
140
141
141
142
public int getLinkDownstreamBandwidthKbps () {
142
- return this .capabilities .getLinkDownstreamBandwidthKbps ();
143
+ if (capabilities != null ) {
144
+ return capabilities .getLinkDownstreamBandwidthKbps ();
145
+ }
146
+
147
+ return 0 ;
143
148
}
144
149
145
150
public int getLinkUpstreamBandwidthKbps () {
146
- return this .capabilities .getLinkUpstreamBandwidthKbps ();
151
+ if (capabilities != null ) {
152
+ return this .capabilities .getLinkUpstreamBandwidthKbps ();
153
+ }
154
+
155
+ return 0 ;
147
156
}
148
157
}
Original file line number Diff line number Diff line change 74
74
android : text =" Signal Strength"
75
75
android : textAlignment =" center"
76
76
android : textColor =" @color/white"
77
- android : textSize =" 16sp "
77
+ android : textSize =" 14sp "
78
78
android : typeface =" monospace"
79
79
app : layout_constraintBottom_toBottomOf =" parent"
80
80
app : layout_constraintStart_toEndOf =" @+id/imageView"
84
84
android : id =" @+id/SignalStrengthValue"
85
85
android : layout_width =" wrap_content"
86
86
android : layout_height =" wrap_content"
87
- android : layout_marginStart =" 36dp "
87
+ android : layout_marginStart =" 24dp "
88
88
android : fontFamily =" monospace"
89
89
android : textColor =" @color/white"
90
90
android : textSize =" 16sp"
125
125
android : layout_width =" wrap_content"
126
126
android : layout_height =" wrap_content"
127
127
android : layout_marginStart =" 2dp"
128
- android : layout_marginEnd =" 12dp "
128
+ android : layout_marginEnd =" 8dp "
129
129
app : layout_constraintBottom_toBottomOf =" parent"
130
130
app : layout_constraintEnd_toEndOf =" parent"
131
131
app : layout_constraintStart_toEndOf =" @id/SignalStrengthStatus"
Original file line number Diff line number Diff line change 11
11
<item name =" colorSecondaryVariant" >@color/teal_700</item >
12
12
<item name =" colorOnSecondary" >@color/black</item >
13
13
<!-- Status bar color. -->
14
- <item name =" android:statusBarColor" tools : targetApi =" l" >?attr/statusBarBackground</item >
14
+ <item name =" android:statusBarColor" tools : targetApi =" 22" >?attr/statusBarBackground</item >
15
+ <item name =" android:navigationBarColor" tools : targetApi =" 22" >@color/dark_black</item >
15
16
<!-- Customize your theme here. -->
16
17
</style >
17
18
You can’t perform that action at this time.
0 commit comments