Fix toast with accessibility and app pinning
am: cf984c56ad
* commit 'cf984c56adf88ab9d85b9a6ca71d800c2a937e6c':
Fix toast with accessibility and app pinning
Change-Id: I0c1ed9d86d6f372227a12b8f5de7f4ab0b9fd37a
This commit is contained in:
@@ -4081,8 +4081,6 @@
|
||||
|
||||
<!-- Notify use that they are in Lock-to-app -->
|
||||
<string name="lock_to_app_toast">To unpin this screen, touch & hold Back.</string>
|
||||
<!-- Notify use that they are in Lock-to-app in accessibility mode -->
|
||||
<string name="lock_to_app_toast_accessible">To unpin this screen, touch & hold Overview.</string>
|
||||
<!-- Notify user that they are locked in lock-to-app mode -->
|
||||
<string name="lock_to_app_toast_locked">App is pinned: Unpinning isn\'t allowed on this device.</string>
|
||||
<!-- Starting lock-to-app indication. -->
|
||||
|
||||
@@ -698,7 +698,6 @@
|
||||
<java-symbol type="string" name="last_month" />
|
||||
<java-symbol type="string" name="launchBrowserDefault" />
|
||||
<java-symbol type="string" name="lock_to_app_toast" />
|
||||
<java-symbol type="string" name="lock_to_app_toast_accessible" />
|
||||
<java-symbol type="string" name="lock_to_app_toast_locked" />
|
||||
<java-symbol type="string" name="lock_to_app_start" />
|
||||
<java-symbol type="string" name="lock_to_app_exit" />
|
||||
|
||||
@@ -21,7 +21,6 @@ import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.WindowManager;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.internal.R;
|
||||
@@ -35,13 +34,10 @@ public class LockTaskNotify {
|
||||
|
||||
private final Context mContext;
|
||||
private final H mHandler;
|
||||
private AccessibilityManager mAccessibilityManager;
|
||||
private Toast mLastToast;
|
||||
|
||||
public LockTaskNotify(Context context) {
|
||||
mContext = context;
|
||||
mAccessibilityManager = (AccessibilityManager)
|
||||
mContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
||||
mHandler = new H();
|
||||
}
|
||||
|
||||
@@ -54,8 +50,7 @@ public class LockTaskNotify {
|
||||
if (lockTaskModeState == ActivityManager.LOCK_TASK_MODE_LOCKED) {
|
||||
text = mContext.getString(R.string.lock_to_app_toast_locked);
|
||||
} else if (lockTaskModeState == ActivityManager.LOCK_TASK_MODE_PINNED) {
|
||||
text = mContext.getString(mAccessibilityManager.isEnabled()
|
||||
? R.string.lock_to_app_toast_accessible : R.string.lock_to_app_toast);
|
||||
text = mContext.getString(R.string.lock_to_app_toast);
|
||||
}
|
||||
if (text == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user