This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void registerScanResultsCallback (Executor executor, | |
WifiManager.ScanResultsCallback callback); | |
public List<ScanResult> getScanResults (); | |
public void unregisterScanResultsCallback (WifiManager.ScanResultsCallback callback); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest> | |
<!-- Grants the READ_PHONE_STATE permission only on devices that run | |
Android 10 (API level 29) and lower. --> | |
<uses-permission android:name="READ_PHONE_STATE" | |
android:maxSdkVersion="29" /> | |
<uses-permission android:name="READ_PHONE_NUMBERS" /> | |
</manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Set<Set<String>> getConcurrentCameraIds (); | |
public boolean isConcurrentSessionConfigurationSupported (Map<String, SessionConfiguration> cameraIdAndSessionConfig); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suspend fun fetchUser(): User { | |
return GlobalScope.async(Dispatchers.IO) { | |
// make network call | |
}.await() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest> | |
... | |
<service ... | |
android:foregroundServiceType="location|camera|microphone" /> | |
</manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var locationManager: CLLocationManager = { | |
let locationManager = CLLocationManager() | |
locationManager.delegate = self | |
locationManager.allowsBackgroundLocationUpdates = true | |
return locationManager | |
}() | |
var region:CLBeaconRegion { | |
let region = CLBeaconRegion(proximityUUID: uuid, identifier: identifier) | |
region.notifyEntryStateOnDisplay = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
For BLUETOOTH scans. | |
Create CBCentralManager class element and call its method for scanning Bluetooth devices. | |
Here is the function declaration | |
*/ | |
func scanForPeripherals(withServices serviceUUIDs: [CBUUID]?, options: [String : Any]? = nil) | |
/* | |
For BEACONS scan. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
For BLUETOOTH scans. | |
Create CBCentralManager class element and call its method for scanning Bluetooth devices. | |
Here is the function declaration | |
*/ | |
func scanForPeripherals(withServices serviceUUIDs: [CBUUID]?, options: [String : Any]? = nil) | |
/* | |
For BEACONS scan. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getWiFiName() -> String? { | |
var ssid: String? | |
if let interfaces = CNCopySupportedInterfaces() as NSArray? { | |
for interface in interfaces { | |
if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? { | |
ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String | |
break | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final Intent[] POWERMANAGER_INTENTS = { | |
new Intent().setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity")), | |
new Intent().setComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.AutobootManageActivity")), | |
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity")), | |
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity")), | |
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity")), | |
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity")), | |
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startupapp.Startup |