Search in sources :

Example 1 with IAlarmManager

use of android.app.IAlarmManager in project android_frameworks_base by DirtyUnicorns.

the class SystemClock method setCurrentTimeMillis.

/**
     * Sets the current wall time, in milliseconds.  Requires the calling
     * process to have appropriate permissions.
     *
     * @return if the clock was successfully set to the specified time.
     */
public static boolean setCurrentTimeMillis(long millis) {
    IBinder b = ServiceManager.getService(Context.ALARM_SERVICE);
    IAlarmManager mgr = IAlarmManager.Stub.asInterface(b);
    if (mgr == null) {
        return false;
    }
    try {
        return mgr.setTime(millis);
    } catch (RemoteException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    } catch (SecurityException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    }
    return false;
}
Also used : IAlarmManager(android.app.IAlarmManager)

Example 2 with IAlarmManager

use of android.app.IAlarmManager in project android_frameworks_base by AOSPA.

the class SystemClock method setCurrentTimeMillis.

/**
     * Sets the current wall time, in milliseconds.  Requires the calling
     * process to have appropriate permissions.
     *
     * @return if the clock was successfully set to the specified time.
     */
public static boolean setCurrentTimeMillis(long millis) {
    IBinder b = ServiceManager.getService(Context.ALARM_SERVICE);
    IAlarmManager mgr = IAlarmManager.Stub.asInterface(b);
    if (mgr == null) {
        return false;
    }
    try {
        return mgr.setTime(millis);
    } catch (RemoteException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    } catch (SecurityException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    }
    return false;
}
Also used : IAlarmManager(android.app.IAlarmManager)

Example 3 with IAlarmManager

use of android.app.IAlarmManager in project android_frameworks_base by ResurrectionRemix.

the class SystemClock method setCurrentTimeMillis.

/**
     * Sets the current wall time, in milliseconds.  Requires the calling
     * process to have appropriate permissions.
     *
     * @return if the clock was successfully set to the specified time.
     */
public static boolean setCurrentTimeMillis(long millis) {
    IBinder b = ServiceManager.getService(Context.ALARM_SERVICE);
    IAlarmManager mgr = IAlarmManager.Stub.asInterface(b);
    if (mgr == null) {
        return false;
    }
    try {
        return mgr.setTime(millis);
    } catch (RemoteException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    } catch (SecurityException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    }
    return false;
}
Also used : IAlarmManager(android.app.IAlarmManager)

Example 4 with IAlarmManager

use of android.app.IAlarmManager in project platform_frameworks_base by android.

the class SystemClock method setCurrentTimeMillis.

/**
     * Sets the current wall time, in milliseconds.  Requires the calling
     * process to have appropriate permissions.
     *
     * @return if the clock was successfully set to the specified time.
     */
public static boolean setCurrentTimeMillis(long millis) {
    IBinder b = ServiceManager.getService(Context.ALARM_SERVICE);
    IAlarmManager mgr = IAlarmManager.Stub.asInterface(b);
    if (mgr == null) {
        return false;
    }
    try {
        return mgr.setTime(millis);
    } catch (RemoteException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    } catch (SecurityException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    }
    return false;
}
Also used : IAlarmManager(android.app.IAlarmManager)

Example 5 with IAlarmManager

use of android.app.IAlarmManager in project android_frameworks_base by crdroidandroid.

the class SystemClock method setCurrentTimeMillis.

/**
     * Sets the current wall time, in milliseconds.  Requires the calling
     * process to have appropriate permissions.
     *
     * @return if the clock was successfully set to the specified time.
     */
public static boolean setCurrentTimeMillis(long millis) {
    IBinder b = ServiceManager.getService(Context.ALARM_SERVICE);
    IAlarmManager mgr = IAlarmManager.Stub.asInterface(b);
    if (mgr == null) {
        return false;
    }
    try {
        return mgr.setTime(millis);
    } catch (RemoteException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    } catch (SecurityException e) {
        Slog.e(TAG, "Unable to set RTC", e);
    }
    return false;
}
Also used : IAlarmManager(android.app.IAlarmManager)

Aggregations

IAlarmManager (android.app.IAlarmManager)5