From eed8a5daca9ff0dbc0ad4237026640a46eec2b89 Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Sun, 7 Apr 2013 05:28:46 +0200 Subject: Trebuchet: Default workspace fixes * Replace AnalogClockWidget by cLock Widget * Add "no telephony" workspaces files. New favorites: - Phone -> Email - Contacts -> Calendar - Mms -> Contacts - Browser -> Browser * Add sw600dp and sw700dp update workspaces files Patchset 2-4: CleanUp Change-Id: If21559c59995326b93689f89291446a9962274cb --- src/com/cyanogenmod/trebuchet/LauncherProvider.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/com/cyanogenmod') diff --git a/src/com/cyanogenmod/trebuchet/LauncherProvider.java b/src/com/cyanogenmod/trebuchet/LauncherProvider.java index b16002a48..af3ad8ba3 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; } -- cgit v1.2.3