diff --git a/prebuilt/LeanbackCustomizer/AndroidManifest.xml b/prebuilt/LeanbackCustomizer/AndroidManifest.xml index 2fe61e5..b767262 100644 --- a/prebuilt/LeanbackCustomizer/AndroidManifest.xml +++ b/prebuilt/LeanbackCustomizer/AndroidManifest.xml @@ -3,7 +3,7 @@ package="com.vasott.leanbacklauncher.partnercustomizer" android:persistent="true" android:versionCode="4" - android:versionName="1.0.3" + android:versionName="1.0.4" android:sharedUserId="android.uid.system" xmlns:tools="http://schemas.android.com/tools"> diff --git a/prebuilt/LeanbackCustomizer/src/com/vasott/leanbacklauncher/partnercustomizer/CompleteSetupActivity.java b/prebuilt/LeanbackCustomizer/src/com/vasott/leanbacklauncher/partnercustomizer/CompleteSetupActivity.java index 3760bed..6ee5df0 100644 --- a/prebuilt/LeanbackCustomizer/src/com/vasott/leanbacklauncher/partnercustomizer/CompleteSetupActivity.java +++ b/prebuilt/LeanbackCustomizer/src/com/vasott/leanbacklauncher/partnercustomizer/CompleteSetupActivity.java @@ -4,16 +4,41 @@ import android.app.Activity; import android.app.AlarmManager; import android.content.Context; import android.os.Bundle; +import android.provider.Settings; import android.util.Log; - public class CompleteSetupActivity extends Activity { + private final static String TAG = "CompleteSetupActivity"; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AlarmManager am = (AlarmManager)getSystemService(Context.ALARM_SERVICE); am.setTimeZone("Asia/Seoul"); + turnOffTalkback(this); setResult(RESULT_OK); finish(); } + + @Override + protected void onDestroy() { + super.onDestroy(); + Log.d(TAG,"onDestroy!"); + } + + private static void turnOffTalkback(Context context) { + if (context.getContentResolver() == null) { + Log.v(TAG, "Ignore check talkback, getContentResolver() is null."); + return; + } + + final boolean accessibilityEnabled = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, 0) == 1; + Log.v(TAG, "Check talkback is enable " + accessibilityEnabled); + if (accessibilityEnabled) { + Log.v(TAG, "Disable talkback !"); + Settings.Secure.putInt(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, 0); + Settings.Secure.putString(context.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, ""); + } + } + }