зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1699646 - Add Android device information to the profile meta object r=geckoview-reviewers,agi,gerald,julienw
Differential Revision: https://phabricator.services.mozilla.com/D109408
This commit is contained in:
Родитель
32bf182577
Коммит
4e8f3a2687
|
@ -5,6 +5,7 @@
|
|||
|
||||
package org.mozilla.gecko;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
@ -446,4 +447,15 @@ public class GeckoJavaSampler {
|
|||
sMarkerStorage.stop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the device brand and model as a string.
|
||||
*/
|
||||
@WrapForJNI
|
||||
public static String getDeviceInformation() {
|
||||
final StringBuilder sb = new StringBuilder(Build.BRAND);
|
||||
sb.append(" ");
|
||||
sb.append(Build.MODEL);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2636,6 +2636,12 @@ static void StreamMetaJSCustomObject(
|
|||
aPreRecordedMetaInformation.mProcessInfoCpuCount);
|
||||
}
|
||||
|
||||
#if defined(GP_OS_android)
|
||||
jni::String::LocalRef deviceInformation =
|
||||
java::GeckoJavaSampler::GetDeviceInformation();
|
||||
aWriter.StringProperty("device", deviceInformation->ToCString());
|
||||
#endif
|
||||
|
||||
aWriter.StartObjectProperty("sampleUnits");
|
||||
{
|
||||
aWriter.StringProperty("time", "ms");
|
||||
|
|
Загрузка…
Ссылка в новой задаче