• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Android » Android forum » Android upper always restart
Share
Android
  • Forum
Options
  • Subscribe via RSS

Forums

Android upper always restart

This question is not answered
yanhong wu
Posted by yanhong wu
on May 10 2012 19:21 PM
Intellectual350 points

Hi,all
   In the input subsystem, I add another reader thread .Implementation method is the same as InputReaderThread.
   After that, android upper always restart.
   Does anyone known why?

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • yanhong wu
    Posted by yanhong wu
    on May 10 2012 19:25 PM
    Intellectual350 points

    The log is 8372.log.txt

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Satish Patel
    Posted by Satish Patel
    on May 14 2012 00:11 AM
    Expert4350 points

    Hi Yanhong,

    1. Are you adding a support for new input device ? if yes, then do  - "$getevent -p" on console and see if your device is getting listed there.

    2. What are you trying to achieve in new reader thread - could you clarify more on that ?

    3. Few observations from log...

    01-01 00:46:00.179: DEBUG/Button Savior(5044): admin api detecting
    01-01 00:46:00.351: DEBUG/Button savir(5044): su not found

    Are you trying to run something with su permission ??

    in case if you are doing any thing with brightness ? then give proper permission to below node in init.rc file

    write_int failed to open /dev/brightness

    BR,

    satish

    Kindly click the verify answer button on this post if it answer your question.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • yanhong wu
    Posted by yanhong wu
    on May 14 2012 20:22 PM
    Intellectual350 points

    Hi satish,

    I want to add the function of the serial keys. Therefore, I add a reader thread, read the serial port to get the scan code, and then distribute.
    Now I just define a thread class, and then create a variable, it appears the restart phenomenon.
    I add the following contents:

    (1)================Define the thread class  InputReaderThread2===============
    file:InputReader.h
    291 /* Reads raw events from the event hub and processes them, endlessly. */
     292 class InputReaderThread : public Thread {
     293 public:
     294     InputReaderThread(const sp<InputReaderInterface>& reader);
     295     virtual ~InputReaderThread();
     296
     297 private:
     298     sp<InputReaderInterface> mReader;
     299
     300     virtual bool threadLoop();
     301 };
     302 /**************************add start*********************/
     303 /* Reads raw events from uart devices  and processes them, endlessly. */
     304 class InputReaderThread2 : public Thread {
     305 public:
     306     InputReaderThread2();
     307     virtual ~InputReaderThread2();
     308
     309 private:
     310     virtual bool threadLoop();
     311 };
     312 /**************************add end*********************/

     (2)================The realization of the functional===============
     file:InputReader.cpp
     627 // --- InputReaderThread ---
     628
     629 InputReaderThread::InputReaderThread(const sp<InputReaderInterface>& reader) :
     630         Thread(/*canCallJava*/ true), mReader(reader) {
     631 }
     632
     633 InputReaderThread::~InputReaderThread() {
     634 }
     635
     636 bool InputReaderThread::threadLoop() {
     637     mReader->loopOnce();
     638     return true;
     639 }
     640 /**************************add start*********************/
     641 // --- InputReaderThread2 ---
     642
     643 InputReaderThread2::InputReaderThread2() :
     644         Thread(/*canCallJava*/ true) {
     645 }
     646
     647 InputReaderThread2::~InputReaderThread2() {
     648 }
     649
     650 bool InputReaderThread2::threadLoop() {
     651     return true;
     652 }
     653/**************************add end*********************/

     (3))=================Define the class variable==============
      file:InputManager.h
      class:InputManager
      105 private:
      106     sp<InputReaderInterface> mReader;
      107     sp<InputReaderThread> mReaderThread;
      108     /**************************add start*********************/
      109     sp<InputReaderThread2> mReaderThread2;
      110     /**************************add end*********************/
      111     sp<InputDispatcherInterface> mDispatcher;
      112     sp<InputDispatcherThread> mDispatcherThread;
        
        It appears the restart phenomenon after adding these.

        Now,it works well when I add "setprop libc.debug.malloc 10" to init.rc.But I do not know why.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Satish Patel
    Posted by Satish Patel
    on May 14 2012 22:16 PM
    Expert4350 points

    Hi,

    I am not sure but you need to relook your code for some kind of memory leak. As property you have mentioned is to be set when we debug memory

    http://source.android.com/tech/debugging/native-memory.html

    Also, you can refer to

    http://code.google.com/p/android-serialport-api/

    for serial port access

     

    BR,

    satish

    Kindly click the verify answer button on this post if it answer your question.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vishveshwar Bhat
    Posted by Vishveshwar Bhat
    on May 15 2012 00:40 AM
    Genius9580 points

    yanhong wu

    I want to add the function of the serial keys. Therefore, I add a reader thread, read the serial port to get the scan code, and then distribute.
    Now I just define a thread class, and then create a variable, it appears the restart phenomenon.

    An alternate approach you can explore is to implement a kernel driver for the serial keys. This way android will see this a normal input device and you need not modify the android frameworks.

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

    Please click the Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • yanhong wu
    Posted by yanhong wu
    on May 15 2012 20:20 PM
    Intellectual350 points

    Hi Vishveshwar,

    I think that what you said is a good method, but I do not know how to operate the serial device in the kernel.Can you give me some guidance or some examples?

    In addition, after a few restarts, it is no longer reboot and run well.I suspect that android reboot is due to insufficient memory.Can you give me some suggestions on how to debug?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • yanhong wu
    Posted by yanhong wu
    on May 16 2012 20:52 PM
    Intellectual350 points

    The latest test found that adding an integer variable in InputManger class also causes the android upper restart

    eg:
    TI_Android_GingerBread_2_3_4Sources/frameworks/base/include/ui/InputManager.h

     84 class InputManager : public InputManagerInterface {
     85 protected:
     86     virtual ~InputManager();
     87
     88 public:
     89     InputManager(
     90             const sp<EventHubInterface>& eventHub,
     91             const sp<InputReaderPolicyInterface>& readerPolicy,
     92             const sp<InputDispatcherPolicyInterface>& dispatcherPolicy);
     93
     94     // (used for testing purposes)
     95     InputManager(
     96             const sp<InputReaderInterface>& reader,
     97             const sp<InputDispatcherInterface>& dispatcher);
     98
     99     virtual status_t start();
    100     virtual status_t stop();
    101
    102     virtual sp<InputReaderInterface> getReader();
    103     virtual sp<InputDispatcherInterface> getDispatcher();
    104
    105 private:
    106     sp<InputReaderInterface> mReader;
    107     sp<InputReaderThread> mReaderThread;
    108     /***********add start********/
    109     int abc;
    110     /************add end*********/
    111     sp<InputDispatcherInterface> mDispatcher;
    112     sp<InputDispatcherThread> mDispatcherThread;
    113
    114     void initialize();
    115 };

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use