Conditionally remove settings that aren't required on the tablet.
Bug: 2985267
Changes not done : SD card related stuff, as we need some way still
to figure out if there is a real SD card in the device.
Change-Id: I21c41f18ebe6c050981918481a7f6d69f04b65d0
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index b29ec06f..694bc1f 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -16,23 +16,24 @@
package com.android.settings;
+import java.util.List;
+
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import android.os.SystemProperties;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.os.SystemProperties;
import android.preference.Preference;
import android.preference.PreferenceGroup;
+import android.telephony.TelephonyManager;
import android.text.TextUtils;
-import java.util.List;
-
public class Utils {
/**
@@ -207,4 +208,13 @@
public static boolean isMonkeyRunning() {
return SystemProperties.getBoolean("ro.monkey", false);
}
+
+ /**
+ * Returns whether the device is voice-capable (meaning, it is also a phone).
+ */
+ public static boolean isVoiceCapable(Context context) {
+ TelephonyManager telephony =
+ (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+ return telephony != null && telephony.isVoiceCapable();
+ }
}