update the big hacks patch for CM
authornotaz <notasas@gmail.com>
Fri, 15 Jun 2012 00:08:43 +0000 (03:08 +0300)
committernotaz <notasas@gmail.com>
Fri, 15 Jun 2012 14:35:07 +0000 (17:35 +0300)
patches/all.patch
patches/external_custom.patch [deleted file]

index c8147ff..4519859 100644 (file)
@@ -1,10 +1,50 @@
 
+project external/hostap/
+diff --git a/external/hostap/Android.mk b/external/hostap/Android.mk
+index 77d72ea..5c6b589 100644
+--- a/external/hostap/Android.mk
++++ b/external/hostap/Android.mk
+@@ -1,3 +1,5 @@
+ ifeq ($(WPA_SUPPLICANT_VERSION),VER_0_8_X)
+-    include $(call all-subdir-makefiles)
++    #include $(call all-subdir-makefiles)
++    LOCAL_PATH := $(call my-dir)
++    include $(LOCAL_PATH)/wpa_supplicant/Android.mk
+ endif
+diff --git a/external/hostap/wpa_supplicant/config-android b/external/hostap/wpa_supplicant/config-android
+index c71056c..2532ccd 100644
+--- a/external/hostap/wpa_supplicant/config-android
++++ b/external/hostap/wpa_supplicant/config-android
+@@ -81,7 +81,7 @@
+ CONFIG_DRIVER_WEXT=y
+ # Driver interface for Linux drivers using the nl80211 kernel interface
+-CONFIG_DRIVER_NL80211=y
++#CONFIG_DRIVER_NL80211=y
+ # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
+ #CONFIG_DRIVER_BSD=y
+
+project external/openssl/
+diff --git a/external/openssl/crypto/Android.mk b/external/openssl/crypto/Android.mk
+index 222bc96..f2361a5 100644
+--- a/external/openssl/crypto/Android.mk
++++ b/external/openssl/crypto/Android.mk
+@@ -155,6 +155,7 @@ local_src_files := \
+       bn/bn_sqr.c \
+       bn/bn_sqrt.c \
+       bn/bn_word.c \
++      bn/bn_const.c \
+       buffer/buf_err.c \
+       buffer/buffer.c \
+       comp/c_rle.c \
+
 project frameworks/base/
 diff --git a/frameworks/base/libs/ui/InputReader.cpp b/frameworks/base/libs/ui/InputReader.cpp
-index 79cb87a..d8cd717 100644
+index 7626b15..16e17b3 100644
 --- a/frameworks/base/libs/ui/InputReader.cpp
 +++ b/frameworks/base/libs/ui/InputReader.cpp
-@@ -1668,12 +1668,36 @@ bool TouchInputMapper::configureSurfaceLocked() {
+@@ -1468,12 +1468,36 @@ bool TouchInputMapper::configureSurfaceLocked() {
  
          // Configure X and Y factors.
          if (mRawAxes.x.valid && mRawAxes.y.valid) {
@@ -47,7 +87,7 @@ index 79cb87a..d8cd717 100644
  
              configureVirtualKeysLocked();
          } else {
-@@ -1689,7 +1713,7 @@ bool TouchInputMapper::configureSurfaceLocked() {
+@@ -1489,7 +1513,7 @@ bool TouchInputMapper::configureSurfaceLocked() {
          // Scale factor for terms that are not oriented in a particular axis.
          // If the pixels are square then xScale == yScale otherwise we fake it
          // by choosing an average.
@@ -56,6 +96,20 @@ index 79cb87a..d8cd717 100644
  
          // Size of diagonal axis.
          float diagonalSize = pythag(width, height);
+diff --git a/frameworks/base/services/java/com/android/server/PowerManagerService.java b/frameworks/base/services/java/com/android/server/PowerManagerService.java
+index 44eb228..9444fad 100644
+--- a/frameworks/base/services/java/com/android/server/PowerManagerService.java
++++ b/frameworks/base/services/java/com/android/server/PowerManagerService.java
+@@ -766,7 +766,8 @@ class PowerManagerService extends IPowerManager.Stub
+     }
+     private void updateWakeLockLocked() {
+-        if (mStayOnConditions != 0 && mBatteryService.isPowered(mStayOnConditions)) {
++        /* pandora hack: screenoff breakage workaround */
++        if (true || mStayOnConditions != 0 && mBatteryService.isPowered(mStayOnConditions)) {
+             // keep the device on if we're plugged in and mStayOnWhilePluggedIn is set.
+             mStayOnWhilePluggedInScreenDimLock.acquire();
+             mStayOnWhilePluggedInPartialLock.acquire();
 
 project hardware/libhardware/
 diff --git a/hardware/libhardware/modules/gralloc/framebuffer.cpp b/hardware/libhardware/modules/gralloc/framebuffer.cpp
@@ -76,7 +130,102 @@ index fe57a8a..b5465e4 100644
          // If we can't do the page_flip, just copy the buffer to the front 
          // FIXME: use copybit HAL instead of memcpy
 
+project hardware/libhardware_legacy/
+diff --git a/hardware/libhardware_legacy/power/power.c b/hardware/libhardware_legacy/power/power.c
+index bca52fc..2ffadfa 100644
+--- a/hardware/libhardware_legacy/power/power.c
++++ b/hardware/libhardware_legacy/power/power.c
+@@ -254,6 +254,9 @@ set_screen_state(int on)
+     //LOGI("go_to_sleep eventTime=%lld now=%lld g_error=%s\n", eventTime,
+       //      systemTime(), strerror(g_error));
++    // pandora hack
++    return 0;
++
+     if (g_error) return g_error;
+     char buf[32];
+diff --git a/hardware/libhardware_legacy/wifi/wifi.c b/hardware/libhardware_legacy/wifi/wifi.c
+index 167402b..4e03740 100644
+--- a/hardware/libhardware_legacy/wifi/wifi.c
++++ b/hardware/libhardware_legacy/wifi/wifi.c
+@@ -695,17 +695,40 @@ int wifi_connect_to_supplicant()
+     return 0;
+ }
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <unistd.h>
++#include <sys/ioctl.h>
++#include <net/if.h>
++
+ int wifi_send_command(struct wpa_ctrl *ctrl, const char *cmd, char *reply, size_t *reply_len)
+ {
+     int ret;
++    int sock = socket(AF_INET, SOCK_DGRAM, 0);    
++    if (sock != -1) {
++        struct ifreq ifr;
++        memset(&ifr, 0, sizeof(ifr));
++        strcpy(ifr.ifr_name, "wlan0");
++
++        if (ioctl(sock, SIOCGIFFLAGS, &ifr) == 0) {
++            if (!(ifr.ifr_flags & IFF_UP)) {
++                LOGE("wlan0 is down - attempting to bring up..\n");
++                ifr.ifr_flags |= IFF_UP;
++                if (ioctl(sock, SIOCSIFFLAGS, &ifr) == 0)
++                    LOGE("wlan0 brought up\n");
++            }
++        }
++        close(sock);
++    }
++
+     if (ctrl_conn == NULL) {
+-        LOGV("Not connected to wpa_supplicant - \"%s\" command dropped.\n", cmd);
++        LOGE("Not connected to wpa_supplicant - \"%s\" command dropped.\n", cmd);
+         return -1;
+     }
+     ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), reply, reply_len, NULL);
+     if (ret == -2) {
+-        LOGD("'%s' command timed out.\n", cmd);
++        LOGE("'%s' command timed out.\n", cmd);
+         return -2;
+     } else if (ret < 0 || strncmp(reply, "FAIL", 4) == 0) {
+         return -1;
+
+project packages/providers/MediaProvider/
+diff --git a/packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java b/packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
+index 146966f..3938841 100644
+--- a/packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
++++ b/packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
+@@ -3317,8 +3317,9 @@ public class MediaProvider extends ContentProvider {
+                             Log.i(TAG, "External storage is not (yet) mounted, cannot attach volume.");
+                         }
+-                        throw new IllegalArgumentException("Unable to obtain external storage volume ID for " +
+-                                volume + " volume.");
++                        // pandora hack: ignore for now, like older Android did
++                        //throw new IllegalArgumentException("Unable to obtain external storage volume ID for " +
++                        //        volume + " volume.");
+                     }
+                     // generate database name based on volume ID
+
 project system/core/
+diff --git a/system/core/init/devices.c b/system/core/init/devices.c
+index 04f2caf..5affc06 100644
+--- a/system/core/init/devices.c
++++ b/system/core/init/devices.c
+@@ -572,6 +572,9 @@ static void handle_firmware_event(struct uevent *uevent)
+     int status;
+     int ret;
++    // pandora hack: udev is handling this for us
++    return;
++
+     if(strcmp(uevent->subsystem, "firmware"))
+         return;
 diff --git a/system/core/libsysutils/src/NetlinkListener.cpp b/system/core/libsysutils/src/NetlinkListener.cpp
 index fb088e1..f99227c 100644
 --- a/system/core/libsysutils/src/NetlinkListener.cpp
@@ -107,22 +256,3 @@ index fb088e1..f99227c 100644
      }
  
      NetlinkEvent *evt = new NetlinkEvent();
-
-project system/extras/
-diff --git a/system/extras/su/su.c b/system/extras/su/su.c
-index b87cece..bddc37d 100644
---- a/system/extras/su/su.c
-+++ b/system/extras/su/su.c
-@@ -59,10 +59,12 @@ int main(int argc, char **argv)
-     /* Until we have something better, only root and the shell can use su. */
-     myuid = getuid();
-+#if 0
-     if (myuid != AID_ROOT && myuid != AID_SHELL) {
-         fprintf(stderr,"su: uid %d not allowed to su\n", myuid);
-         return 1;
-     }
-+#endif
-     
-     if(setgid(gid) || setuid(uid)) {
-         fprintf(stderr,"su: permission denied\n");
diff --git a/patches/external_custom.patch b/patches/external_custom.patch
deleted file mode 100644 (file)
index 83db36e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-
-project external_custom/android-terminal-emulator/
-diff --git a/external_custom/android-terminal-emulator/Android.mk b/external_custom/android-terminal-emulator/Android.mk
-index 6f95cb4..a9ece36 100644
---- a/external_custom/android-terminal-emulator/Android.mk
-+++ b/external_custom/android-terminal-emulator/Android.mk
-@@ -30,7 +30,7 @@ LOCAL_PACKAGE_NAME := AndroidTerm
- LOCAL_MODULE_TAGS := optional
--LOCAL_JNI_SHARED_LIBRARIES := libjackpal-androidterm3
-+LOCAL_JNI_SHARED_LIBRARIES := libjackpal-androidterm3-pnd
- include $(BUILD_PACKAGE)
-diff --git a/external_custom/android-terminal-emulator/jni/Android.mk b/external_custom/android-terminal-emulator/jni/Android.mk
-index da25a8f..eaa764c 100644
---- a/external_custom/android-terminal-emulator/jni/Android.mk
-+++ b/external_custom/android-terminal-emulator/jni/Android.mk
-@@ -21,7 +21,7 @@ LOCAL_PATH:= $(call my-dir)
- include $(CLEAR_VARS)
- # This is the target being built.
--LOCAL_MODULE:= libjackpal-androidterm3
-+LOCAL_MODULE:= libjackpal-androidterm3-pnd
- # All of the source files that we will compile.
- LOCAL_SRC_FILES:= \
-@@ -29,4 +29,8 @@ LOCAL_SRC_FILES:= \
- LOCAL_LDLIBS := -ldl -llog
-+LOCAL_SHARED_LIBRARIES := liblog
-+LOCAL_PRELINK_MODULE := false
-+LOCAL_MODULE_TAGS := optional
-+
- include $(BUILD_SHARED_LIBRARY)
-diff --git a/external_custom/android-terminal-emulator/src/jackpal/androidterm/Exec.java b/external_custom/android-terminal-emulator/src/jackpal/androidterm/Exec.java
-index b2f342f..9bad15f 100644
---- a/external_custom/android-terminal-emulator/src/jackpal/androidterm/Exec.java
-+++ b/external_custom/android-terminal-emulator/src/jackpal/androidterm/Exec.java
-@@ -30,7 +30,7 @@ import java.io.FileDescriptor;
- public class Exec
- {
-     static {
--        System.loadLibrary("jackpal-androidterm3");
-+        System.loadLibrary("jackpal-androidterm3-pnd");
-     }
-     /**