Fixed some lint errors
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
11
LocationRinger/.settings/org.eclipse.jdt.core.prefs
Normal file
11
LocationRinger/.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.6
|
||||||
@@ -7,26 +7,14 @@
|
|||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="7"
|
android:minSdkVersion="7"
|
||||||
android:targetSdkVersion="14" />
|
android:targetSdkVersion="11" />
|
||||||
|
|
||||||
<uses-feature
|
|
||||||
android:name="android.hardware.location"
|
|
||||||
android:required="true" />
|
|
||||||
<uses-feature
|
|
||||||
android:name="android.hardware.location.gps"
|
|
||||||
android:required="false" />
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
|
|
||||||
@@ -36,7 +24,7 @@
|
|||||||
android:theme="@style/Theme.Custom" >
|
android:theme="@style/Theme.Custom" >
|
||||||
<activity
|
<activity
|
||||||
android:name="LocationRinger"
|
android:name="LocationRinger"
|
||||||
android:configChanges="keyboard|orientation"
|
android:configChanges="keyboard|keyboardHidden|orientation"
|
||||||
android:label="@string/app_name" >
|
android:label="@string/app_name" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -44,12 +32,9 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<uses-library android:name="com.google.android.maps" />
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.RingerInformationActivity"
|
android:name=".ui.RingerInformationActivity"
|
||||||
android:configChanges="keyboard|orientation" />
|
android:configChanges="keyboard|keyboardHidden|orientation" />
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".receivers.SystemReceiver"
|
android:name=".receivers.SystemReceiver"
|
||||||
@@ -96,17 +81,6 @@
|
|||||||
android:name="android.appwidget.provider"
|
android:name="android.appwidget.provider"
|
||||||
android:resource="@xml/updatelocationwidgetinfo" />
|
android:resource="@xml/updatelocationwidgetinfo" />
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name="com.TwentyCodes.android.exception.ExceptionReportActivity"
|
|
||||||
android:configChanges="keyboard|orientation" />
|
|
||||||
<activity
|
|
||||||
android:name="com.TwentyCodes.android.SkyHook.Splash"
|
|
||||||
android:configChanges="keyboard|orientation"
|
|
||||||
android:screenOrientation="portrait" />
|
|
||||||
|
|
||||||
<service android:name="com.TwentyCodes.android.exception.ReportPostingService" />
|
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".receivers.PassiveLocationChangedReceiver"
|
android:name=".receivers.PassiveLocationChangedReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ android.library.reference.2=../../location_library/LocationLib
|
|||||||
#proguard.config=proguard.cfg
|
#proguard.config=proguard.cfg
|
||||||
# Project target.
|
# Project target.
|
||||||
target=Google Inc.:Google APIs:15
|
target=Google Inc.:Google APIs:15
|
||||||
|
manifestmerger.enabled=true
|
||||||
|
|||||||
@@ -40,8 +40,28 @@ public class RingerDatabase {
|
|||||||
private static final String TAG = "RingerDatabase";
|
private static final String TAG = "RingerDatabase";
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private SQLiteDatabase mDb;
|
private SQLiteDatabase mDb;
|
||||||
private final DatabaseListener mListener;
|
private static DatabaseListener mListener;
|
||||||
public boolean isUpgrading = false;
|
public boolean isUpgrading = false;
|
||||||
|
private final static Handler mHandler;
|
||||||
|
protected static final int DELETIONCOMPLETE = 0;
|
||||||
|
protected static final int DATABASEUPGRADECOMPLETE = 1;
|
||||||
|
|
||||||
|
static{
|
||||||
|
mHandler = new Handler(){
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
if(mListener != null)
|
||||||
|
switch(msg.what){
|
||||||
|
case DELETIONCOMPLETE:
|
||||||
|
mListener.onRingerDeletionComplete();
|
||||||
|
break;
|
||||||
|
case DATABASEUPGRADECOMPLETE:
|
||||||
|
mListener.onDatabaseUpgradeComplete();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* database information values
|
* database information values
|
||||||
@@ -212,19 +232,11 @@ public class RingerDatabase {
|
|||||||
public void onUpgrade(final SQLiteDatabase db, final int oldVersion, int newVersion) {
|
public void onUpgrade(final SQLiteDatabase db, final int oldVersion, int newVersion) {
|
||||||
Log.w(TAG, "Upgrading database from version "+oldVersion+" to "+newVersion);
|
Log.w(TAG, "Upgrading database from version "+oldVersion+" to "+newVersion);
|
||||||
|
|
||||||
if(RingerDatabase.this.mListener != null)
|
if(mListener != null)
|
||||||
RingerDatabase.this.mListener.onDatabaseUpgrade();
|
mListener.onDatabaseUpgrade();
|
||||||
|
|
||||||
RingerDatabase.this.isUpgrading = true;
|
RingerDatabase.this.isUpgrading = true;
|
||||||
|
|
||||||
final Handler handler = new Handler(){
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg) {
|
|
||||||
if(RingerDatabase.this.mListener != null)
|
|
||||||
RingerDatabase.this.mListener.onDatabaseUpgradeComplete();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//upgrade thread
|
//upgrade thread
|
||||||
new Thread( new Runnable(){
|
new Thread( new Runnable(){
|
||||||
@Override
|
@Override
|
||||||
@@ -269,7 +281,7 @@ public class RingerDatabase {
|
|||||||
db.execSQL("ALTER TABLE ringers_new RENAME TO "+ RINGER_TABLE);
|
db.execSQL("ALTER TABLE ringers_new RENAME TO "+ RINGER_TABLE);
|
||||||
|
|
||||||
}
|
}
|
||||||
handler.sendEmptyMessage(0);
|
mHandler.sendEmptyMessage(DATABASEUPGRADECOMPLETE);
|
||||||
RingerDatabase.this.isUpgrading = false;
|
RingerDatabase.this.isUpgrading = false;
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
@@ -292,7 +304,7 @@ public class RingerDatabase {
|
|||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
public RingerDatabase(Context context, DatabaseListener listener){
|
public RingerDatabase(Context context, DatabaseListener listener){
|
||||||
this.mListener = listener;
|
mListener = listener;
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
this.mDb = new OpenHelper(this.mContext).getWritableDatabase();
|
this.mDb = new OpenHelper(this.mContext).getWritableDatabase();
|
||||||
}
|
}
|
||||||
@@ -385,14 +397,6 @@ public class RingerDatabase {
|
|||||||
|
|
||||||
final ProgressDialog progress = ProgressDialog.show(RingerDatabase.this.mContext, "", RingerDatabase.this.mContext.getText(R.string.deleteing), true, true);
|
final ProgressDialog progress = ProgressDialog.show(RingerDatabase.this.mContext, "", RingerDatabase.this.mContext.getText(R.string.deleteing), true, true);
|
||||||
|
|
||||||
final Handler handler = new Handler(){
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg) {
|
|
||||||
if(RingerDatabase.this.mListener != null)
|
|
||||||
RingerDatabase.this.mListener.onRingerDeletionComplete();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//ringer deleting thread
|
//ringer deleting thread
|
||||||
new Thread( new Runnable(){
|
new Thread( new Runnable(){
|
||||||
@Override
|
@Override
|
||||||
@@ -409,7 +413,7 @@ public class RingerDatabase {
|
|||||||
*/
|
*/
|
||||||
RingerDatabase.this.mDb.delete(RINGER_TABLE, "id = "+ id, null);
|
RingerDatabase.this.mDb.delete(RINGER_TABLE, "id = "+ id, null);
|
||||||
updateRowIds(id +1);
|
updateRowIds(id +1);
|
||||||
handler.sendEmptyMessage(0);
|
mHandler.sendEmptyMessage(DELETIONCOMPLETE);
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
@@ -585,8 +589,8 @@ public class RingerDatabase {
|
|||||||
this.mDb.close();
|
this.mDb.close();
|
||||||
this.mDb = new OpenHelper(this.mContext).getWritableDatabase();
|
this.mDb = new OpenHelper(this.mContext).getWritableDatabase();
|
||||||
if(this.mDb.isOpen() && ! this.isUpgrading)
|
if(this.mDb.isOpen() && ! this.isUpgrading)
|
||||||
if(this.mListener != null)
|
if(mListener != null)
|
||||||
this.mListener.onRestoreComplete();
|
mListener.onRestoreComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int setRingerEnabled(final long id, final boolean enabled) {
|
public int setRingerEnabled(final long id, final boolean enabled) {
|
||||||
@@ -667,7 +671,7 @@ public class RingerDatabase {
|
|||||||
*/
|
*/
|
||||||
private void updateRowIds(long id) {
|
private void updateRowIds(long id) {
|
||||||
long currentRow;
|
long currentRow;
|
||||||
ContentValues values = new ContentValues();
|
final ContentValues values = new ContentValues();
|
||||||
final Cursor cursor = this.mDb.query(RINGER_TABLE, new String[] { "id" },null, null, null, null, null);
|
final Cursor cursor = this.mDb.query(RINGER_TABLE, new String[] { "id" },null, null, null, null, null);
|
||||||
if (cursor.moveToFirst()) {
|
if (cursor.moveToFirst()) {
|
||||||
do {
|
do {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public final String TAG = "GetLocationWidget";
|
|||||||
int appWidgetId = appWidgetIds[i];
|
int appWidgetId = appWidgetIds[i];
|
||||||
|
|
||||||
Intent intent = new Intent(context, LocationService.class)
|
Intent intent = new Intent(context, LocationService.class)
|
||||||
.putExtra(LocationService.INTENT_EXTRA_REQUIRED_ACCURACY, Integer.parseInt(context.getSharedPreferences(SettingsActivity.SETTINGS, Context.MODE_WORLD_READABLE).getString(SettingsActivity.ACCURACY , "50")))
|
.putExtra(LocationService.INTENT_EXTRA_REQUIRED_ACCURACY, Integer.parseInt(context.getSharedPreferences(SettingsActivity.SETTINGS, Debug.SHARED_PREFS_MODE).getString(SettingsActivity.ACCURACY , "50")))
|
||||||
.setAction(LocationLibraryConstants.INTENT_ACTION_UPDATE);
|
.setAction(LocationLibraryConstants.INTENT_ACTION_UPDATE);
|
||||||
|
|
||||||
//create a pending intent to start the post activity
|
//create a pending intent to start the post activity
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import android.content.SharedPreferences;
|
|||||||
|
|
||||||
import com.TwentyCodes.android.LocationRinger.LocationRinger;
|
import com.TwentyCodes.android.LocationRinger.LocationRinger;
|
||||||
import com.TwentyCodes.android.LocationRinger.R;
|
import com.TwentyCodes.android.LocationRinger.R;
|
||||||
|
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
||||||
import com.TwentyCodes.android.LocationRinger.ui.SettingsActivity;
|
import com.TwentyCodes.android.LocationRinger.ui.SettingsActivity;
|
||||||
import com.TwentyCodes.android.SkyHook.SkyHookService;
|
import com.TwentyCodes.android.SkyHook.SkyHookService;
|
||||||
import com.TwentyCodes.android.exception.ExceptionHandler;
|
import com.TwentyCodes.android.exception.ExceptionHandler;
|
||||||
@@ -57,7 +58,7 @@ public class LocationService extends SkyHookService {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
|
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
|
||||||
this.mSettings = this.getSharedPreferences(SettingsActivity.SETTINGS, Context.MODE_WORLD_WRITEABLE);
|
this.mSettings = this.getSharedPreferences(SettingsActivity.SETTINGS, Debug.SHARED_PREFS_MODE);
|
||||||
this.mSettings.edit().putBoolean(SettingsActivity.IS_SERVICE_STARTED, true).commit();
|
this.mSettings.edit().putBoolean(SettingsActivity.IS_SERVICE_STARTED, true).commit();
|
||||||
startOnGoingNotification();
|
startOnGoingNotification();
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ public class RingerProcessingService extends Service {
|
|||||||
final ContentValues info = this.mDb.getRingerInfo(c.getString(0));
|
final ContentValues info = this.mDb.getRingerInfo(c.getString(0));
|
||||||
if(info.containsKey(RingerDatabase.KEY_LOCATION) && info.containsKey(RingerDatabase.KEY_RADIUS)){
|
if(info.containsKey(RingerDatabase.KEY_LOCATION) && info.containsKey(RingerDatabase.KEY_RADIUS)){
|
||||||
final String[] pointInfo = info.getAsString(RingerDatabase.KEY_LOCATION).split(",");
|
final String[] pointInfo = info.getAsString(RingerDatabase.KEY_LOCATION).split(",");
|
||||||
if(GeoUtils.isIntersecting(point, Float.valueOf(mLocation.getAccuracy()) / 1000, new GeoPoint(Integer.parseInt(pointInfo[0]), Integer.parseInt(pointInfo[1])), new Float(info.getAsInteger(RingerDatabase.KEY_RADIUS)) / 1000, Debug.FUDGE_FACTOR)){
|
if(GeoUtils.isIntersecting(point, Float.valueOf(mLocation.getAccuracy()) / 1000, new GeoPoint(Integer.parseInt(pointInfo[0]), Integer.parseInt(pointInfo[1])), Float.valueOf(info.getAsInteger(RingerDatabase.KEY_RADIUS)) / 1000, Debug.FUDGE_FACTOR)){
|
||||||
c.close();
|
c.close();
|
||||||
getRinger(ringer, index);
|
getRinger(ringer, index);
|
||||||
isDeafult = false;
|
isDeafult = false;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
package com.TwentyCodes.android.LocationRinger.ui;
|
package com.TwentyCodes.android.LocationRinger.ui;
|
||||||
|
|
||||||
import com.TwentyCodes.android.LocationRinger.R;
|
import com.TwentyCodes.android.LocationRinger.R;
|
||||||
|
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -71,7 +72,7 @@ public class FirstBootDialog extends Dialog implements android.view.View.OnClick
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View arg0) {
|
public void onClick(View arg0) {
|
||||||
this.getContext().getSharedPreferences(SettingsActivity.SETTINGS, Context.MODE_WORLD_WRITEABLE).edit().putBoolean(SettingsActivity.IS_FIRST_BOOT, false).commit();
|
this.getContext().getSharedPreferences(SettingsActivity.SETTINGS, Debug.SHARED_PREFS_MODE).edit().putBoolean(SettingsActivity.IS_FIRST_BOOT, false).commit();
|
||||||
this.dismiss();
|
this.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import android.os.Bundle;
|
|||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import com.TwentyCodes.android.LocationRinger.R;
|
import com.TwentyCodes.android.LocationRinger.R;
|
||||||
|
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
||||||
import com.TwentyCodes.android.LocationRinger.services.LocationService;
|
import com.TwentyCodes.android.LocationRinger.services.LocationService;
|
||||||
import com.TwentyCodes.android.debug.LocationLibraryConstants;
|
import com.TwentyCodes.android.debug.LocationLibraryConstants;
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ public class LauncherShortcuts extends Activity {
|
|||||||
* start the location service in single shot mode
|
* start the location service in single shot mode
|
||||||
*/
|
*/
|
||||||
Intent service = new Intent(this, LocationService.class)
|
Intent service = new Intent(this, LocationService.class)
|
||||||
.putExtra(LocationService.INTENT_EXTRA_REQUIRED_ACCURACY, Integer.parseInt(this.getSharedPreferences(SettingsActivity.SETTINGS, Context.MODE_WORLD_READABLE).getString(SettingsActivity.ACCURACY , "50")))
|
.putExtra(LocationService.INTENT_EXTRA_REQUIRED_ACCURACY, Integer.parseInt(this.getSharedPreferences(SettingsActivity.SETTINGS, Debug.SHARED_PREFS_MODE).getString(SettingsActivity.ACCURACY , "50")))
|
||||||
.setAction(LocationLibraryConstants.INTENT_ACTION_UPDATE);
|
.setAction(LocationLibraryConstants.INTENT_ACTION_UPDATE);
|
||||||
this.startService(service);
|
this.startService(service);
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,16 @@
|
|||||||
|
|
||||||
package com.TwentyCodes.android.LocationRinger.ui;
|
package com.TwentyCodes.android.LocationRinger.ui;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
import android.view.ContextMenu.ContextMenuInfo;
|
||||||
@@ -36,19 +38,20 @@ import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
|||||||
import com.TwentyCodes.android.LocationRinger.receivers.PassiveLocationChangedReceiver;
|
import com.TwentyCodes.android.LocationRinger.receivers.PassiveLocationChangedReceiver;
|
||||||
import com.TwentyCodes.android.LocationRinger.services.LocationService;
|
import com.TwentyCodes.android.LocationRinger.services.LocationService;
|
||||||
import com.TwentyCodes.android.SkyHook.SkyHookRegistration;
|
import com.TwentyCodes.android.SkyHook.SkyHookRegistration;
|
||||||
import com.TwentyCodes.android.SkyHook.Splash;
|
|
||||||
import com.TwentyCodes.android.debug.LocationLibraryConstants;
|
import com.TwentyCodes.android.debug.LocationLibraryConstants;
|
||||||
import com.TwentyCodes.android.location.PassiveLocationListener;
|
import com.TwentyCodes.android.location.PassiveLocationListener;
|
||||||
import com.skyhookwireless.wps.RegistrationCallback;
|
import com.skyhookwireless.wps.RegistrationCallback;
|
||||||
import com.skyhookwireless.wps.WPSContinuation;
|
import com.skyhookwireless.wps.WPSContinuation;
|
||||||
import com.skyhookwireless.wps.WPSReturnCode;
|
import com.skyhookwireless.wps.WPSReturnCode;
|
||||||
|
|
||||||
|
@SuppressLint("Registered")
|
||||||
public class ListActivity extends Activity implements OnItemClickListener, OnClickListener, DatabaseListener, RegistrationCallback {
|
public class ListActivity extends Activity implements OnItemClickListener, OnClickListener, DatabaseListener, RegistrationCallback {
|
||||||
|
|
||||||
private RingerDatabase mDb;
|
private RingerDatabase mDb;
|
||||||
private ListView mListView;
|
private ListView mListView;
|
||||||
private SharedPreferences mSettings;
|
private SharedPreferences mSettings;
|
||||||
private ProgressDialog mProgress;
|
private ProgressDialog mProgress;
|
||||||
|
private Dialog mSplashDialog;
|
||||||
|
|
||||||
public static final String NO_SPLASH = "no splash";
|
public static final String NO_SPLASH = "no splash";
|
||||||
public static final String KEY_RINGER = "key_ringer";
|
public static final String KEY_RINGER = "key_ringer";
|
||||||
@@ -153,7 +156,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
this.mListView.setEmptyView(findViewById(android.R.id.empty));
|
this.mListView.setEmptyView(findViewById(android.R.id.empty));
|
||||||
findViewById(R.id.add_ringer_button).setOnClickListener(this);
|
findViewById(R.id.add_ringer_button).setOnClickListener(this);
|
||||||
populate();
|
populate();
|
||||||
this.mSettings = this.getSharedPreferences(SettingsActivity.SETTINGS, Context.MODE_WORLD_WRITEABLE);
|
this.mSettings = this.getSharedPreferences(SettingsActivity.SETTINGS, Debug.SHARED_PREFS_MODE);
|
||||||
|
|
||||||
if(this.mSettings.getBoolean(SettingsActivity.IS_FIRST_BOOT, true))
|
if(this.mSettings.getBoolean(SettingsActivity.IS_FIRST_BOOT, true))
|
||||||
new FirstBootDialog(this).show();
|
new FirstBootDialog(this).show();
|
||||||
@@ -163,10 +166,10 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!this.getIntent().hasExtra(NO_SPLASH))
|
if(!this.getIntent().hasExtra(NO_SPLASH))
|
||||||
this.startActivity(new Intent(this, Splash.class));
|
showSplashScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called when the activity is first created, creates a context menu
|
* called when the activity is first created, creates a context menu
|
||||||
* @param menu
|
* @param menu
|
||||||
* @param v
|
* @param v
|
||||||
@@ -194,7 +197,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a database is being upgraded
|
* Called when a database is being upgraded
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -214,7 +217,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
this.mProgress.dismiss();
|
this.mProgress.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see android.app.Activity#onDestroy()
|
* @see android.app.Activity#onDestroy()
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -225,7 +228,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called when an item in the list view has been clicked,
|
* called when an item in the list view has been clicked,
|
||||||
* this will open the note edit dialog for the selected note
|
* this will open the note edit dialog for the selected note
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
@@ -278,7 +281,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called when an option is selected form the menu
|
* called when an option is selected form the menu
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
|
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
|
||||||
@@ -304,7 +307,17 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see android.app.Activity#onPause()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
removeSplashScreen();
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* Called when the database is restored
|
* Called when the database is restored
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -320,7 +333,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
populate();
|
populate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* populates the list view from the data base
|
* populates the list view from the data base
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -329,6 +342,16 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
mListView.setAdapter(new RingerListAdapter(this, mDb));
|
mListView.setAdapter(new RingerListAdapter(this, mDb));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the Dialog that displays the splash screen
|
||||||
|
*/
|
||||||
|
protected void removeSplashScreen() {
|
||||||
|
if (mSplashDialog != null) {
|
||||||
|
mSplashDialog.dismiss();
|
||||||
|
mSplashDialog = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restarts the service if its not already running.
|
* Restarts the service if its not already running.
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
@@ -345,4 +368,33 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
this.startService(i);
|
this.startService(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows the splash screen over the full Activity
|
||||||
|
*/
|
||||||
|
protected void showSplashScreen() {
|
||||||
|
// mMap.setGPSDialogEnabled(false);
|
||||||
|
mSplashDialog = new Dialog(this, android.R.style.Theme_Translucent);
|
||||||
|
mSplashDialog.setContentView(R.layout.powered_by_skyhook);
|
||||||
|
mSplashDialog.setCancelable(false);
|
||||||
|
mSplashDialog.show();
|
||||||
|
|
||||||
|
// Set Runnable to remove splash screen just in case
|
||||||
|
final Handler handler = new Handler();
|
||||||
|
handler.postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
removeSplashScreen();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* uncomment the following to display the eula
|
||||||
|
*/
|
||||||
|
// //loads first boot dialog if this is the first boot
|
||||||
|
// if (! mSettings.getBoolean(Settings.ACCEPTED, false) || Debug.FORCE_FIRSTBOOT_DIALOG)
|
||||||
|
// eulaAlert();
|
||||||
|
// else
|
||||||
|
// update();
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -44,6 +44,7 @@ public class AboutRingerFragment extends Fragment implements OnCheckedChangeList
|
|||||||
private final ContentValues mRinger;
|
private final ContentValues mRinger;
|
||||||
|
|
||||||
public AboutRingerFragment(final ContentValues ringer, final ContentValues info, final OnContentChangedListener listener){
|
public AboutRingerFragment(final ContentValues ringer, final ContentValues info, final OnContentChangedListener listener){
|
||||||
|
super();
|
||||||
this.mInfo = info;
|
this.mInfo = info;
|
||||||
this.mRinger = ringer;
|
this.mRinger = ringer;
|
||||||
this.mListener = listener;
|
this.mListener = listener;
|
||||||
|
|||||||
Reference in New Issue
Block a user