mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
Back out ecc5ce4b7632 (bug 849955) for missing Android API level checks. r=me DONTBUILD
This commit is contained in:
parent
b713d88efa
commit
f9247ac9ce
@ -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);
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user