android에서 MAC 강제 셋팅하는 두가지 방법


ip link show eth0

ip link set eth0 address 11:22:33:44:55:55




ifconfig eth0 down

ifconfig eth0 hw ether 11:22:33:44:55:66

ifconfig eth0 up


** ifconfig 설정이 안먹히는 경우가 있다.

** busybox 가 있다면 ifconfig -> busybox ifconfig 로 사용하길 바란다.










external/guava/guava/src/com/google/common/reflect/Types.java:317: error: TypeVariableImpl is not abstract and does not override abstract method getAnnotatedBounds() in TypeVariable private static final class TypeVariableImpl<D extends GenericDeclaration>



index 0f05f78..be358c7 100644



--- a external/guava/guava/src/com/google/common/reflect/Types.java



+++ b external/guava/guava/src/com/google/common/reflect/Types.java



@@ -19,30 +19,36 @@
1919 import static com.google.common.base.Preconditions.checkArgument;

2020 import static com.google.common.base.Preconditions.checkNotNull;

2121 import static com.google.common.collect.Iterables.transform;

2222 

2323 import com.google.common.annotations.VisibleForTesting;

2424 import com.google.common.base.Function;

2525 import com.google.common.base.Joiner;

2626 import com.google.common.base.Objects;

2727 import com.google.common.base.Predicates;

2828 import com.google.common.collect.ImmutableList;


29+import com.google.common.collect.ImmutableMap;

2930 import com.google.common.collect.Iterables;

3031 

3132 import java.io.Serializable;

3233 import java.lang.reflect.Array;

3334 import java.lang.reflect.GenericArrayType;

3435 import java.lang.reflect.GenericDeclaration;


36+import java.lang.reflect.InvocationHandler;


37+import java.lang.reflect.InvocationTargetException;


38+import java.lang.reflect.Method;

3539 import java.lang.reflect.ParameterizedType;


40+import java.lang.reflect.Proxy;

3641 import java.lang.reflect.Type;

3742 import java.lang.reflect.TypeVariable;

3843 import java.lang.reflect.WildcardType;


44+import java.security.AccessControlException;

3945 import java.util.Arrays;

4046 import java.util.Collection;

4147 import java.util.concurrent.atomic.AtomicReference;

4248 

4349 import javax.annotation.Nullable;

4450 

4551 /**

4652  * Utilities for working with {@link Type}.

4753  *

4854  * @author Ben Yu



@@ -139,21 +145,21 @@

139145  throw new AssertionError();

140146  }

141147  }

142148 

143149  /**

144150  * Returns a new {@link TypeVariable} that belongs to {@code declaration} with

145151  * {@code name} and {@code bounds}.

146152  */

147153  static <D extends GenericDeclaration> TypeVariable<D> newArtificialTypeVariable(

148154  D declaration, String name, Type... bounds) {

149
- return new TypeVariableImpl<D>(


155+ return newTypeVariableImpl(

150156  declaration,

151157  name,

152158  (bounds.length == 0)

153159  ? new Type[] { Object.class }

154160  : bounds);

155161  }

156162 

157163  /** Returns a new {@link WildcardType} with {@code upperBound}. */

158164  @VisibleForTesting static WildcardType subtypeOf(Type upperBound) {

159165  return new WildcardTypeImpl(new Type[0], new Type[] { upperBound });



@@ -307,59 +313,135 @@

307313  ParameterizedType that = (ParameterizedType) other;

308314  return getRawType().equals(that.getRawType())

309315  && Objects.equal(getOwnerType(), that.getOwnerType())

310316  && Arrays.equals(

311317  getActualTypeArguments(), that.getActualTypeArguments());

312318  }

313319 

314320  private static final long serialVersionUID = 0;

315321  }

316322 

317
- private static final class TypeVariableImpl<D extends GenericDeclaration>

318
- implements TypeVariable<D> {


323+ private static <D extends GenericDeclaration> TypeVariable<D> newTypeVariableImpl(


324+ D genericDeclaration, String name, Type[] bounds) {


325+ TypeVariableImpl<D> typeVariableImpl =


326+ new TypeVariableImpl<D>(genericDeclaration, name, bounds);


327+ @SuppressWarnings("unchecked")


328+ TypeVariable<D> typeVariable = Reflection.newProxy(


329+ TypeVariable.class, new TypeVariableInvocationHandler(typeVariableImpl));


330+ return typeVariable;


331+ }


332+


333+ /**


334+ * Invocation handler to work around a compatibility problem between Java 7 and Java 8.


335+ *


336+ * <p>Java 8 introduced a new method {@code getAnnotatedBounds()} in the {@link TypeVariable}


337+ * interface, whose return type {@code AnnotatedType[]} is also new in Java 8. That means that we


338+ * cannot implement that interface in source code in a way that will compile on both Java 7 and


339+ * Java 8. If we include the {@code getAnnotatedBounds()} method then its return type means


340+ * it won't compile on Java 7, while if we don't include the method then the compiler will


341+ * complain that an abstract method is unimplemented. So instead we use a dynamic proxy to


342+ * get an implementation. If the method being called on the {@code TypeVariable} instance has


343+ * the same name as one of the public methods of {@link TypeVariableImpl}, the proxy calls


344+ * the same method on its instance of {@code TypeVariableImpl}. Otherwise it throws {@link


345+ * UnsupportedOperationException}; this should only apply to {@code getAnnotatedBounds()}. This


346+ * does mean that users on Java 8 who obtain an instance of {@code TypeVariable} from {@link


347+ * TypeResolver#resolveType} will not be able to call {@code getAnnotatedBounds()} on it, but that


348+ * should hopefully be rare.


349+ *


350+ * <p>This workaround should be removed at a distant future time when we no longer support Java


351+ * versions earlier than 8.


352+ */


353+ private static final class TypeVariableInvocationHandler implements InvocationHandler {


354+ private static final ImmutableMap<String, Method> typeVariableMethods;


355+ static {


356+ ImmutableMap.Builder<String, Method> builder = ImmutableMap.builder();


357+ for (Method method : TypeVariableImpl.class.getMethods()) {


358+ if (method.getDeclaringClass().equals(TypeVariableImpl.class)) {


359+ try {


360+ method.setAccessible(true);


361+ } catch (AccessControlException e) {


362+ // OK: the method is accessible to us anyway. The setAccessible call is only for


363+ // unusual execution environments where that might not be true.


364+ }


365+ builder.put(method.getName(), method);


366+ }


367+ }


368+ typeVariableMethods = builder.build();


369+ }


370+


371+ private final TypeVariableImpl<?> typeVariableImpl;


372+


373+ TypeVariableInvocationHandler(TypeVariableImpl<?> typeVariableImpl) {


374+ this.typeVariableImpl = typeVariableImpl;


375+ }


376+


377+ @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {


378+ String methodName = method.getName();


379+ Method typeVariableMethod = typeVariableMethods.get(methodName);


380+ if (typeVariableMethod == null) {


381+ throw new UnsupportedOperationException(methodName);


382+ } else {


383+ try {


384+ return typeVariableMethod.invoke(typeVariableImpl, args);


385+ } catch (InvocationTargetException e) {


386+ throw e.getCause();


387+ }


388+ }


389+ }


390+ }


391+


392+ private static final class TypeVariableImpl<D extends GenericDeclaration> {

319393 

320394  private final D genericDeclaration;

321395  private final String name;

322396  private final ImmutableList<Type> bounds;

323397 

324398  TypeVariableImpl(D genericDeclaration, String name, Type[] bounds) {

325399  disallowPrimitiveType(bounds, "bound for type variable");

326400  this.genericDeclaration = checkNotNull(genericDeclaration);

327401  this.name = checkNotNull(name);

328402  this.bounds = ImmutableList.copyOf(bounds);

329403  }

330404 

331
- @Override public Type[] getBounds() {


405+ public Type[] getBounds() {

332406  return toArray(bounds);

333407  }

334408 

335
- @Override public D getGenericDeclaration() {


409+ public D getGenericDeclaration() {

336410  return genericDeclaration;

337411  }

338412 

339
- @Override public String getName() {


413+ public String getName() {


414+ return name;


415+ }


416+


417+ public String getTypeName() {

340418  return name;

341419  }

342420 

343421  @Override public String toString() {

344422  return name;

345423  }

346424 

347425  @Override public int hashCode() {

348426  return genericDeclaration.hashCode() ^ name.hashCode();

349427  }

350428 

351429  @Override public boolean equals(Object obj) {

352430  if (NativeTypeVariableEquals.NATIVE_TYPE_VARIABLE_ONLY) {

353431  // equal only to our TypeVariable implementation with identical bounds

354
- if (obj instanceof TypeVariableImpl) {

355
- TypeVariableImpl<?> that = (TypeVariableImpl<?>) obj;


432+ if (obj != null


433+ && Proxy.isProxyClass(obj.getClass())


434+ && Proxy.getInvocationHandler(obj) instanceof TypeVariableInvocationHandler) {


435+ TypeVariableInvocationHandler typeVariableInvocationHandler =


436+ (TypeVariableInvocationHandler) Proxy.getInvocationHandler(obj);


437+ TypeVariableImpl<?> that = typeVariableInvocationHandler.typeVariableImpl;

356438  return name.equals(that.getName())

357439  && genericDeclaration.equals(that.getGenericDeclaration())

358440  && bounds.equals(that.bounds);

359441  }

360442  return false;

361443  } else {

362444  // equal to any TypeVariable implementation regardless of bounds

363445  if (obj instanceof TypeVariable) {

364446  TypeVariable<?> that = (TypeVariable<?>) obj;

365447  return name.equals(that.getName())


$ lsusb
Bus 002 Device 023: ID 2207:0010
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

In this case, the description of the device (a Vido N70 tablet in this case) was left empty.

  • Download and install the Android SDK. Or, alternatively, just download adb from an Ubuntu Linux with this command:
  sudo apt-get install android-tools-adb
  • Log in as root and create the file "/etc/udev/rules.d/51-android.rules" with the following content:
SUBSYSTEM=="usb", ATTR{idVendor}=="2207", MODE="0666", GROUP="plugdev"
  • As root, restart udev with "udevadm control --reload-rules"
  • Log in with your normal unix user, and edit ~/.android/adb_usb.ini, add 0x2207 at the end of the file
  • As user, restart the adb server with "adb kill-server; adb start-server"
  • As user, you should be able to list your device with "adb devices"


아래와 같은 에러가 난다면 kernel/arch/arm/mach-exynos/mach-smdk4x12.c 파일에서 다음을 확인하라.

MACHINE_START(SMDK4412, "SMDK4X12")

SMDK4X12  가 아닌 다른 것으로 되어 있어서 이다.


[    2.732117] Freeing init memory: 248K
[    2.741706] init: could not import file '/init.smdk4x12.rc' from '/init.rc'
[    2.743152] init (1): /proc/1/oom_adj is deprecated, please use /proc/1/oom_score_adj instead.
[    2.822799] init: cannot open '/initlogo.rle'
[    2.996371] init: Unable to open persistent property directory /data/property errno: 2
[    3.001587] init: cannot find '/system/bin/servicemanager', disabling 'servicemanager'
[    3.006572] init: cannot find '/system/bin/vold', disabling 'vold'
[    3.012736] init: cannot find '/system/bin/netd', disabling 'netd'
[    3.018892] init: cannot find '/system/bin/debuggerd', disabling 'debuggerd'
[    3.025924] init: cannot find '/system/bin/rild', disabling 'ril-daemon'
[    3.032609] init: cannot find '/system/bin/surfaceflinger', disabling 'surfaceflinger'
[    3.040508] init: cannot find '/system/bin/app_process', disabling 'zygote'
[    3.047451] init: cannot find '/system/bin/drmserver', disabling 'drm'
[    3.053960] init: cannot find '/system/bin/mediaserver', disabling 'media'
[    3.060824] init: cannot find '/system/bin/installd', disabling 'installd'
[    3.061130] failed to copy MFC F/W during init
[    3.072205] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
[    3.080437] init: cannot find '/system/bin/keystore', disabling 'keystore'
[    3.087775] init: cannot find '/system/bin/sh', disabling 'console'

android build 시 mtd-utils 에서 아래와 같이 에러가 날때....


sudo apt-get install uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev



host C: mkfs.ubifs <= external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c
host C: mkfs.ubifs <= external/mtd-utils/mkfs.ubifs/devtable.c
host C: mkfs.ubifs <= external/mtd-utils/mkfs.ubifs/lpt.c
In file included from external/mtd-utils/mkfs.ubifs/devtable.c:47:0:
external/mtd-utils/mkfs.ubifs/mkfs.ubifs.h:48:23: fatal error: uuid/uuid.h: 그런 파일이나 디렉터리가 없습니다
 #include <uuid/uuid.h>
                       ^
compilation terminated.
In file included from external/mtd-utils/mkfs.ubifs/lpt.c:23:0:
external/mtd-utils/mkfs.ubifs/mkfs.ubifs.h:48:23: fatal error: uuid/uuid.h: 그런 파일이나 디렉터리가 없습니다
 #include <uuid/uuid.h>
                       ^
compilation terminated.
host C: mkfs.ubifs <= external/mtd-utils/mkfs.ubifs/compr.c
In file included from external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:23:0:
external/mtd-utils/mkfs.ubifs/mkfs.ubifs.h:48:23: fatal error: uuid/uuid.h: 그런 파일이나 디렉터리가 없습니다
 #include <uuid/uuid.h>
                       ^
compilation terminated.
external/mtd-utils/mkfs.ubifs/compr.c:28:23: fatal error: lzo/lzo1x.h: 그런 파일이나 디렉터리가 없습니다
 #include <lzo/lzo1x.h>
                       ^
compilation terminated.
host C: sqlite3 <= external/sqlite/dist/sqlite3.c
host C: sqlite3 <= external/sqlite/dist/shell.c
make: *** [out/host/linux-x86/obj/EXECUTABLES/mkfs.ubifs_intermediates/devtable.o] 오류 1
make: *** 끝나지 않은 작업을 기다리고 있습니다....
make: *** [out/host/linux-x86/obj/EXECUTABLES/mkfs.ubifs_intermediates/mkfs.ubifs.o] 오류 1
make: *** [out/host/linux-x86/obj/EXECUTABLES/mkfs.ubifs_intermediates/lpt.o] 오류 1
make: *** [out/host/linux-x86/obj/EXECUTABLES/mkfs.ubifs_intermediates/compr.o] 오류 1

Ubuntu 13.10 에서 Gingerbread source 빌드할 때 에러나는 부분 수정


1.
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::wp<android::AssetManager::SharedZip> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o] Error1

Fix:
vim frameworks/base/libs/utils/Android.mk

 57 LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
 58 LOCAL_CFLAGS += -fpermissive  //添加此行。


2.
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptDir> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] Error 1

Fix:
vi frameworks/base/tools/aapt/Android.mk

Add '-fpermissive' to line 31:
LOCAL_CFLAGS += -Wno-format-y2k -fpermissive



3.
make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] 错误 1
    或者 make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] Error 1
     cd external/srec
     wget "https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff"
     patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
    rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
    cd ../..



4.
external/webkit/WebCore/dom/make_names.pl
-my $preprocessor = "/usr/bin/gcc -E -P -x c++";
+my $preprocessor = "/usr/bin/gcc -E -x c++";


5.
build/core/combo/HOST_linux-x86.mk
 60 # Disable new longjmp in glibc 2.11 and later. See bug 2967937.
 61 #HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
 62 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

6.
make: *** [out/host/linux-x86/obj/EXECUTABLES/mksnapshot_intermediates/src/api.o] 오류 1

sudo apt-get install gcc-4.4-multilib g++-4.4-multilib
export PATH=$HOME/bin:$PATH

7.
external/v8/src/globals.h:605:3: error: ‘memcpy’ was not declared in this scope
// append
55: #include <string.h>


8.
external/v8/src/objects.h:2128:60: error: ‘get’ was not declared in this scope
fix:
vi external/v8/Android.mksnapshot.mk
Add '-fpermissive' to line 60
LOCAL_CFLAGS := \
        -Wno-endif-labels \
        -Wno-import \
        -Wno-format \
        -ansi \
        -fno-rtti \
        -DENABLE_DEBUGGER_SUPPORT \
        -DV8_NATIVE_REGEXP -fpermissive


4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff


Ubuntu 13.10(14.04) 에서 android build  시 에러 메세지 수정 포인트


Error 1
make gets killed at some point

Fix: you need more RAM to finish the build.


Error 2

Code:
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptDir> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] Error 1
Fix:
  • $ kwrite frameworks/base/tools/aapt/Android.mk
  • Add '-fpermissive' to line 31:
    • LOCAL_CFLAGS += -Wno-format-y2k -fpermissive


Error 3
Code:
frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::wp<android::AssetManager::SharedZip> >’ are not found by unqualified lookup

frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o] Error 1
Fix:
  • $ kwrite frameworks/base/libs/utils/Android.mk
  • Add '-fpermissive' to line 64:
    • LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive


Error 4
Code:
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: note: use ‘this->SetState’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] Error 1
Fix:
  • $ cd external/srec
  • $ wget "https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff"
  • $ patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
  • $ rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
  • $ cd ../..


Error 5
Code:
development/tools/emulator/opengl/host/tools/emugen/main.cpp:79:9: error: ‘optind’ was not declared in this scope
development/tools/emulator/opengl/host/tools/emugen/main.cpp:92:45: error: ‘optind’ was not declared in this scope
make: *** [out/host/linux-x86/obj/EXECUTABLES/emugen_intermediates/main.o] Error 1
Fix:
  • $ kwrite development/tools/emulator/opengl/host/tools/emugen/main.cpp
  • Add '#include <getopt.h>' to list of includes:
    • #include <getopt.h>


Error 6
Code:
host C++: liboprofile_pp <= external/oprofile/libpp/arrange_profiles.cpp
In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0:
external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o] Error 1
Fix:
  • $ kwrite external/oprofile/libpp/format_output.h
  • Remove 'mutable' from 'mutable counts_t & counts;' on line 94:
    • counts_t & counts;


Error 7
Code:
development/tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.cpp:345:65:   required from here

frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<unsigned int, ShaderData*>’ are not found by unqualified lookup

frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libOpenglCodecCommon_intermediates/GLSharedGroup.o] Error 1
Fix:
  • $ kwrite development/tools/emulator/opengl/Android.mk
  • Add '-fpermissive' to line 25:
    • EMUGL_COMMON_CFLAGS := -DWITH_GLES2 -fpermissive


Error 8
Code:
/usr/bin/ld: note: 'XInitThreads' is defined in DSO /lib/libX11.so.6 so try adding it to the linker command line
/lib/libX11.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/emulator_renderer] Error 1
Fix:
  • $ kwrite development/tools/emulator/opengl/host/renderer/Android.mk
  • Add new entry 'LOCAL_LDLIBS += -lX11' after line 6 as shown:
    • LOCAL_SRC_FILES := main.cpp
      LOCAL_CFLAGS += -O0 -g
      LOCAL_LDLIBS += -lX11

      #ifeq ($(HOST_OS),windows)
      #LOCAL_LDLIBS += -lws2_32


Error 9
Code:
external/llvm/include/llvm/ADT/PointerUnion.h:56:10: error: enumeral mismatch in conditional expression: ‘llvm::PointerLikeTypeTraits<llvm::PointerUnion<clang::Stmt*, const clang::Type*> >::<anonymous enum>’ vs ‘llvm::PointerLikeTypeTraits<clang::eek:bjCInterfaceDecl*>::<anonymous enum>’ [-Werror]
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs.o] Error 1
Fix:
  • $ kwrite frameworks/compile/slang/Android.mk
  • Remove '-Werror' from line 22:
    • local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter


Error 10
Code:
frameworks/base/libs/rs/rsFont.cpp:224:76:   required from here

frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<unsigned int, android::renderscript::Font::CachedGlyphInfo*>’ are not found by unqualified lookup

frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libRS_intermediates/rsFont.o] Error 1
Fix:
  • $ kwrite frameworks/base/libs/rs/Android.mk
  • Add '-fpermissive' to line 183:
    • LOCAL_CFLAGS += -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -fpermissive


Error 11
Code:
external/mesa3d/src/glsl/linker.cpp:1394:49: error: expected primary-expression before ‘,’ token
......
external/mesa3d/src/glsl/linker.cpp:1734:59: error: ‘offsetof’ was not declared in this scope
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1
Fix:
  • $ kwrite external/mesa3d/src/glsl/linker.cpp
  • Add '#include <stddef.h>' to list of includes as shown:
    • #include <climits>
      #include <stddef.h>
      #include <pixelflinger2/pixelflinger2_interface.h>


Error 12
Code:
external/gtest/src/../include/gtest/gtest-param-test.h:287:58: note: ‘template<class Container> testing::internal::ParamGenerator<typename Container::value_type> testing::ValuesIn(const Container&)’ declared here, later in the translation unit
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_host_intermediates/gtest-all.o] Error 1
Fix 1:
  • $ kwrite external/gtest/src/Android.mk
  • Add '-fpermissive' to lines 52 and 70 (both lines contain same info)
    • LOCAL_CFLAGS += -O0 -fpermissive
Fix 2:
  • $ kwrite external/gtest/include/gtest/internal/gtest-param-util.h
  • Add '#include <stddef.h>' to list of includes as shown:
    • #include <vector>
      #include <stddef.h>
      #include <gtest/internal/gtest-port.h>


Error 13
Code:
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function ‘static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)’:
frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_export_foreach.o] Error 1
Fix:
  • $ kwrite kwrite frameworks/compile/slang/Android.mk
  • change
    • local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
  • to
    • local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter


Error 14


Code:
dalvik/vm/native/dalvik_system_Zygote.cpp: In function ‘int setrlimitsFromArray(ArrayObject*)’:
dalvik/vm/native/dalvik_system_Zygote.cpp:199:19: error: aggregate ‘setrlimitsFromArray(ArrayObject*)::rlimit rlim’ has incomplete type and cannot be defined
     struct rlimit rlim;
                   ^
dalvik/vm/native/dalvik_system_Zygote.cpp:222:43: error: ‘setrlimit’ was not declared in this scope
         err = setrlimit(contents[0], &rlim);
                                           ^
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1
make: *** Waiting for unfinished jobs....
Fix:
diff --git a/vm/native/dalvik_system_Zygote.cpp b/vm/native/dalvik_system_Zygote.cpp
index 8224656..f4102e8 100644
--- a/vm/native/dalvik_system_Zygote.cpp
+++ b/vm/native/dalvik_system_Zygote.cpp
@@ -19,6 +19,7 @@
  */
 #include "Dalvik.h"
 #include "native/InternalNativePriv.h"
+#include <sys/resource.h>
 
 #include 
 #if (__GNUC__ == 4 && __GNUC_MINOR__ == 7)



Error 15

/usr/include/zlib.h:34:fatal error: zconf.h: No such file or directory

system/core/gpttool/gpttool.c:

make[3]: ***[out/host/linux-x86/obj/EXECUTABLES/gpttool_intermediates/gpttool.o] Error 1

 

Fix.

sudo apt-get install zlib1g-dev

sudo cp  /usr/include/x86_64-linux-gnu/zconf.h  /usr/include/



Error 16

make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] 오류 1


Fix.

vi  build/core/combo/HOST_linux-x86.mk

 56 ## bumnux
 57 #HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
 58 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0



Error 17

make: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] 오류 1

Fix.

vi  external/llvm/llvm-host-build.mk

 38 ## bumnux
 39 LOCAL_LDLIBS := -lpthread -ldl



Error 18

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_context.o] 오류 1

Fix.

 22 ## bumnux
 23 ##local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
 24 local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter


Error 19
                 from art/compiler/dex/quick/x86/codegen_x86.h:20,
                 from art/compiler/dex/quick/x86/fp_x86.cc:17:
external/llvm/include/llvm/InitializePasses.h:144:49: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://source.android.com/source/report-bugs.html> for instructions.
make: *** [out/target/product/smdk4x12/obj/SHARED_LIBRARIES/libart-compiler_intermediates/dex/quick/x86/fp_x86.o] 오류 1


Fix.

sudo apt-get install --reinstall gcc gcc-4.6 gcc-4.6-base libgcc1 cpp-4.6


Android 어플에서 바이너리 실행하기

어플은 잘 모르지만 국책과제를 하고 있어서 바이너리를 어플에서 어떻게 실행할 수 있을까 고민을 했다.

서비스로 등록해서 실행해 볼까도 해봤는데 어플을 잘 몰라서 구현을 못했었다.

고민을 하다가 구글 아저씨에게 물어보니 "Runtime.getRuntime().exec()를 사용하면 된다는 것이다.

참 쉬운 것을 어렵게 어렵게 알아냈다. @.@...

아래와 같이 사용하면 된다.


import java.io.IOException;


        // bumnux - Starting Superscan
        try{
            Log.v("Running superscan...");       
            Runtime.getRuntime().exec("superscan ra0 scan");
        } catch (IOException e) {
            Log.v("[Error] Running superscan...");       
        }

android apk를 프로그램 할 때..

internal storage에 저장 하려는 중 permission denied 이 나오는 경우가 있는데

AndroidManifest.xml에서 다음 부분이 없기 때문이다.


</application>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>


android  LOCK screen 안보이게 하기

--- frameworks/base/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java (리비전 15)

+++ frameworks/base/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java (작업 사본)

@@ -553,7 +553,7 @@

             }

 

             if (DEBUG) Log.d(TAG, "doKeyguard: showing the lock screen");

-            showLocked();

+            //showLocked();

         }

     }


bootanimation.zip


desc.txt 파일 내용

512 256 30

p 1 0 part0
p 0 0 part1

'523' is the width of the animation
'256' is the height of the animation
'30' is the desired fps of the animation
'p' defines a animation part
'1' how many times this animation part loops
'0' defines a pause (max 10)
'part0' is the folder name where the animation images are
'p' defines another animation part
'0' defines that it loops forever (until android starts)
'0' defines a pause
'part1' is the folder for the second animation part.

Android 에서 /system 영역 read-write 권한으로 마운트 하기.

mount -o remount,rw -t ext4 /dev/block/mmcblk0p2 /system

'Android > 공통' 카테고리의 다른 글

android LOCK screen 안보이게 하기  (0) 2012.09.28
bootanimation.zip  (0) 2012.09.03
Telephony 기능  (0) 2011.11.30
Bluetooth SPP test  (0) 2011.11.01
리눅스 커널과 안드로이드의 Suspend/Resume  (0) 2011.10.31

repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r1

Get https://android.googlesource.com/tools/repo/clone.bundle

... A new repo command ( 1.17) is available.
... You should upgrade soon:

    cp /home/bumnux/SDB/work/Google/android-4.1.1_r1/.repo/repo/repo /bin/repo

--------------------------------------------------------------------------------------------------------------------------------------------------------

From https://android.googlesource.com/platform/manifest
 * [new branch]      android-4.1.1_r1 -> origin/android-4.1.1_r1
 * [new branch]      jb-dev     -> origin/jb-dev
   3954196..6f05645  master     -> origin/master
   b5a0d13..b767923  master-dalvik -> origin/master-dalvik
 * [new tag]         android-4.1.1_r1 -> android-4.1.1_r1
 * [new tag]         android-4.1.1_r1_ -> android-4.1.1_r1_

Your Name  [bumnux]:

Get https://android.googlesource.com/platform/manifest

repo sync

... A new repo command ( 1.17) is available.
... You should upgrade soon:

    cp /home/bumnux/SDB/work/Google/android-4.1.1_r1/.repo/repo/repo /bin/repo

From /home/bumnux/SDB/work/Google/android-4.1.1_r1/.repo/projects/abi/cpp.git/clone.bundle

[펌] http://icess.egloos.com/3279459

안드로이드
SDK에서 단말기의 모뎀에서 제공하는 전화기능에 관련된 내용은 
android.telephony 패키지의 TelephonyManager클래스에서 담당한다.

단말기의 모뎀상태에 대한 정보를 얻기 위해서는 READ_PHONE_STATE권한이 필요하다.
AndroidManifest.xml파일에 아래 내용을 추가한다.
<uses-permission 
android:name="android.permission.READ_PHONE_STATE">
</uses-permission>

◆ 단말기의 모뎀상태 조회
TelephonyManager 객체를 얻기 위해서는 Context 객체에서 제공하는 getSystemService() 메서드를 이용한다.
TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);

음성통화 상태 조회
CALL_STATE_IDLE/CALL_STATE_OFFHOOK/CALL_STATE_RINGING 등의 값을 반환
Log.d("PHONE", "getCallState :" + tm.getCallState());
데이터통신 상태 조회
DATA_DISCONNECTED/DATA_CONNECTING/DATA_CONNECTED/DATA_SUSPENDED 등의 값을 반환
Log.d("PHONE", "getDataState :" + tm.getDataState());
단말기 ID 조회
GSM방식 IMEI 또는 CDMA방식의 MEID 값을 반환
Log.d("PHONE", "getDeviceId :" + tm.getDeviceId());
SW버전 조회
GSM방식의 IMEI/SV와 같은 SW버전을 반환
Log.d("PHONE", "getDeviceSoftwareVersion :" + tm.getDeviceSoftwareVersion());
전화번호 조회
GSM방식의 MSISDN과 같은 전화번호 반환
Log.d("PHONE", "getLine1Number :" + tm.getLine1Number());
국가코드 조회
현재 등록된 망 사업자의 MCC(Mobile Country Code)에 대한 ISO 국가코드 반환
Log.d("PHONE", "getNETWORKCountryIso :" + tm.getNetworkCountryIso());
Log.d("PHONE", "getSimCountryIso :" + tm.getSimCountryIso());
망 사업자코드 조회
현재 등록된 망 사업자의 MCC+MNC(Mobile Network Code) 반환
Log.d("PHONE", "getNetworkOperator :" + tm.getNetworkOperator());
Log.d("PHONE", "getSimOperator :" + tm.getSimOperator());
망 사업자명 조회
현재 등록된 망 사업자명 반환
Log.d("PHONE", "getNetworkOperatorName :" + tm.getNetworkOperatorName());
Log.d("PHONE", "getSimOperatorName :" + tm.getSimOperatorName());
망 시스템 방식 조회
현재 단말기에서 사용중인 망 시스템 방식을 반환
NETWORK_TYPE_UNKNOWN/
GSM방식 :  NETWORK_TYPE_GPRS/NETWORK_TYPE_EDGE/NETWORK_TYPE_UMTS/
NETWORK_TYPE_HSDPA/NETWORK_TYPE_HSUPA/NETWORK_TYPE_HSPA
CDMA방식 : NETWORK_TYPE_CDMA/NETWORK_TYPE_EVDO_0/NETWORK_TYPE_EVDO_A/NETWORK_TYPE_1xRTT
Log.d("PHONE", "getNetworkType :" + tm.getNetworkType());
단말기 종류 조회
단말기에서 지원하는 망의 종류를 반환
PHONE_TYPE_NONE/PHONE_TYPE_GSM/PHONE_TYPE_CDMA 등의 값을 반환
Log.d("PHONE", "getPhoneType :" + tm.getPhoneType());
SIM카드 Serial Number 조회
Log.d("PHONE", "getSimSerialNumber :" + tm.getSimSerialNumber());
SIM카드 상태 조회
SIM_STATE_UNKNOWN/SIM_STATE_ABSENT/SIM_STATE_PIN_REQUIRED/SIM_STATE_PUK_REQUIRED/
SIM_STATE_NETWORK_LOCKED/SIM_STATE_READY 등의 값을 반환
Log.d("PHONE", "getSimState :" + tm.getSimState());
가입자 ID 조회
GSM방식의 IMSI와 같은 가입자 ID 반환
Log.d("PHONE", "getSubscriberId :" + tm.getSubscriberId());

◆ 조회결과
getCallState :0(CALL_STATE_IDLE)
getDataState :2(DATA_ACTIVITY_OUT)
getDeviceId :000000000000000
getDeviceSoftwareVersion :null
getLine1Number :15555218135
getNetworkCountryIso :us
getNetworkOperator :310260
getNetworkOperatorName :Android
getNetworkType :3(NETWORK_TYPE_UMTS)
getPhoneType :1(PHONE_TYPE_GSM)
getSimCountryIso :us
getSimOperator :310260
getSimOperatorName :Android
getSimSerialNumber :89014103211118510720
getSimState :5(SIM_STATE_READY)
getSubscriberId :310260000000000

실제상황에서는 이와같이 현재 단말기의 상태를 직접 조회하는것이 아니라 
상태정보가 변경될 때 자동으로 인식해야하는 상황이 훨씬 많을것이다.
이럴때는 TelephonyManager의 listen()를 이용하여 콜백메서드를 등록하면 가능하다.
        tm.listen(new PhoneStateListener(){
         public void onCallStateChanged(int state, String incomingNumber){
         if (state == TelephonyManager.CALL_STATE_RINGING){
         Log.d("Telephony", "state = " + state + ", number = " + incomingNumber);
         }else{
         Log.d("Telephony", "state = " + state);
         }        
         }
        }, PhoneStateListener.LISTEN_CALL_STATE);

onCallStateChanged() 이외에도 아래와 같은 상태변화를 감지할 수 있다.
- onCallForwardingIndicatorChanged() : 호전환(Call Forwarding) 상태 변화
- onCellLocationChanged() : 단말기의 Cell위치 변화
- onDataActivity() : Data 활성화 상태 변화
- onDataConnectionStateChanged() : Data 연결상태 변화
- onMessageWaitingIndicatorChanged() : 메시지 대기상태 변화
- onServiceStateChanged() : 단말기의 서비스 상태 변화
- onSignalStrengthsChanged() : 망의 신호강도 변화

◆ 전화번호 처리
각 국가별로 전화번호의 형식이 다르다. 
한국은 01x-xxxx-xxxx 이 일반적이고,
북미는 xxx-xxx-xxxx가 된다.
PhoneNumberUtils.formatNumber() 메서드를 사용하면 설정된 Locale에 맞게 형식화 된다.
String formattedTelNumber = PhoneNumberUtils.formatNumber("01098761234");
        Log.d("Telephony", "formattedTelNumber :" + formattedTelNumber);
Locale을 English(United States)로 할경우 010-987-61234로 출력된다.
한국어로 할 경우는 01098761234가 그대로 출력된다.
formatNumber() 메서드의 구현내용을 살펴봐야 할듯 하다.

EditText에서 전화번호를 입력받을 경우에도 자동으로 형식화가 가능하다.
EditText객체의 addTextChangedListener에 PhoneNumberFormattingTextWatcher()를 등록하기만 하면 된다.
        EditText tn = (EditText) findViewById(R.id.edtTelNumber);
        tn.addTextChangedListener(new PhoneNumberFormattingTextWatcher());
그러나 역시 한국어로는 동작하지 않았다.

출처:Telephony 기능
1. source build/envsetup.sh

2. lunch
    ==> 해당 deivce 선택

3. mmm package/apps/Phone

4. make snod ( image 생성)

+ Recent posts