diff options
author | nebkat <nebkat@gmail.com> | 2013-04-07 04:13:20 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-04-07 04:13:20 -0700 |
commit | 42b656dbd1302cd27f0b4d0667f2fdb1af1b8a70 (patch) | |
tree | 91dddacfa05655b8cbf66ed0764694c28bf6ba84 /src | |
parent | 48541f8c841511f0621b65bcc87b802748c78550 (diff) | |
parent | eed8a5daca9ff0dbc0ad4237026640a46eec2b89 (diff) | |
download | packages_apps_trebuchet-42b656dbd1302cd27f0b4d0667f2fdb1af1b8a70.zip packages_apps_trebuchet-42b656dbd1302cd27f0b4d0667f2fdb1af1b8a70.tar.gz packages_apps_trebuchet-42b656dbd1302cd27f0b4d0667f2fdb1af1b8a70.tar.bz2 |
Merge "Trebuchet: Default workspace fixes" into cm-10.1
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/LauncherProvider.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/trebuchet/LauncherProvider.java b/src/com/cyanogenmod/trebuchet/LauncherProvider.java index b16002a..af3ad8b 100644 --- a/src/com/cyanogenmod/trebuchet/LauncherProvider.java +++ b/src/com/cyanogenmod/trebuchet/LauncherProvider.java @@ -40,6 +40,7 @@ import android.database.sqlite.SQLiteQueryBuilder; import android.net.Uri; import android.os.Bundle; import android.provider.Settings; +import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Log; @@ -209,7 +210,12 @@ public class LauncherProvider extends ContentProvider { // Use default workspace resource if none provided if (workspaceResId == 0) { - workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, R.xml.default_workspace); + TelephonyManager tm = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE); + if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) { + workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, R.xml.default_workspace_no_telephony); + } else { + workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, R.xml.default_workspace); + } } // Populate favorites table with initial favorites @@ -418,7 +424,12 @@ public class LauncherProvider extends ContentProvider { } // Add default hotseat icons - loadFavorites(db, R.xml.update_workspace); + TelephonyManager tm = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); + if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) { + loadFavorites(db, R.xml.update_workspace_no_telephony); + } else { + loadFavorites(db, R.xml.update_workspace); + } version = 14; } |