OSDN Git Service

Display the watermark on AOSP images
authorNicolas Capens <capn@google.com>
Wed, 11 Nov 2015 15:49:08 +0000 (10:49 -0500)
committerNicolas Capens <capn@google.com>
Fri, 13 Nov 2015 02:45:21 +0000 (02:45 +0000)
Bug 25638876

Change-Id: If6d84c6e0778e0e45af27b74c92c861001669409
Reviewed-on: https://swiftshader-review.googlesource.com/4252
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/Android.mk
src/Main/FrameBuffer.cpp

index be29698..a5f7778 100644 (file)
@@ -82,7 +82,11 @@ COMMON_SRC_FILES += \
        OpenGL/common/Object.cpp \
        OpenGL/common/MatrixStack.cpp \
 
-COMMON_CFLAGS := -DLOG_TAG=\"swiftshader\" -Wno-unused-parameter -DDISPLAY_LOGO=0 -Wno-implicit-exception-spec-mismatch -Wno-overloaded-virtual -fno-operator-names -msse2 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -std=c++11
+COMMON_CFLAGS := -DLOG_TAG=\"swiftshader\" -Wno-unused-parameter -Wno-implicit-exception-spec-mismatch -Wno-overloaded-virtual -fno-operator-names -msse2 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -std=c++11
+
+ifneq ($(filter gce_x86 gce calypso, $(TARGET_DEVICE)),)
+COMMON_CFLAGS += -DDISPLAY_LOGO=0
+endif
 
 include $(CLEAR_VARS)
 LOCAL_CLANG := true
index 59543ac..2492d26 100644 (file)
 #include <string.h>
 #include <time.h>
 
+#ifdef __ANDROID__
+#include <cutils/properties.h>
+#endif
+
 #ifndef DISPLAY_LOGO
-#define DISPLAY_LOGO (NDEBUG & 1)
+#define DISPLAY_LOGO ((NDEBUG | __ANDROID__) & 1)
 #endif
 
 #define ASYNCHRONOUS_BLIT 0   // FIXME: Currently leads to rare race conditions
@@ -227,29 +231,13 @@ namespace sw
                const int sBytes = Surface::bytes(state.sourceFormat);
                const int sStride = topLeftOrigin ? (sBytes * width2) : -(sBytes * width2);
 
-       //      char compareApp[32] = SCRAMBLE31(validationApp, APPNAME_SCRAMBLE);
-       //      bool validApp = strcmp(compareApp, registeredApp) == 0;
-               bool validKey = ValidateSerialNumber(validationKey, CHECKSUM_KEY, SERIAL_PREFIX);
-
-               // Date of the end of the logo-free license
-               const int endYear = 2099;
-               const int endMonth = 12;
-               const int endDay = 31;
-
-               const int endDate = (endYear << 16) + (endMonth << 8) + endDay;
-
-               time_t rawtime = time(0);
-               tm *timeinfo = localtime(&rawtime);
-               int year = timeinfo->tm_year + 1900;
-               int month = timeinfo->tm_mon + 1;
-               int day = timeinfo->tm_mday;
-
-               int date = (year << 16) + (month << 8) + day;
-
-               if(date > endDate)
-               {
-                       validKey = false;
-               }
+               #ifdef __ANDROID__
+                       char ro_product_model[PROPERTY_VALUE_MAX] = "";
+               property_get("ro.product.model", ro_product_model, nullptr);
+                       bool validKey = strstr(ro_product_model, "Android") != nullptr;
+               #else
+                       bool validKey = ValidateSerialNumber(validationKey, CHECKSUM_KEY, SERIAL_PREFIX);
+               #endif
 
                Function<Void, Pointer<Byte>, Pointer<Byte> > function;
                {