killpg implementation missing in bionic signal.h

by Kaushik Prajapati » Thu, 08 Apr 2010 06:44:15 GMT


Sponsored Links
 Hi,

I am trying to build the third party source code using the Android
bionic toolchain. One of the problem that I see is that there is no
killpg in side signal.h .

Is it good to change signal.h inside bionic to incorporate the
implementation of killpg? or is it good to remove killpg from third
party source code? or are there any other alternatives?

Suggestions are welcome.

Kaushik

-- 


To unsubscribe, reply using "remove me" as the subject.



Other Threads

1. What am i doing wrong binding service?

Hey guys, please tell me what i'm doing wrong, because this code
doesnot bind correctly the service. If i started calling startService
works OK.

Manifest.xml:

        <service android:name=".Service.NotifyInfoUser"
android:process=":remote">
                <intent-filter>
                        <action
android:name="com.mot.oma.Service.INotifyUserRemote" />
                </intent-filter>
        </service>



INotifyUserRemote.aidl

interface INotifyUserRemote {
        void notifyUser(in String text, in int flag);
}

NotifyInfoUser.java

package com.oma.Service;

import com.oma.R;
import com.oma.Activity.PttMain;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.widget.Toast;

public class NotifyInfoUser extends Service {

        private NotificationManager mNM;
        private static int MOOD_NOTIFICATIONS = R.layout.main;

        // variable which controls the notification thread

        @Override
        public void onCreate() {
                mNM = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);

                Thread notify_service_thread = new Thread(null, mThread,
"NotifyInfoUser");
                notify_service_thread.start();
        }

        /**
         * The function that runs in our worker thread
         */
        Runnable mThread = new Runnable() {
                public void run() {
                        showNotification(R.drawable.online_connected, 
"Connected");
                }
        };

        private void showNotification(int moodId, CharSequence text) {

                Notification notification = new Notification(moodId,
                                "Client Started", System.currentTimeMillis());

                // The PendingIntent to launch our activity if the user selects 
this
                // notification
                PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
                                new Intent(this, PttMain.class), 0);

                // Set the info for the views that show in the notification 
panel.
                notification.setLatestEventInfo(this, null, text, 
contentIntent);

                // Send the notification.
                // We use a layout id because it is a unique number. We use it 
later
to
                // cancel.
                mNM.notify(MOOD_NOTIFICATIONS, notification);
        }

        private final INotifyUserRemote.Stub mBinder = new
INotifyUserRemote.Stub() {
                @Override
                public void notifyUser(String text, int flag) {
                        // Notify in User's screen
                        Toast.makeText(NotifyInfoUser.this, text, flag).show();
                }
        };

        @Override
        public void onDestroy() {
                // Cancel the persistent notification.
                mNM.cancel(MOOD_NOTIFICATIONS);

                // Notify in User's screen
                Toast.makeText(this, R.string.ptt_client_stoped,
Toast.LENGTH_SHORT).show();
        }

        @Override
        public IBinder onBind(Intent intent) {
                return mBinder;
        }
}





Activity that starts this service:

package com.oma.Activity;

import com.oma.R;
import com.oma.Service.INotifyUserRemote;
import com.oma.Service.INotifyUserRemote.Stub;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;
import android.widget.ToggleButton;

public class StartService extends Activity {

        ToggleButton button_start_stop;
        static boolean isClientConnected = false;

        // Remote service declared by AIDL
        INotifyUserRemote mService = null;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.start_stop_service);

                button_start_stop = (ToggleButton) 
findViewById(R.id.stop_client);

                button_start_stop.setChecked(isClientConnected);

                // Watch for button clicks.
                button_start_stop.setOnClickListener(mStopClientListener);
        }

        @Override
        protected void onRestart() {
                super.onRestart();
                button_start_stop.setChecked(isClientConnected);
        }

        @Override
        protected void onResume() {
                super.onResume();
                button_start_stop.setChecked(isClientConnected);
        }

        // handle button click
        private OnClickListener mStopClientListener = new OnClickListener() {
                public void onClick(View v) {
                        boolean isConnected;
                        int i = 0;
                        isClientConnected ^= true;

                        if (isClientConnected) {
                                // Bind Service
                                String action = 
INotifyUserRemote.class.getName();
                                isConnected = bindService(new Intent(action), 
mConn,
                                                Context.BIND_AUTO_CREATE);
                                i++; // just for debugging isConnected
                        } else {
                                unbindService(mConn);
                        }
                }
        };

        private ServiceConnection mConn = new ServiceConnection() {

                public void onServiceConnected(ComponentName arg0, IBinder 
arg1) {
                        mService = INotifyUserRemote.Stub.asInterface(arg1);

                        try {
                                mService.notifyUser("Connecting to Client",
                                                Toast.LENGTH_LONG);
                        } catch (Exception e) {
                                Toast.makeText(StartService.this,
                                                "Failled Calling Remote 
Service", Toast.LENGTH_LONG)
                                                .show();
                        }
                }

                public void onServiceDisconnected(ComponentName name) {
                        mService = null;
                        Toast.makeText(StartService.this, "Remote Service 
Disconnected",
                                        Toast.LENGTH_LONG).show();
                }
        };
}


I omitted the other parts in Manifest, that i believe doesn't interfer
in this process binding. The program does not have any compiling
issue. And, logcat is returning  "Binding to a unknow
[EMAIL PROTECTED]" Thanks a lot,

regards

Breno


--~--~---------~--~----~------------~-------~--~----~

2. Read/write files on the device SD card from a desktop/laptop application

Hi.

I need to write a desktop application (let's say under Windows to
start with), which needs to access the Android device SD card in read
and write mode, so that the application can upload/download files, and
create/delete folders on the remote device.

Lately, I had a guess by using the Windows ADB driver, set the device
in "USB debugging" mode, and run from a Windows machine "adb -d pulll/
push" commands. The problem is that the id of the Linux OS when using
"adb -d" is "shell", who is not granted any privilege in order to
write/read the "/sdcard" folder.

My question is:

1. is it the right approach? In order to read/write files on the SD
card of an Android device (over the air or via a USB cable, no matter)
from a desktop/laptop machine, are there other options?

2. if this solution makes sense, do you know a way of either "adb
shell" on the device with a more privileged login, or lessen the "/
sdcard" folder permissions, so that "shell" can read/write on it?

Thank you for your attention and support.
Regards,
douard
--~--~---------~--~----~------------~-------~--~----~

3. How to put apk to G1 Phone

4. howto debug apps with more than one process

5. How to make a customised view

6. CNN: Google's iPhone rival goes on sale

7. Scroll range