зеркало из https://github.com/mozilla/gecko-dev.git
Bug 708114 part 1 - Comment out Android StrictMode for all build configurations. r=dougt a=android-only
This commit is contained in:
Родитель
beb8794bb8
Коммит
98520bac0f
|
@ -1261,6 +1261,9 @@ abstract public class GeckoApp
|
|||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
// Uncomment to run StrictMode tests:
|
||||
// enableStrictMode();
|
||||
|
||||
System.loadLibrary("mozutils");
|
||||
mMainHandler = new Handler();
|
||||
Log.w(LOGTAG, "zerdatime " + new Date().getTime() + " - onCreate");
|
||||
|
@ -1282,13 +1285,6 @@ abstract public class GeckoApp
|
|||
showAboutHome();
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 9) {
|
||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||
.detectDiskReads().detectDiskWrites().detectNetwork()
|
||||
.penaltyLog().build());
|
||||
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().penaltyLog().build());
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.gecko_app);
|
||||
|
@ -1449,6 +1445,28 @@ abstract public class GeckoApp
|
|||
}, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable Android StrictMode checks (for supported OS versions).
|
||||
* http://developer.android.com/reference/android/os/StrictMode.html
|
||||
*/
|
||||
private void enableStrictMode()
|
||||
{
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) {
|
||||
return;
|
||||
}
|
||||
|
||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||
.detectAll()
|
||||
.penaltyLog()
|
||||
.penaltyDialog()
|
||||
.build());
|
||||
|
||||
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
|
||||
.detectAll()
|
||||
.penaltyLog()
|
||||
.build());
|
||||
}
|
||||
|
||||
public void enableCameraView() {
|
||||
// Some phones (eg. nexus S) need at least a 8x16 preview size
|
||||
mMainLayout.addView(cameraView, new AbsoluteLayout.LayoutParams(8, 16, 0, 0));
|
||||
|
|
Загрузка…
Ссылка в новой задаче