OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.physicalweb; | 5 package org.chromium.chrome.browser.physicalweb; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.content.res.Resources; | 9 import android.content.res.Resources; |
10 import android.os.Build; | 10 import android.os.Build; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 boolean isOnboarding = PhysicalWeb.isOnboarding(); | 128 boolean isOnboarding = PhysicalWeb.isOnboarding(); |
129 | 129 |
130 int prerequisitesResult = Utils.RESULT_SUCCESS; | 130 int prerequisitesResult = Utils.RESULT_SUCCESS; |
131 if (!isSdkVersionCorrect | 131 if (!isSdkVersionCorrect |
132 || !isDataConnectionActive | 132 || !isDataConnectionActive |
133 || bluetoothStatus == Utils.RESULT_FAILURE | 133 || bluetoothStatus == Utils.RESULT_FAILURE |
134 || !isLocationServicesEnabled | 134 || !isLocationServicesEnabled |
135 || !isLocationPermissionGranted | 135 || !isLocationPermissionGranted |
136 || !isPreferenceEnabled) { | 136 || !isPreferenceEnabled) { |
137 prerequisitesResult = Utils.RESULT_FAILURE; | 137 prerequisitesResult = Utils.RESULT_FAILURE; |
138 mLaunchButton.setEnabled(false); | |
139 | |
MuVen
2016/10/19 11:36:46
NIT: Remove this extra line.
billyjay
2016/10/19 11:59:31
Done.
| |
138 } else if (bluetoothStatus == Utils.RESULT_INDETERMINATE) { | 140 } else if (bluetoothStatus == Utils.RESULT_INDETERMINATE) { |
139 prerequisitesResult = Utils.RESULT_INDETERMINATE; | 141 prerequisitesResult = Utils.RESULT_INDETERMINATE; |
142 mLaunchButton.setEnabled(false); | |
140 } | 143 } |
141 | 144 |
145 | |
MuVen
2016/10/19 11:36:46
NIT: Remove this extra line.
billyjay
2016/10/19 11:59:31
Done.
| |
142 sb.append("<h2>Status</h2>"); | 146 sb.append("<h2>Status</h2>"); |
143 | 147 |
144 sb.append("Physical Web is "); | 148 sb.append("Physical Web is "); |
145 appendResult(sb, prerequisitesResult != Utils.RESULT_FAILURE, "ON", "OFF "); | 149 appendResult(sb, prerequisitesResult != Utils.RESULT_FAILURE, "ON", "OFF "); |
146 | 150 |
147 sb.append("<h2>Prerequisites</h2>"); | 151 sb.append("<h2>Prerequisites</h2>"); |
148 | 152 |
149 sb.append("Android SDK version: "); | 153 sb.append("Android SDK version: "); |
150 appendResult(sb, isSdkVersionCorrect, "Compatible", "Incompatible"); | 154 appendResult(sb, isSdkVersionCorrect, "Compatible", "Incompatible"); |
151 | 155 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 | 221 |
218 private static Intent createListUrlsIntent() { | 222 private static Intent createListUrlsIntent() { |
219 return new Intent(ContextUtils.getApplicationContext(), ListUrlsActivity .class) | 223 return new Intent(ContextUtils.getApplicationContext(), ListUrlsActivity .class) |
220 .putExtra(ListUrlsActivity.REFERER_KEY, ListUrlsActivity.DIAGNOS TICS_REFERER); | 224 .putExtra(ListUrlsActivity.REFERER_KEY, ListUrlsActivity.DIAGNOS TICS_REFERER); |
221 } | 225 } |
222 | 226 |
223 private static String colorToHexValue(int color) { | 227 private static String colorToHexValue(int color) { |
224 return "#" + Integer.toHexString(color & 0x00ffffff); | 228 return "#" + Integer.toHexString(color & 0x00ffffff); |
225 } | 229 } |
226 } | 230 } |
OLD | NEW |