NTPSync silently fails to set the time on my SGH-T889 (a T-Mobile-dehanced Samsung Galaxy Note 2), creating log entries like this:
E/DatabaseUtils( 3612): Writing exception to parcel
E/DatabaseUtils( 3612): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
E/DatabaseUtils( 3612): at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13175)
E/DatabaseUtils( 3612): at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2044)
E/DatabaseUtils( 3612): at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:615)
E/DatabaseUtils( 3612): at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
E/DatabaseUtils( 3612): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
E/DatabaseUtils( 3612): at android.os.Binder.execTransact(Binder.java:388)
E/DatabaseUtils( 3612): at dalvik.system.NativeStart.run(Native Method)
W/ActivityManager( 3612): Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
[...]
D/SystemClock( 7840): Setting time of day to sec=1410443164
D/SystemClock( 7840): Trying to open a file
E/SystemClock( 7840): File Open Failed
W/SystemClock( 7840): Unable to open alarm driver: Permission denied
The SuperSU log clearly shows NTPSync successfully chmoding /dev/alarm to mode 666 and back. Oddly, there are no log entries with the tag NTPSync and I haven't been able to trigger the making of any Debug-level entries with /data/local.prop.
A StackExchange answer lays out the /dev/alarm technique, but goes on to claim that on newer Samsung firmwares, it doesn't work because of SELinux restrictions, and that use of date is needed.
So, how about some use of date if setCurrentTimeMillis fails? Or at least an error message.
NTPSync silently fails to set the time on my SGH-T889 (a T-Mobile-dehanced Samsung Galaxy Note 2), creating log entries like this:
The SuperSU log clearly shows NTPSync successfully chmoding
/dev/alarmto mode 666 and back. Oddly, there are no log entries with the tagNTPSyncand I haven't been able to trigger the making of any Debug-level entries with/data/local.prop.A StackExchange answer lays out the
/dev/alarmtechnique, but goes on to claim that on newer Samsung firmwares, it doesn't work because of SELinux restrictions, and that use ofdateis needed.So, how about some use of
dateifsetCurrentTimeMillisfails? Or at least an error message.