Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: facebookarchive/device-year-class
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.1
Choose a base ref
...
head repository: facebookarchive/device-year-class
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Mar 28, 2015

  1. Copy the full SHA
    269f1c8 View commit details
  2. Copy the full SHA
    754f9dc View commit details

Commits on Mar 29, 2015

  1. update the sample app and add methods to get the int value for purpos…

    …es such as saving to shared preferences
    trevor-e committed Mar 29, 2015
    Copy the full SHA
    d57ccf7 View commit details
  2. Copy the full SHA
    20a7801 View commit details

Commits on Apr 14, 2015

  1. Update Patent Grant

    SeyelentEco committed Apr 14, 2015
    Copy the full SHA
    7e89908 View commit details

Commits on Sep 3, 2015

  1. Merge branch 'master' of https://github.com/trevor-e/device-year-class

    …into trevor-e-master
    
    Conflicts:
    	yearclass/src/main/java/com/facebook/device/yearclass/YearClass.java
    Alex Petrescu committed Sep 3, 2015
    Copy the full SHA
    719c6d0 View commit details
  2. Merge branch 'trevor-e-master'

    Alex Petrescu committed Sep 3, 2015
    Copy the full SHA
    0ce9a3d View commit details
  3. Copy the full SHA
    3c12f8f View commit details

Commits on May 18, 2016

  1. Copy the full SHA
    5aaff34 View commit details
  2. Merge pull request #16 from lozzle/master

    Added a few more methods to detect number of CPU cores on device
    zlern2k committed May 18, 2016
    Copy the full SHA
    d590884 View commit details

Commits on Jun 30, 2016

  1. Merge pull request #1 from facebook/master

    Rebase to pick up CPU cores
    zlern2k authored Jun 30, 2016
    Copy the full SHA
    98cb181 View commit details
  2. Copy the full SHA
    a61efe9 View commit details
  3. model clarifications

    zlern2k committed Jun 30, 2016
    Copy the full SHA
    3615866 View commit details

Commits on Jul 1, 2016

  1. 1
    Copy the full SHA
    c7a1227 View commit details
  2. Merge pull request #19 from zlern2k/master

    New definitions
    SeyelentEco authored Jul 1, 2016
    Copy the full SHA
    940d5d4 View commit details
  3. Bump to 2.0.0, update README

    zlern2k committed Jul 1, 2016
    Copy the full SHA
    2ba0a59 View commit details

Commits on Sep 16, 2016

  1. Merge pull request #20 from zlern2k/master

    Bump to 2.0.0, update README
    zlern2k authored Sep 16, 2016
    Copy the full SHA
    ac6b9ec View commit details
  2. Copy the full SHA
    d4042fa View commit details
  3. Merge pull request #21 from facebook/revert-20-master

    Revert "Bump to 2.0.0, update README"
    zlern2k authored Sep 16, 2016
    Copy the full SHA
    7802a3e View commit details

Commits on Sep 23, 2016

  1. Copy the full SHA
    bd2fa85 View commit details

Commits on Sep 27, 2016

  1. Copy the full SHA
    5e77391 View commit details

Commits on Oct 20, 2016

  1. Merge pull request #22 from zlern2k/master

    Close the cpu buffer to (fix a strict mode violation)
    zlern2k authored Oct 20, 2016
    Copy the full SHA
    84a7f99 View commit details
  2. Bump to 2.0.0, update README

    zlern2k committed Oct 20, 2016
    Copy the full SHA
    27f3fee View commit details

Commits on Oct 26, 2016

  1. Update DeviceInfo.java

    Avoid `virtual core file permission denied` error, closes #18
    divayprakash authored Oct 26, 2016
    Copy the full SHA
    d5a6733 View commit details
  2. Update README.md

    Add links to `CONTRIBUTING.md` and `LICENSE` in the relevant sections.
    divayprakash authored Oct 26, 2016
    Copy the full SHA
    2c00287 View commit details

Commits on Dec 2, 2016

  1. Merge pull request #24 from zlern2k/master

    Bump to 2.0.0, update README
    SeyelentEco authored Dec 2, 2016
    Copy the full SHA
    53873e6 View commit details

Commits on Feb 12, 2017

  1. Fix whitespace errors

    friederbluemle committed Feb 12, 2017

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    friederbluemle Frieder Bluemle
    Copy the full SHA
    29c2043 View commit details
  2. Update Android build dependencies

    - Update Gradle wrapper to 3.3
    - Increase Gradle daemon max heap size to 1536 MB
    - Update Android Gradle plug-in to 2.2.3
    - Update build tools to 25.0.2
    - Update targetSdkVersion to 25
    friederbluemle committed Feb 12, 2017

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    friederbluemle Frieder Bluemle
    Copy the full SHA
    f188d16 View commit details
  3. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    friederbluemle Frieder Bluemle
    Copy the full SHA
    85f8b1f View commit details
  4. Merge pull request #17 from friederbluemle/update-project

    Update project dependencies
    SeyelentEco authored Feb 12, 2017
    Copy the full SHA
    08cdf5d View commit details
  5. Merge pull request #27 from divayprakash/patch-2

    Update README.md
    SeyelentEco authored Feb 12, 2017
    Copy the full SHA
    a00148c View commit details
  6. Merge pull request #23 from ashishb/master

    Fix a leak of FileInputStream object in DeviceInfo#getCoresFromFileInfo
    SeyelentEco authored Feb 12, 2017
    Copy the full SHA
    564c368 View commit details
  7. Merge pull request #26 from divayprakash/patch-1

    Update DeviceInfo.java
    SeyelentEco authored Feb 12, 2017
    Copy the full SHA
    9e0489f View commit details

Commits on Apr 10, 2017

  1. Copy the full SHA
    6e9692f View commit details
  2. Copy the full SHA
    87d308f View commit details

Commits on Apr 11, 2017

  1. Copy the full SHA
    1593da5 View commit details

Commits on Feb 21, 2018

  1. Adding Year Class 2016

    Add Year Class 2016, defined as devices with > 5GB RAM.
    Eliza S. Hale committed Feb 21, 2018
    Copy the full SHA
    3a6c910 View commit details

Commits on Feb 23, 2018

  1. Merge pull request #36 from elizahale/master

    Adding Year Class 2016
    SeyelentEco authored Feb 23, 2018
    Copy the full SHA
    0355835 View commit details
  2. Merge pull request #32 from friederbluemle/update-project

    Update build dependencies
    SeyelentEco authored Feb 23, 2018
    Copy the full SHA
    e7e8343 View commit details

Commits on Apr 14, 2018

  1. Updated version number 2.0.0 -> 2.1.0 (#37)

    2.0.0 to 2.1.0
    * Update version number in README
    * Update version number in gradle.properties
    * Update version number in CHANGELOG
    elizahale authored and zlern2k committed Apr 14, 2018
    Copy the full SHA
    a6dc1f3 View commit details
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@
*.iml
.DS_Store
/build
.watchmanconfig
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
Change Log
==========

## Version 2.1.0

* Added Year Class 2016 to classification model.

## Version 2.0.0

_2018-04-13_

* New classification model.

## Version 1.0.1

_2015-04-02_

* Threading fix.


## Version 1.0.0

_2015-03-25_

* Initial release.
* Initial release.
17 changes: 10 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -10,11 +10,11 @@ respond to requests.

## Pull Requests
We actively welcome your pull requests.
1. Fork the repo and create your branch from `master`.
1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. If you haven't already, complete the Contributor License Agreement ("CLA").

## Contributor License Agreement ("CLA")
@@ -23,15 +23,17 @@ to do this once to work on any of Facebook's open source projects.

Complete your CLA here: <https://code.facebook.com/cla>

## Issues
## Issues

We use GitHub issues to track public bugs. Please ensure your description is
clear and has sufficient instructions to be able to reproduce the issue.

Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
disclosure of security bugs. In those cases, please go through the process
outlined on that page and do not file a public issue.

## Coding Style
## Coding Style

* 2 spaces for indentation rather than tabs
* Line wrapping indents 4 spaces
* 100 character line length
@@ -40,5 +42,6 @@ outlined on that page and do not file a public issue.
* Opening braces to appear on the same line as code

## License

By contributing to Device Year Class, you agree that your contributions will be licensed
under its BSD license.
under its BSD license.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -27,4 +27,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 changes: 28 additions & 18 deletions PATENTS
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
Additional Grant of Patent Rights
Additional Grant of Patent Rights Version 2

"Software" means the Device Year Class software distributed by Facebook, Inc.

Facebook hereby grants you a perpetual, worldwide, royalty-free, non-exclusive,
irrevocable (subject to the termination provision below) license under any
rights in any patent claims owned by Facebook, to make, have made, use, sell,
offer to sell, import, and otherwise transfer the Software. For avoidance of
doubt, no license is granted under Facebook’s rights in any patent claims that
are infringed by (i) modifications to the Software made by you or a third party,
or (ii) the Software in combination with any software or other technology
provided by you or a third party.
Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
(subject to the termination provision below) license under any Necessary
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
transfer the Software. For avoidance of doubt, no license is granted under
Facebook’s rights in any patent claims that are infringed by (i) modifications
to the Software made by you or any third party or (ii) the Software in
combination with any software or other technology.

The license granted hereunder will terminate, automatically and without notice,
for anyone that makes any claim (including by filing any lawsuit, assertion or
other action) alleging (a) direct, indirect, or contributory infringement or
inducement to infringe any patent: (i) by Facebook or any of its subsidiaries or
affiliates, whether or not such claim is related to the Software, (ii) by any
party if such claim arises in whole or in part from any software, product or
service of Facebook or any of its subsidiaries or affiliates, whether or not
such claim is related to the Software, or (iii) by any party relating to the
Software; or (b) that any right in any patent claim of Facebook is invalid or
unenforceable.
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
directly or indirectly, or take a direct financial interest in, any Patent
Assertion: (i) against Facebook or any of its subsidiaries or corporate
affiliates, (ii) against any party if such Patent Assertion arises in whole or
in part from any software, technology, product or service of Facebook or any of
its subsidiaries or corporate affiliates, or (iii) against any party relating
to the Software. Notwithstanding the foregoing, if Facebook or any of its
subsidiaries or corporate affiliates files a lawsuit alleging patent
infringement against you in the first instance, and you respond by filing a
patent infringement counterclaim in that lawsuit against that party that is
unrelated to the Software, the license granted hereunder will not terminate
under section (i) of this paragraph due to such counterclaim.

A "Necessary Claim" is a claim of a patent owned by Facebook that is
necessarily infringed by the Software standing alone.

A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
or contributory infringement or inducement to infringe any patent, including a
cross-claim or counterclaim.
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,32 +7,34 @@ application behavior based on the capabilities of the phone's hardware.

![Most Popular Devices by Year Class](https://github.com/facebook/device-year-class/raw/master/docs/images/popular_devices_by_year_class.png)

Mappings as of this writing (ceilings, aside from the final row):

|Year| Cores| Clock | RAM |
|---:|------:|-------:|-----:|
|2008| 1 | 528MHz| 192MB|
|2009| n/a | 600MHz| 290MB|
|2010| n/a | 1.0GHz| 512MB|
|2011| 2 | 1.2GHz| 1GB|
|2012| 4 | 1.5GHz| 1.5GB|
|2013| n/a | 2.0GHz| 2GB|
|2014| n/a | >2GHz| >2GB|
Mappings as of this writing (RAM is a ceiling):

| RAM | condition | Year Class |
|----:|----------:|-----------:|
|768MB| 1 core | 2009 |
| | 2+ cores | 2010 |
| 1GB| <1.3GHz | 2011 |
| | 1.3GHz+ | 2012 |
|1.5GB| <1.8GHz | 2012 |
| | 1.8GHz+ | 2013 |
| 2GB| | 2013 |
| 3GB| | 2014 |
| 5GB| | 2015 |
| more| | 2016 |

## Integration

### Download
Download [the latest JARs](https://github.com/facebook/device-year-class/releases/latest) or grab via Gradle:
```groovy
compile 'com.facebook.device.yearclass:yearclass:1.0.1'
compile 'com.facebook.device.yearclass:yearclass:2.1.0'
```
or Maven:
```xml
<dependency>
<groupId>com.facebook.device.yearclass</groupId>
<artifactId>yearclass</artifactId>
<version>1.0.1</version>
<version>2.1.0</version>
</dependency>
```

@@ -59,7 +61,7 @@ if (year >= 2013) {
See the `yearclass-sample` project for more details.

## Improve Device Year Class!
See the CONTRIBUTING.md file for how to help out.
See the [CONTRIBUTING.md](https://github.com/facebook/device-year-class/blob/master/CONTRIBUTING.md) file for how to help out.

## License
Device Year Class is BSD-licensed. We also provide an additional patent grant.
Device Year Class is [BSD-licensed](https://github.com/facebook/device-year-class/blob/master/LICENSE). We also provide an additional patent grant.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -5,8 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'org.robolectric:robolectric-gradle-plugin:0.14.+'
classpath 'com.android.tools.build:gradle:2.3.1'
}
}

22 changes: 20 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
VERSION_NAME=1.0.1
GROUP=com.facebook.device.yearclass
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=2.1.0
GROUP=com.facebook.device.yearclass
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Feb 13 17:44:35 PST 2015
#Tue Apr 11 17:45:27 SGT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
74 changes: 41 additions & 33 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

@@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
Loading