0
/**
 * Set the mode of the device.
 *
 * @param clock set the clock
 * @param devTime device alarm time including hour,minute,second.
 * @return true if the operation is successful or false if erroneous.
 */
boolean reqRemoveAlarm(int clock, SimpleDateFormat devTime);

Here i want to write one function which has one parameter devTime.actually i want to show hour,minute and second that's why i use SimpleDateFormat devTime.But it shows me error in my AIDL file

error:parameter devTime unknown type SimpleDateFormat.

I have tried to import import java.text.SimpleDateFormat;but it shows error couldnot find import for class.java.text.SimpleDateFormat.

So i really cannot understand how can i write this on my AIDL file.

Experts need your help and suggestion.

user3732316
  • 63
  • 1
  • 7

1 Answers1

1

Its basically not possible to do what your doing. AIDL will only allow for very limited types to be used as parameters or return types in AIDL files.

This includes

  • Java primitives (int or bool for example)
  • String
  • CharSequence
  • List
  • Map
  • Objects that implement Parcelable but even those must have a Parcelable aidl declaration that exists in the same class path as the actual class.

A better solution would this:

So when you construct your SimpleDateFormat you do something like this probably.

SimpleDateFormat(String pattern)

Just pass that string pattern over and construct the SimpleDateFormat on the other side of your AIDL call. If you are not creating your simple date format you could possibly call simpleDateFormat.toPattern() to get the string and then pass that over the AIDL boundary.

Hope that helps.

startoftext
  • 3,846
  • 7
  • 40
  • 49