2016년 8월 24일 수요일

[KERNEL] make menuconfig error - resolve

[KERNEL] make menuconfig error - resolve 

#kernel #menuconfig

OS

  • ubuntun 12.04 LTS

Resolve 
  • $ sudo apt-get install lib32ncurses5-dev

Error Log

$ make menuconfig [enter]
scripts/kconfig/lxdialog/menubox.o: In function `do_scroll':
menubox.c:(.text+0x55): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `print_arrows':
menubox.c:(.text+0x1a4): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `do_print_item':
menubox.c:(.text+0x3a9): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `print_buttons':
menubox.c:(.text+0x4b1): undefined reference to `wrefresh'
collect2: ld returned 1 exit status
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2

Android 7.0 Nougat 소스인출

Android 7.0 Nougat source 코드가 올라왔다.

Branch 확인하고 소스인출까지 1시간 30분 정도 소요된 듯..
- https://android.googlesource.com/platform/manifest

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod +x ~/bin/repo 

$ mkdir android-7.0.0_r1
$ cd android-7.0.0_r1/

$ git config --global user.name "Wonseok.Choi"
$ git config --global user.emali "soma.wschoi@gmail.com"

$ repo init -u https://android.googlesource.com/platform/manifest
$ repo init -u https://android.googlesource.com/platform/manifest -b android-7.0.0_r1
$ repo sync

#android #nougat #repo

2014년 7월 27일 일요일

[Android] Stop Audio Player

Stop Audio Player 


        Intent intent = new Intent("com.android.music.musicservicecommand");
        intent.putExtra("command", "pause");

        mContext.sendBroadcast(intent);


MediaPlaybackService commands


 public class MediaPlaybackService extends Service {

     public static final String PLAYSTATE_CHANGED = "com.android.music.playstatechanged";
     public static final String META_CHANGED = "com.android.music.metachanged";
     public static final String QUEUE_CHANGED = "com.android.music.queuechanged";

     public static final String SERVICECMD = "com.android.music.musicservicecommand";
     public static final String CMDNAME = "command";
     public static final String CMDTOGGLEPAUSE = "togglepause";
     public static final String CMDSTOP = "stop";
     public static final String CMDPAUSE = "pause";
     public static final String CMDPLAY = "play";
     public static final String CMDPREVIOUS = "previous";
     public static final String CMDNEXT = "next";
     public static final String TOGGLEPAUSE_ACTION = "com.android.music.musicservicecommand.togglepause";
     public static final String PAUSE_ACTION = "com.android.music.musicservicecommand.pause";
     public static final String PREVIOUS_ACTION = "com.android.music.musicservicecommand.previous";
     public static final String NEXT_ACTION = "com.android.music.musicservicecommand.next";

2014년 5월 1일 목요일

[Android] Stop Running Task.

Sleep mode 진입 시 구동중인 Application을 정리(중지)
- Sleep / Wake Up 반복시 Task 쌓이는 현상을 피하기 위해 사용.


1. Stop Running Application

    private void stopExecutedApplication() {
        mRunningTaskInfo = mActivityManager.getRunningTasks(Integer.MAX_VALUE);

        for(int i = 0; i < mRunningTaskInfo.size(); i++) {
            int taskId = mRunningTaskInfo.get(i).id;
            String pkgName = mRunningTaskInfo.get(i).baseActivity.getPackageName();
            mActivityManager.removeTask(taskId, ActivityManager.REMOVE_TASK_KILL_PROCESS);
         }
     }


2014년 4월 30일 수요일

[Android] Global Action Dialog

Android 종료 PopUp

Android 기기의 Power key Long Press에 의해 나타나는 Dialog Flow 정리.
- Power Key 를 500ms 이상 누르고 있을 경우, 종료 팝업 D/P


PhoneWindowManager.java ( frameworks/base/policy/src/com/android/internal/policy/impl )
    private final Runnable mPowerLongPress = new Runnable() {
            case LONG_PRESS_POWER_GLOBAL_ACTIONS:
                mPowerKeyHandled = true;
                if (!performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false)) {
                    performAuditoryFeedbackForAccessibilityIfNeed();
                }
                sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
                showGlobalActionsDialog();

    private void interceptPowerKeyDown(boolean handled) {
        mPowerKeyHandled = handled;
        if (!handled) {
            mHandler.postDelayed(mPowerLongPress, ViewConfiguration.getGlobalActionKeyTimeout());
        }
    }

ViewConfiguration.java ( frameworks/base/core/java/android/view/ )
    /**
     * Defines the duration in milliseconds a user needs to hold down the
     * appropriate button to bring up the global actions dialog (power off,
     * lock screen, etc).
     */
    private static final int GLOBAL_ACTIONS_KEY_TIMEOUT = 500;

    /**
     * The amount of time a user needs to press the relevant key to bring up
     * the global actions dialog.
     *
     * @return how long a user needs to press the relevant key to bring up
     *   the global actions dialog.
     */
    public static long getGlobalActionKeyTimeout() {
        return GLOBAL_ACTIONS_KEY_TIMEOUT;
    }



2014년 4월 17일 목요일

[Android] Package명으로 Application 실행하기

Package 명으로 Application Start 시키기

Intent intent =
mContext.getPackageManager().getLaunchIntentForPackage(mAppName);

if (intent == null)
    Log.i(TAG,"startActivity Failed. intent is NULL");
else
    mContext.startActivity(intent);



2014년 2월 20일 목요일

[Android] Programmable Bluetooth On/Off.

Android Device의 Bluetooth On/Off 설정 제어하기.


Permissions : 

And add the following permissions into your manifest file:
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

Control On/Off : 

Sample code
public static boolean setBluetooth(boolean enable) {
    BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    boolean isEnabled = bluetoothAdapter.isEnabled();
    if (enable && !isEnabled) {
        return bluetoothAdapter.enable(); 
    }
    else if(!enable && isEnabled) {
        return bluetoothAdapter.disable();
    }
    // No need to change bluetooth state
    return true;
}

But remember these important points:
This is an asynchronous call: it will return immediately, and clients should listen for ACTION_STATE_CHANGED to be notified of subsequent adapter state changes. If this call returns true, then the adapter state will immediately transition from STATE_OFF to STATE_TURNING_ON, and some time later transition to either STATE_OFF or STATE_ON. If this call returns false then there was an immediate problem that will prevent the adapter from being turned on - such as Airplane mode, or the adapter is already turned on.