rhodes 7.5.1 → 7.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +319 -0
- data/README.md +3 -15
- data/Rakefile +3 -0
- data/appveyor.yml +37 -32
- data/azure-pipelines.yml +1 -1
- data/bin/rhodes-setup +22 -8
- data/extensions/emdk3-manager/ext/platform/android/src/com/rho/emdk3/EMDK3Extension.java +14 -5
- data/extensions/instrumentation/ext/platform/android/src/com/rho/instrumentation/Instrumentation.java +29 -15
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/src/com/rhomobile/rhoelements/ans/ANSManager.java +1 -1
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/ElementsCore.java +12 -9
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/BatteryIndicator.java +2 -2
- data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro +1 -1
- data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro.erb +2 -2
- data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/QZXing.pri +9 -21
- data/lib/commonAPI/barcode/ext.yml +1 -0
- data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro +1 -1
- data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro.erb +1 -1
- data/lib/commonAPI/bluetooth/ext/platform/qt/src/bluetooth/bluetoothhelper.h +1 -1
- data/lib/commonAPI/coreapi/RhoSystemApi.rb +6 -0
- data/lib/commonAPI/coreapi/ext/Intent.xml +4 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/intent/IntentSingleton.java +6 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/Notification.java +2 -1
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationScheduler.java +1 -1
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/webview/WebViewSingleton.java +40 -27
- data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +5 -6
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.h +1 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.m +3 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.h +2 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.m +10 -0
- data/lib/commonAPI/coreapi/ext/platform/wm/src/IntentImpl.cpp +3 -0
- data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.cpp +13 -0
- data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.h +2 -0
- data/lib/commonAPI/coreapi/ext/system.xml +3 -0
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationCameraActivity.erb +2 -2
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationFileProvider.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/android/ext_java.files +1 -0
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +8 -4
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java +8 -0
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/mediacapture/RhoCameraFileProvider.java +6 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/qt/Mediacapture.pro +1 -1
- data/lib/commonAPI/signature/ext/platform/iphone/impl/readme.txt +7 -0
- data/lib/commonAPI/signature/ext/platform/qt/Signature.pro +3 -10
- data/lib/commonAPI/signature/ext/platform/qt/Signature.pro.erb +2 -2
- data/lib/extensions/fcm-push/ext/iphone/Podfile +15 -2
- data/lib/extensions/fcm-push/ext/iphone/fcm-push.xcodeproj/project.pbxproj +6 -7
- data/lib/extensions/nfc/ext/platform/android/src/com/rhomobile/nfc/Nfc.java +2 -1
- data/lib/extensions/serialport/ext/serialport.pro +1 -1
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
- data/platform/android/Rhodes/jni/src/fileapi.cpp +4 -0
- data/platform/android/Rhodes/res/drawable/baseline_check_24.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_check_240.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_close_24.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_close_240.xml +5 -0
- data/platform/android/Rhodes/res/layout/overlay_layout.xml +39 -0
- data/platform/android/Rhodes/res/layout/perrmission_alert_dialog.xml +267 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +183 -66
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +38 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoFileProvider.java +32 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +529 -89
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +256 -160
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +14 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +5 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +79 -38
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +6 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/CallReceiver.java +22 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/IKioskMode.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/KioskManager.java +18 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyAccessibilityService.java +230 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyNotificationListenerService.java +16 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyOverlayService.java +197 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/PermissionManager.java +232 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +34 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/CheckDrawable.java +53 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/PermissionListGenerate.java +366 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/rhodes.iml +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +782 -41
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputConnectionWrapper.java +146 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputListener.java +21 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +92 -32
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/TauWebViewOptions.java +118 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderBase.java +18 -17
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderEclairMR1.java +4 -4
- data/platform/android/build/RhodesSRC_build.files +13 -0
- data/platform/android/build/android-repack.rake +8 -1
- data/platform/android/build/android.rake +118 -51
- data/platform/android/build/android_tools.rb +1 -1
- data/platform/android/build/androidcommon.rb +13 -7
- data/platform/android/build/config.yml +4 -1
- data/platform/android/build/manifest_generator.rb +14 -10
- data/platform/android/build/maven_deps_extractor.rb +7 -1
- data/platform/android/build/ndkwrapper.rb +12 -0
- data/platform/android/proguard/proguard-base-rules.pro +5 -0
- data/platform/android/proguard/proguard.jar +0 -0
- data/platform/iphone/Classes/RhoAppBaseLib-Bridging-Header.h +4 -0
- data/platform/iphone/Classes/RhoAppBaseStandaloneLib-Bridging-Header.h +4 -0
- data/platform/iphone/Classes/RhoCryptAESGCM.swift +105 -0
- data/platform/iphone/Classes/RhoUIWebView.h +1 -1
- data/platform/iphone/Classes/RhoUIWebView.m +1 -1
- data/platform/iphone/Classes/RhoWKWebView.h +1 -1
- data/platform/iphone/Classes/RhoWKWebView.mm +32 -4
- data/platform/iphone/Classes/RhoWebView.h +1 -1
- data/platform/iphone/Classes/RhoWebViewFabrique.m +7 -1
- data/platform/iphone/Classes/SimpleMainView.m +5 -5
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +21 -10
- data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +4 -0
- data/platform/iphone/Framework/RhoApplication/RhoApplication.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/Framework/Rhodes/Rhodes.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +46 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +4 -1
- data/platform/iphone/rbuild/iphone.rake +9 -8
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +4 -1
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip +0 -0
- data/platform/sailfish/build/{harbour-SailfishRhodes.pro.erb → SailfishRhodes.pro.erb} +10 -17
- data/platform/sailfish/build/rhodes.pro.erb +7 -17
- data/platform/sailfish/build/rpm/SailfishRhodes.desktop.erb +12 -0
- data/platform/sailfish/build/rpm/SailfishRhodes.erb +2 -0
- data/platform/sailfish/build/rpm/SailfishRhodes.spec.erb +43 -0
- data/platform/sailfish/build/rubylib.pro.erb +29 -29
- data/platform/sailfish/build/sailfish.rake +188 -180
- data/platform/sailfish/keys/regular_cert.pem +14 -0
- data/platform/sailfish/keys/regular_key.pem +4 -0
- data/platform/shared/common/RhodesApp.cpp +33 -9
- data/platform/shared/common/iphone/RhoCryptImpl.mm +130 -54
- data/platform/shared/qt/RhoSimulator.pro +1 -1
- data/platform/shared/qt/rhodes/rhodes.pro +4 -11
- data/platform/shared/qt/sailfish/SailfishRhodes.desktop +3 -4
- data/platform/shared/qt/sailfish/SailfishRhodes.pro +9 -10
- data/platform/shared/qt/sailfish/icons/108x108/108x108.png +0 -0
- data/platform/shared/qt/sailfish/privileges/sailfishrhodes +2 -0
- data/platform/shared/qt/sailfish/qml/pages/FirstPageWK.qml +7 -11
- data/platform/shared/qt/sailfish/qml/{harbour-sailfishrhodes.qml → sailfishrhodes.qml} +1 -1
- data/platform/shared/qt/sailfish/rpm/sailfishrhodes.spec +80 -0
- data/platform/shared/qt/sailfish/rpm/{harbour-sailfishrhodes.yaml → sailfishrhodes.yaml} +2 -2
- data/platform/shared/qt/sailfish/src/QtMainWindow.cpp +1 -1
- data/platform/shared/qt/sailfish/src/QtMainWindow.h +1 -1
- data/platform/shared/qt/sailfish/src/main.cpp +6 -38
- data/platform/shared/qt/sailfish/src/rootdelegate.h +2 -14
- data/platform/shared/ruby/aurora/ruby/config.h +386 -0
- data/platform/shared/ruby/aurora/ruby/constdefs.c +5866 -0
- data/platform/shared/ruby/aurora/ruby/constdefs.h +1788 -0
- data/platform/shared/sqlite/crypto.c +14 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/build/rhodes.nsi +3 -3
- data/platform/win32/build/win32.rake +1 -1
- data/rakefile.rb +3 -0
- data/res/build-tools/iphonesim/build/Release/iphonesim_8 +4 -4
- data/res/generators/templates/application/AndroidManifest.erb +26 -5
- data/res/generators/templates/application/build.yml +14 -10
- data/res/generators/templates/application/resources/android/res/xml/provider_paths.xml +4 -0
- data/res/generators/templates/application/rhoconfig.txt +10 -1
- data/res/generators/templates/iphone_project/Bremen8.xcodeproj/project.pbxproj +24 -1
- data/res/generators/templates/iphone_project/Classes/SimpleSwiftClass.swift +20 -0
- data/res/generators/templates/iphone_project/Classes/rhorunner-Bridging-Header.h +4 -0
- data/rhobuild.yml.example +3 -3
- data/rhodes.gemspec +4 -2
- data/version +1 -1
- metadata +81 -26
- data/platform/sailfish/build/rho_build.cmd.erb +0 -14
- data/platform/sailfish/build/rho_clean.cmd.erb +0 -14
- data/platform/sailfish/build/rho_deploy.cmd.erb +0 -15
- data/platform/sailfish/build/rho_rpm.cmd.erb +0 -14
- data/platform/sailfish/build/rho_rpmvalidation.cmd.erb +0 -14
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.desktop.erb +0 -7
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.erb +0 -2
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.yaml.erb +0 -37
- data/platform/shared/qt/sailfish/harbour-sailfishrhodes.desktop +0 -6
- data/platform/shared/qt/sailfish/icons/108x108/harbour-sailfishrhodes.png +0 -0
- data/platform/shared/qt/sailfish/privileges/harbour-sailfishrhodes +0 -2
- data/platform/shared/qt/sailfish/qml/pages/FirstPageWE.qml +0 -236
- /data/platform/shared/qt/sailfish/icons/128x128/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
- /data/platform/shared/qt/sailfish/icons/172x172/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
- /data/platform/shared/qt/sailfish/icons/86x86/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
@@ -36,6 +36,8 @@ public interface IRhoExtension {
|
|
36
36
|
boolean onNavigateProgress(IRhoExtManager extManager, String url, int pos, int total, IRhoWebView ext, boolean res);
|
37
37
|
boolean onNavigateComplete(IRhoExtManager extManager, String url, IRhoWebView ext, boolean res);
|
38
38
|
boolean onDocumentComplete(IRhoExtManager extManager, String url, IRhoWebView ext, boolean res);
|
39
|
+
boolean onGoBack(IRhoExtManager extManager, String current_url, String back_url, IRhoWebView ext, boolean res);
|
40
|
+
boolean onGoForward(IRhoExtManager extManager, String current_url, String forward_url, IRhoWebView ext, boolean res);
|
39
41
|
boolean onAlert(IRhoExtManager extManager, String message, IRhoWebView ext, IAlertResult alertResult, boolean res);
|
40
42
|
boolean onConfirm(IRhoExtManager extManager, String message, IRhoWebView ext, IAlertResult confirmResult, boolean res);
|
41
43
|
boolean onPrompt(IRhoExtManager extManager, String message, String defaultResponse, IRhoWebView ext, IPromptResult promptResult, boolean res);
|
@@ -45,16 +47,15 @@ public interface IRhoExtension {
|
|
45
47
|
boolean onConsole(IRhoExtManager extManager, String message, IRhoWebView ext, boolean res);
|
46
48
|
boolean onInputMethod(IRhoExtManager extManager, boolean enabled, String type, Rect area, IRhoWebView ext, boolean res);
|
47
49
|
boolean onNavigateError(IRhoExtManager extManager, String url, LoadErrorReason reason, IRhoWebView ext, boolean res);
|
48
|
-
boolean onAuthRequest(IRhoExtManager extManager, IAuthRequest request, IRhoWebView ext, boolean res);
|
50
|
+
boolean onAuthRequest(IRhoExtManager extManager, IAuthRequest request, IRhoWebView ext, boolean res);
|
49
51
|
|
50
52
|
void onAppActivate(IRhoExtManager extManager, boolean bActivate);
|
51
53
|
|
52
|
-
|
53
|
-
boolean startLocationUpdates(IRhoExtManager extManager, boolean highAccuracy, IRhoWebView ext, boolean res);
|
54
|
+
|
55
|
+
boolean startLocationUpdates(IRhoExtManager extManager, boolean highAccuracy, IRhoWebView ext, boolean res);
|
54
56
|
boolean stopLocationUpdates(IRhoExtManager extManager, IRhoWebView ext, boolean res);
|
55
57
|
|
56
58
|
boolean onNewConfig(IRhoExtManager extManager, IRhoConfig config, String name, boolean res);
|
57
59
|
|
58
60
|
String onGetProperty(IRhoExtManager extManager, String name);
|
59
61
|
}
|
60
|
-
|
@@ -63,7 +63,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
63
63
|
private IRhoWebView makeDefExtData(View view) {
|
64
64
|
return RhodesActivity.safeGetInstance().getMainView().getWebView(view);
|
65
65
|
}
|
66
|
-
|
66
|
+
|
67
67
|
private static native void nativeRequireRubyFile(String path);
|
68
68
|
static native String nativeJSCallEntryPoint(String query);
|
69
69
|
|
@@ -77,22 +77,22 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
77
77
|
throw new IllegalArgumentException("Cannot get " + className + "." + idName, e);
|
78
78
|
}
|
79
79
|
}
|
80
|
-
|
80
|
+
|
81
81
|
|
82
82
|
public RhoExtManagerImpl() {
|
83
83
|
mConfigs.put("rhoconfig", new RhoConf.RhoConfig());
|
84
84
|
}
|
85
|
-
|
85
|
+
|
86
86
|
@Override
|
87
87
|
public int getActivityResultNextRequestCode(IRhoListener listener) {
|
88
|
-
|
88
|
+
|
89
89
|
synchronized (mLastActivityRequestCode) {
|
90
90
|
++mLastActivityRequestCode;
|
91
91
|
mActivityResultListeners.append(mLastActivityRequestCode.intValue(), listener);
|
92
92
|
}
|
93
93
|
return mLastActivityRequestCode;
|
94
94
|
}
|
95
|
-
|
95
|
+
|
96
96
|
@Override
|
97
97
|
public void dropActivityResultRequestCode(int requestCode) {
|
98
98
|
synchronized (mLastActivityRequestCode) {
|
@@ -121,7 +121,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
121
121
|
mListeners.add(listener);
|
122
122
|
}
|
123
123
|
}
|
124
|
-
|
124
|
+
|
125
125
|
|
126
126
|
@Override
|
127
127
|
public void setConfig(String name, IRhoConfig config) {
|
@@ -206,13 +206,13 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
206
206
|
|
207
207
|
@Override
|
208
208
|
public void stopNavigate(final IRhoExtension.LoadErrorReason reason) {
|
209
|
-
|
210
|
-
|
209
|
+
|
210
|
+
|
211
211
|
//WebView.stopNavigate();
|
212
|
-
|
212
|
+
|
213
213
|
final RhodesActivity activity = RhodesActivity.safeGetInstance();
|
214
214
|
final MainView mainView = activity.getMainView();
|
215
|
-
|
215
|
+
|
216
216
|
// In case stopNavigate is called from onBeforeNavigate
|
217
217
|
// we must be aware that all other parties (extensions) finish to proceed current event
|
218
218
|
activity.post(new Runnable() {
|
@@ -231,7 +231,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
231
231
|
public void historyBack() {
|
232
232
|
WebView.navigateBack();
|
233
233
|
}
|
234
|
-
|
234
|
+
|
235
235
|
@Override
|
236
236
|
public boolean onKey(int keyCode, KeyEvent event){
|
237
237
|
for(IRhoListener listener: mKeyListeners){
|
@@ -254,7 +254,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
254
254
|
|
255
255
|
@Override
|
256
256
|
public void setFullScreen(boolean fullScreen) {
|
257
|
-
|
257
|
+
|
258
258
|
}
|
259
259
|
|
260
260
|
@Override
|
@@ -302,7 +302,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
302
302
|
return RhodesService.getBuildConfig(name);
|
303
303
|
}
|
304
304
|
|
305
|
-
/**
|
305
|
+
/**
|
306
306
|
* @return is extension allowed to navigate to its start page
|
307
307
|
*/
|
308
308
|
@Override
|
@@ -351,24 +351,24 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
351
351
|
}
|
352
352
|
return res;
|
353
353
|
}
|
354
|
-
|
354
|
+
|
355
355
|
public void enableLogLevelError(boolean enabled) {
|
356
356
|
Logger.I(TAG, "RE Error log: " + enabled);
|
357
357
|
mLogError = enabled;
|
358
358
|
}
|
359
|
-
public void enableLogLevelWarning(boolean enabled) {
|
359
|
+
public void enableLogLevelWarning(boolean enabled) {
|
360
360
|
Logger.I(TAG, "RE Warning log: " + enabled);
|
361
|
-
mLogWarning = enabled;
|
361
|
+
mLogWarning = enabled;
|
362
362
|
}
|
363
|
-
public void enableLogLevelInfo(boolean enabled) {
|
363
|
+
public void enableLogLevelInfo(boolean enabled) {
|
364
364
|
Logger.I(TAG, "RE Info log: " + enabled);
|
365
365
|
mLogInfo = enabled;
|
366
366
|
}
|
367
|
-
public void enableLogLevelUser(boolean enabled) {
|
367
|
+
public void enableLogLevelUser(boolean enabled) {
|
368
368
|
Logger.I(TAG, "RE User log: " + enabled);
|
369
369
|
mLogUser = enabled;
|
370
370
|
}
|
371
|
-
public void enableLogLevelDebug(boolean enabled) {
|
371
|
+
public void enableLogLevelDebug(boolean enabled) {
|
372
372
|
Logger.I(TAG, "RE Debug log: " + enabled);
|
373
373
|
mLogDebug = enabled;
|
374
374
|
}
|
@@ -398,7 +398,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
398
398
|
Logger.E(tag, msg);
|
399
399
|
}
|
400
400
|
|
401
|
-
|
401
|
+
|
402
402
|
public void onSetPropertiesData(View view,String propId, String data, int position, int total) {
|
403
403
|
IRhoWebView rhoWebView = makeDefExtData(view);
|
404
404
|
synchronized (mExtensions) {
|
@@ -409,7 +409,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
409
409
|
}
|
410
410
|
}
|
411
411
|
|
412
|
-
private boolean isFirstNavigate() {
|
412
|
+
private boolean isFirstNavigate() {
|
413
413
|
return mFirstNavigate;
|
414
414
|
}
|
415
415
|
|
@@ -475,6 +475,41 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
475
475
|
}
|
476
476
|
}
|
477
477
|
|
478
|
+
public void onGoBack(View view, String current_url, String back_url) {
|
479
|
+
IRhoWebView rhoWebView = null;
|
480
|
+
try {
|
481
|
+
int tabIndex = RhodesActivity.safeGetInstance().getMainView().getWebViewTab(view);
|
482
|
+
rhoWebView = RhodesActivity.safeGetInstance().getMainView().getWebView(tabIndex);
|
483
|
+
}
|
484
|
+
catch(IllegalArgumentException ex) {
|
485
|
+
Logger.W(TAG, "Cannot get webView object for onGoBack event: WebView object is destroyed.");
|
486
|
+
}
|
487
|
+
synchronized (mExtensions) {
|
488
|
+
boolean res = false;
|
489
|
+
for (IRhoExtension ext : mExtensions.values()) {
|
490
|
+
res = ext.onGoBack(this, current_url, back_url, rhoWebView, res);
|
491
|
+
}
|
492
|
+
}
|
493
|
+
}
|
494
|
+
|
495
|
+
public void onGoForward(View view, String current_url, String forward_url) {
|
496
|
+
IRhoWebView rhoWebView = null;
|
497
|
+
try {
|
498
|
+
int tabIndex = RhodesActivity.safeGetInstance().getMainView().getWebViewTab(view);
|
499
|
+
rhoWebView = RhodesActivity.safeGetInstance().getMainView().getWebView(tabIndex);
|
500
|
+
}
|
501
|
+
catch(IllegalArgumentException ex) {
|
502
|
+
Logger.W(TAG, "Cannot get webView object for onGoForward event: WebView object is destroyed.");
|
503
|
+
}
|
504
|
+
synchronized (mExtensions) {
|
505
|
+
boolean res = false;
|
506
|
+
for (IRhoExtension ext : mExtensions.values()) {
|
507
|
+
res = ext.onGoForward(this, current_url, forward_url, rhoWebView, res);
|
508
|
+
}
|
509
|
+
}
|
510
|
+
}
|
511
|
+
|
512
|
+
|
478
513
|
public void onAppActivate(boolean isActivate) {
|
479
514
|
Logger.T(TAG, "onAppActivate: " + isActivate);
|
480
515
|
synchronized (mExtensions) {
|
@@ -562,12 +597,13 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
562
597
|
}
|
563
598
|
}
|
564
599
|
|
600
|
+
|
565
601
|
public void onAuthRequest(View view, final IRhoExtension.IAuthRequest request) {
|
566
602
|
final IRhoWebView rhoWebView = makeDefExtData(view);
|
567
603
|
boolean res = false;
|
568
604
|
synchronized (mExtensions) {
|
569
605
|
for (IRhoExtension ext : mExtensions.values()) {
|
570
|
-
res = ext.onAuthRequest(this, request, rhoWebView, res);
|
606
|
+
res = res || ext.onAuthRequest(this, request, rhoWebView, res);
|
571
607
|
}
|
572
608
|
}
|
573
609
|
if (!res) {
|
@@ -580,36 +616,36 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
580
616
|
realmView.setPadding(10, 10, 10, 10);
|
581
617
|
|
582
618
|
TableLayout formLayout = new TableLayout(ctx);
|
583
|
-
|
619
|
+
|
584
620
|
TableRow userRow = new TableRow(ctx);
|
585
|
-
|
621
|
+
|
586
622
|
TextView userPrompt = new TextView(ctx, null, android.R.style.Widget_TextView);
|
587
623
|
userPrompt.setText("Name:");
|
588
624
|
userPrompt.setPadding(0, 0, 10, 0);
|
589
625
|
final EditText userField = new EditText(ContextFactory.getUiContext());
|
590
626
|
userField.setSingleLine();
|
591
627
|
userField.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
592
|
-
|
628
|
+
|
593
629
|
userRow.addView(userPrompt);
|
594
630
|
userRow.addView(userField);
|
595
631
|
//userRow.setPadding(5, 0, 0, 5);
|
596
632
|
formLayout.addView(userRow);
|
597
|
-
|
633
|
+
|
598
634
|
TableRow passRow = new TableRow(ctx);
|
599
|
-
|
635
|
+
|
600
636
|
TextView passPrompt = new TextView(ctx, null, android.R.style.Widget_TextView);
|
601
637
|
passPrompt.setText("Password:");
|
602
638
|
passPrompt.setPadding(0, 0, 10, 0);
|
603
639
|
final EditText passField = new EditText(ContextFactory.getUiContext());
|
604
640
|
passField.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
605
641
|
passField.setTransformationMethod(PasswordTransformationMethod.getInstance());
|
606
|
-
|
642
|
+
|
607
643
|
passRow.addView(passPrompt);
|
608
644
|
passRow.addView(passField);
|
609
645
|
//passRow.setPadding(5, 0, 0, 5);
|
610
646
|
formLayout.addView(passRow);
|
611
647
|
formLayout.setColumnStretchable(1, true);
|
612
|
-
|
648
|
+
|
613
649
|
mainLayout.addView(realmView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
|
614
650
|
mainLayout.addView(formLayout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
|
615
651
|
|
@@ -742,7 +778,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
742
778
|
final TextView promptView = new TextView(ContextFactory.getUiContext(), null, android.R.style.Widget_TextView);
|
743
779
|
promptView.setPadding(10, 10, 10, 10);
|
744
780
|
final EditText input = new EditText(ContextFactory.getUiContext());
|
745
|
-
|
781
|
+
|
746
782
|
layout.addView(promptView, 0, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
|
747
783
|
layout.addView(input, 1, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
|
748
784
|
|
@@ -840,7 +876,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
840
876
|
{
|
841
877
|
startKeyEventUpdates(listener, false);
|
842
878
|
}
|
843
|
-
|
879
|
+
|
844
880
|
@Override
|
845
881
|
public void startKeyEventUpdates(IRhoListener listener, boolean makeImportant)
|
846
882
|
{
|
@@ -855,7 +891,7 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
855
891
|
}
|
856
892
|
}
|
857
893
|
}
|
858
|
-
|
894
|
+
|
859
895
|
@Override
|
860
896
|
public void stopKeyEventUpdates(IRhoListener listener)
|
861
897
|
{
|
@@ -875,11 +911,11 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
875
911
|
}
|
876
912
|
return null;
|
877
913
|
}
|
878
|
-
|
914
|
+
|
879
915
|
public void createRhoListeners() {
|
880
916
|
for (String classname: RhodesStartupListeners.ourRunnableList) {
|
881
917
|
if (classname.length() == 0) continue;
|
882
|
-
|
918
|
+
|
883
919
|
Class<? extends IRhoListener> klass = null;
|
884
920
|
try {
|
885
921
|
klass = Class.forName(classname).asSubclass(IRhoListener.class);
|
@@ -911,6 +947,12 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
911
947
|
}
|
912
948
|
activity.getMainView().setWebView(createWebView(activity, 0), 0);
|
913
949
|
}
|
950
|
+
|
951
|
+
public void doFullResetWebViewByCreateNewOne() {
|
952
|
+
RhodesActivity.safeGetInstance().getMainView().setWebView(createWebView(RhodesActivity.safeGetInstance(), 0), 0);
|
953
|
+
}
|
954
|
+
|
955
|
+
|
914
956
|
public void onStartActivity(RhodesActivity activity) {
|
915
957
|
for (IRhoListener listener: mListeners) {
|
916
958
|
listener.onStart(activity);
|
@@ -981,19 +1023,19 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
981
1023
|
listener.onConfigurationChanged(activity, newConfig);
|
982
1024
|
}
|
983
1025
|
}
|
984
|
-
|
1026
|
+
|
985
1027
|
public void onEBLicenseVisible() {
|
986
1028
|
for (IRhoListener listener: mListeners) {
|
987
1029
|
listener.onEBLicenseVisible();
|
988
1030
|
}
|
989
1031
|
}
|
990
|
-
|
1032
|
+
|
991
1033
|
public void onEBLicenseHidden() {
|
992
1034
|
for (IRhoListener listener: mListeners) {
|
993
1035
|
listener.onEBLicenseHidden();
|
994
1036
|
}
|
995
1037
|
}
|
996
|
-
|
1038
|
+
|
997
1039
|
public void onEBLicenseDestroyed() {
|
998
1040
|
for (IRhoListener listener: mListeners) {
|
999
1041
|
listener.onEBLicenseDestroyed();
|
@@ -1001,4 +1043,3 @@ public class RhoExtManagerImpl implements IRhoExtManager {
|
|
1001
1043
|
}
|
1002
1044
|
|
1003
1045
|
}
|
1004
|
-
|
@@ -69,7 +69,12 @@ public class GeoLocation {
|
|
69
69
|
ourSpeed = loc.getSpeed();
|
70
70
|
//The way of getiing satellites is changed
|
71
71
|
//ourSatellities = getImpl().getSatellities();
|
72
|
-
|
72
|
+
android.os.Bundle extras = loc.getExtras();
|
73
|
+
if (extras != null) {
|
74
|
+
ourSatellities = extras.getInt("satellites");
|
75
|
+
} else {
|
76
|
+
ourSatellities = 0;
|
77
|
+
}
|
73
78
|
ourIsKnownPosition = true;
|
74
79
|
}
|
75
80
|
else {
|
@@ -0,0 +1,22 @@
|
|
1
|
+
package com.rhomobile.rhodes.kioskservices;
|
2
|
+
|
3
|
+
import android.content.BroadcastReceiver;
|
4
|
+
import android.content.Context;
|
5
|
+
import android.content.Intent;
|
6
|
+
import android.telecom.TelecomManager;
|
7
|
+
import android.telephony.TelephonyManager;
|
8
|
+
import android.widget.Toast;
|
9
|
+
|
10
|
+
import java.net.URISyntaxException;
|
11
|
+
|
12
|
+
public class CallReceiver extends BroadcastReceiver {
|
13
|
+
@Override
|
14
|
+
public void onReceive(Context context, Intent intent) {
|
15
|
+
TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
|
16
|
+
TelecomManager telecomManager = (TelecomManager)context.getSystemService(Context.TELECOM_SERVICE);
|
17
|
+
|
18
|
+
if(KioskManager.getKioskModeStatus() && telephonyManager.getCallState() == TelephonyManager.CALL_STATE_RINGING){
|
19
|
+
telecomManager.endCall();
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
package com.rhomobile.rhodes.kioskservices;
|
2
|
+
|
3
|
+
public interface IKioskMode {
|
4
|
+
public void startKioskMode(boolean use_overlay);
|
5
|
+
public void stopKioskMode();
|
6
|
+
public boolean isKioskMode();
|
7
|
+
public void startOverlay();
|
8
|
+
public void stopOverlay();
|
9
|
+
public boolean isAllPermissions();
|
10
|
+
public void showPermissionsList();
|
11
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
package com.rhomobile.rhodes.kioskservices;
|
2
|
+
|
3
|
+
import android.util.Log;
|
4
|
+
|
5
|
+
|
6
|
+
public class KioskManager {
|
7
|
+
private static boolean isKioskMode = false;
|
8
|
+
|
9
|
+
public static void setKioskMode(Boolean state){
|
10
|
+
Log.d("myLog", "Kiosk status: "+(state?"true":"false"));
|
11
|
+
isKioskMode = state;
|
12
|
+
}
|
13
|
+
|
14
|
+
public static Boolean getKioskModeStatus(){
|
15
|
+
Log.d("myLog", "Kiosk status: "+(isKioskMode?"true":"false"));
|
16
|
+
return isKioskMode;
|
17
|
+
}
|
18
|
+
}
|
data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyAccessibilityService.java
ADDED
@@ -0,0 +1,230 @@
|
|
1
|
+
package com.rhomobile.rhodes.kioskservices;
|
2
|
+
|
3
|
+
import java.util.Arrays;
|
4
|
+
import java.util.List;
|
5
|
+
|
6
|
+
import android.accessibilityservice.AccessibilityService;
|
7
|
+
import android.util.Log;
|
8
|
+
import android.view.accessibility.AccessibilityEvent;
|
9
|
+
import android.widget.Toast;
|
10
|
+
import android.app.Notification;
|
11
|
+
import android.content.BroadcastReceiver;
|
12
|
+
import android.content.Context;
|
13
|
+
import android.content.Intent;
|
14
|
+
import android.content.IntentFilter;
|
15
|
+
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
16
|
+
import android.view.KeyEvent;
|
17
|
+
|
18
|
+
import com.rhomobile.rhodes.R;
|
19
|
+
import com.rhomobile.rhodes.RhoConf;
|
20
|
+
import com.rhomobile.rhodes.webview.RhoInputListener;
|
21
|
+
import com.rhomobile.rhodes.Logger;
|
22
|
+
|
23
|
+
|
24
|
+
public class MyAccessibilityService extends AccessibilityService {
|
25
|
+
|
26
|
+
private static final String TAG = MyAccessibilityService.class.getSimpleName();
|
27
|
+
|
28
|
+
private CharSequence oldEvent = null;
|
29
|
+
private BroadcastReceiver receiver = null;
|
30
|
+
private static final int NOTIFICATION_ID = 1234;
|
31
|
+
private boolean filter = true;
|
32
|
+
private CharSequence powerPackageName;
|
33
|
+
public static boolean isPowerProcessing = false;
|
34
|
+
private static List<String> ignorePackets = null;
|
35
|
+
private static boolean isEnabled = false;
|
36
|
+
|
37
|
+
public static void setPowerProcessing(boolean value) {
|
38
|
+
isPowerProcessing = value;
|
39
|
+
}
|
40
|
+
|
41
|
+
public static void setIgnoreEventsFromPackets(String packets){
|
42
|
+
try {
|
43
|
+
ignorePackets = Arrays.asList(packets.split(";"));
|
44
|
+
} catch(Exception e) {
|
45
|
+
Logger.E(TAG, "Exception in AccessibilityService : " + e.getMessage() + "\n");
|
46
|
+
e.printStackTrace();
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
private boolean isIgnorPackages(CharSequence eventPackageName){
|
51
|
+
try {
|
52
|
+
if(ignorePackets != null && ignorePackets.size() > 0){
|
53
|
+
if(ignorePackets.indexOf(eventPackageName.toString()) >= 0)
|
54
|
+
return false;
|
55
|
+
}
|
56
|
+
} catch(Exception e) {
|
57
|
+
Logger.E(TAG, "Exception in AccessibilityService : " + e.getMessage() + "\n");
|
58
|
+
e.printStackTrace();
|
59
|
+
}
|
60
|
+
|
61
|
+
return true;
|
62
|
+
}
|
63
|
+
|
64
|
+
@Override
|
65
|
+
protected void onServiceConnected() {
|
66
|
+
try {
|
67
|
+
super.onServiceConnected();
|
68
|
+
|
69
|
+
receiver = new BroadcastReceiver(){
|
70
|
+
@Override
|
71
|
+
public void onReceive(Context context, Intent intent){
|
72
|
+
String action = intent.getAction();
|
73
|
+
if( action != null &&
|
74
|
+
action.equals("com.rhobrowser.poweroff") &&
|
75
|
+
isPowerProcessing)
|
76
|
+
{
|
77
|
+
powerOff();
|
78
|
+
}
|
79
|
+
}
|
80
|
+
};
|
81
|
+
IntentFilter filter = new IntentFilter("com.rhobrowser.poweroff");
|
82
|
+
LocalBroadcastManager.getInstance(this).registerReceiver(receiver, filter);
|
83
|
+
|
84
|
+
} catch(Exception e) {
|
85
|
+
Logger.E(TAG, "Exception in AccessibilityService : " + e.getMessage() + "\n");
|
86
|
+
e.printStackTrace();
|
87
|
+
}
|
88
|
+
|
89
|
+
isEnabled = true;
|
90
|
+
|
91
|
+
|
92
|
+
//Toast.makeText(this, "Accessibility Service connected", Toast.LENGTH_LONG).show();
|
93
|
+
}
|
94
|
+
|
95
|
+
public static boolean getStatus(){
|
96
|
+
return isEnabled;
|
97
|
+
}
|
98
|
+
|
99
|
+
@Override
|
100
|
+
public void onAccessibilityEvent(AccessibilityEvent event) {
|
101
|
+
try {
|
102
|
+
|
103
|
+
|
104
|
+
if (event == null) {
|
105
|
+
Logger.T(this.TAG, "===================== onAccessibilityEvent ====================");
|
106
|
+
Logger.T(this.TAG, "event == null !");
|
107
|
+
Logger.T(this.TAG, "filter: " + filter);
|
108
|
+
Logger.T(this.TAG, "================================================================");
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
//Log.d("myLog", "Kiosk status: "+(KioskManager.getKioskModeStatus()?"true":"false")+"; event: "+ event.toString());
|
112
|
+
Logger.T(this.TAG, "===================== onAccessibilityEvent ====================");
|
113
|
+
Logger.T(this.TAG, event.toString());
|
114
|
+
Logger.T(this.TAG, "filter: " + filter);
|
115
|
+
Logger.T(this.TAG, "================================================================");
|
116
|
+
|
117
|
+
if (filter){
|
118
|
+
|
119
|
+
if( event.getEventType() == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED ||
|
120
|
+
event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED)
|
121
|
+
{
|
122
|
+
|
123
|
+
if( KioskManager.getKioskModeStatus() &&
|
124
|
+
event.getPackageName() != null &&
|
125
|
+
!event.getPackageName().equals(getPackageName()) &&
|
126
|
+
isIgnorPackages(event.getPackageName()))
|
127
|
+
{
|
128
|
+
Logger.T(this.TAG, "==================== GLOBAL_ACTION_HOME =======================");
|
129
|
+
performGlobalAction(GLOBAL_ACTION_HOME);
|
130
|
+
if(event.getPackageName().equals(oldEvent)) {
|
131
|
+
//Toast.makeText(this, "package: " + event.getPackageName(), Toast.LENGTH_SHORT).show();
|
132
|
+
oldEvent = event.getPackageName();
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
} else {
|
138
|
+
if (powerPackageName == null && event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED){
|
139
|
+
powerPackageName = event.getPackageName();
|
140
|
+
}
|
141
|
+
|
142
|
+
Logger.T(this.TAG, "Package name = "+getPackageName());
|
143
|
+
|
144
|
+
if( (event.getEventType() == AccessibilityEvent.TYPE_VIEW_CLICKED &&
|
145
|
+
!event.getPackageName().equals(getPackageName()) && !event.getPackageName().equals(powerPackageName)) ||
|
146
|
+
(event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED &&
|
147
|
+
event.getPackageName() != powerPackageName ))
|
148
|
+
{
|
149
|
+
Logger.T(this.TAG, "FILTER ON");
|
150
|
+
filter = true;
|
151
|
+
powerPackageName = null;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
if( RhoConf.isExist("click_sound_with_accessibility_service") &&
|
156
|
+
RhoConf.getBool("click_sound_with_accessibility_service")){
|
157
|
+
Logger.T(this.TAG, "click_sound_with_accessibility_service");
|
158
|
+
Logger.T(this.TAG, "event.getClassName() = "+event.getClassName());
|
159
|
+
Logger.T(this.TAG, "Package name = "+getPackageName());
|
160
|
+
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED &&
|
161
|
+
event.getSource() != null &&
|
162
|
+
event.getPackageName().equals(getPackageName()) &&
|
163
|
+
event.getClassName().equals("android.widget.EditText")){
|
164
|
+
playSound(event);
|
165
|
+
}
|
166
|
+
}
|
167
|
+
} catch(Exception e) {
|
168
|
+
Logger.E(TAG, "Exception in AccessibilityService : " + e.getMessage() + "\n");
|
169
|
+
e.printStackTrace();
|
170
|
+
}
|
171
|
+
|
172
|
+
}
|
173
|
+
|
174
|
+
protected boolean onKeyEvent (KeyEvent event) {
|
175
|
+
try {
|
176
|
+
if (event != null) {
|
177
|
+
Logger.E(this.TAG, "$$$## KEY CODE = ["+String.valueOf(event.getKeyCode())+"]");
|
178
|
+
}
|
179
|
+
else {
|
180
|
+
Logger.E(this.TAG, "$$$## KEY CODE = [event is null !]");
|
181
|
+
}
|
182
|
+
return super.onKeyEvent(event);
|
183
|
+
} catch(Exception e) {
|
184
|
+
Logger.E(TAG, "Exception in AccessibilityService : " + e.getMessage() + "\n");
|
185
|
+
e.printStackTrace();
|
186
|
+
}
|
187
|
+
return false;
|
188
|
+
}
|
189
|
+
|
190
|
+
private void playSound(AccessibilityEvent event){
|
191
|
+
try {
|
192
|
+
RhoInputListener.IRhoInputListener listener = RhoInputListener.getListener();
|
193
|
+
if (listener != null) {
|
194
|
+
listener.onTextInput();
|
195
|
+
listener.onAccessibitityEvent(event);
|
196
|
+
}
|
197
|
+
} catch(Exception e) {
|
198
|
+
Logger.E(TAG, "Exception in AccessibilityService : " + e.getMessage() + "\n");
|
199
|
+
e.printStackTrace();
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
private void powerOff(){
|
204
|
+
try {
|
205
|
+
Log.d("myLog1", "FILTER OFF");
|
206
|
+
filter = false;
|
207
|
+
performGlobalAction(GLOBAL_ACTION_POWER_DIALOG);
|
208
|
+
} catch(Exception e) {
|
209
|
+
Logger.E(TAG, "Exception in AccessibilityService : " + e.getMessage() + "\n");
|
210
|
+
e.printStackTrace();
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
214
|
+
@Override
|
215
|
+
public void onInterrupt() {
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
@Override
|
220
|
+
public void onDestroy() {
|
221
|
+
try {
|
222
|
+
super.onDestroy();
|
223
|
+
if(isPowerProcessing)
|
224
|
+
LocalBroadcastManager.getInstance(this).unregisterReceiver(receiver);
|
225
|
+
} catch(Exception e) {
|
226
|
+
Logger.E(TAG, "Exception in AccessibilityService : " + e.getMessage() + "\n");
|
227
|
+
e.printStackTrace();
|
228
|
+
}
|
229
|
+
}
|
230
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
package com.rhomobile.rhodes.kioskservices;
|
2
|
+
|
3
|
+
import android.service.notification.NotificationListenerService;
|
4
|
+
import android.service.notification.StatusBarNotification;
|
5
|
+
import android.widget.Toast;
|
6
|
+
|
7
|
+
public class MyNotificationListenerService extends NotificationListenerService {
|
8
|
+
@Override
|
9
|
+
public void onNotificationPosted(StatusBarNotification sbn) {
|
10
|
+
if(KioskManager.getKioskModeStatus()){
|
11
|
+
//Toast.makeText(this,"kiosk mode enable", Toast.LENGTH_LONG).show();
|
12
|
+
cancelNotification(sbn.getKey());
|
13
|
+
}else
|
14
|
+
super.onNotificationPosted(sbn);
|
15
|
+
}
|
16
|
+
}
|