Back to project page TTLEditor.
The source code is released under:
Apache License
If you think the Android project TTLEditor listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.segin.ttleditor; /*ww w . jav a2s . com*/ import android.app.IntentService; import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; /* * Copyright 2014 Kirn Gill II <segin2005@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class BootService extends IntentService { public BootService() { super("BootService"); } @Override protected void onHandleIntent(Intent intent) { SharedPreferences myPreference = PreferenceManager.getDefaultSharedPreferences(this); if(myPreference.getBoolean("onboot", false)) { String iface = myPreference.getString("iface", "rmnet_sdio0"); String ttl = myPreference.getString("ttl", "64"); TTLEditor.changeTTL(this.getApplicationContext(), iface, ttl); } } }