use of com.android.wifitrackerlib.SavedNetworkTracker in project android_packages_apps_Settings by omnirom.
the class SavedAccessPointsWifiSettings2 method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Context context = getContext();
mWorkerThread = new HandlerThread(TAG + "{" + Integer.toHexString(System.identityHashCode(this)) + "}", Process.THREAD_PRIORITY_BACKGROUND);
mWorkerThread.start();
final Clock elapsedRealtimeClock = new SimpleClock(ZoneOffset.UTC) {
@Override
public long millis() {
return SystemClock.elapsedRealtime();
}
};
mSavedNetworkTracker = new SavedNetworkTracker(getSettingsLifecycle(), context, context.getSystemService(WifiManager.class), context.getSystemService(ConnectivityManager.class), context.getSystemService(NetworkScoreManager.class), new Handler(Looper.getMainLooper()), mWorkerThread.getThreadHandler(), elapsedRealtimeClock, MAX_SCAN_AGE_MILLIS, SCAN_INTERVAL_MILLIS, this);
}
use of com.android.wifitrackerlib.SavedNetworkTracker in project android_packages_apps_Settings by omnirom.
the class WifiNetworkListFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final Context context = getContext();
mWifiManager = context.getSystemService(WifiManager.class);
mSaveListener = new WifiManager.ActionListener() {
@Override
public void onSuccess() {
// Do nothing.
}
@Override
public void onFailure(int reason) {
final Activity activity = getActivity();
if (activity != null && !activity.isFinishing()) {
Toast.makeText(activity, R.string.wifi_failed_save_message, Toast.LENGTH_SHORT).show();
}
}
};
mWorkerThread = new HandlerThread(TAG + "{" + Integer.toHexString(System.identityHashCode(this)) + "}", Process.THREAD_PRIORITY_BACKGROUND);
mWorkerThread.start();
final Clock elapsedRealtimeClock = new SimpleClock(ZoneOffset.UTC) {
@Override
public long millis() {
return SystemClock.elapsedRealtime();
}
};
mSavedNetworkTracker = new SavedNetworkTracker(getSettingsLifecycle(), context, context.getSystemService(WifiManager.class), context.getSystemService(ConnectivityManager.class), context.getSystemService(NetworkScoreManager.class), new Handler(Looper.getMainLooper()), mWorkerThread.getThreadHandler(), elapsedRealtimeClock, MAX_SCAN_AGE_MILLIS, SCAN_INTERVAL_MILLIS, this);
}
Aggregations