Back out ecc5ce4b7632 (bug 849955) for missing Android API level checks. r=me DONTBUILD

This commit is contained in:
Kartikaya Gupta 2013-03-12 10:15:46 +00:00
parent b713d88efa
commit f9247ac9ce
2 changed files with 1 additions and 19 deletions

View File

@ -1274,7 +1274,7 @@ abstract public class BrowserApp extends GeckoApp
// Only show the "Quit" menu item on pre-ICS. In ICS+, it's easy to
// kill an app through the task switcher.
aMenu.findItem(R.id.quit).setVisible(Build.VERSION.SDK_INT < 14 || !isTouchDevice());
aMenu.findItem(R.id.quit).setVisible(Build.VERSION.SDK_INT < 14);
if (tab == null || tab.getURL() == null) {
bookmark.setEnabled(false);

View File

@ -50,7 +50,6 @@ import android.graphics.Rect;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.input.InputManager;
import android.location.Location;
import android.location.LocationListener;
import android.net.Uri;
@ -66,7 +65,6 @@ import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.Display;
import android.view.Gravity;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
@ -190,7 +188,6 @@ abstract public class GeckoApp
private static Boolean sIsLargeTablet = null;
private static Boolean sIsSmallTablet = null;
private static Boolean sIsTouchDevice = null;
abstract public int getLayout();
abstract public boolean hasTabsSideBar();
@ -1334,21 +1331,6 @@ abstract public class GeckoApp
return sIsSmallTablet;
}
public boolean isTouchDevice() {
if (sIsTouchDevice == null) {
sIsTouchDevice = false;
InputManager manager = (InputManager)getSystemService(Context.INPUT_SERVICE);
if (manager != null) {
for (int inputDeviceId : manager.getInputDeviceIds()) {
if ((manager.getInputDevice(inputDeviceId).getSources() & InputDevice.SOURCE_TOUCHSCREEN) == InputDevice.SOURCE_TOUCHSCREEN) {
sIsTouchDevice = true;
}
}
}
}
return sIsTouchDevice;
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)