Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6026b5b1 authored by Dan Sandler's avatar Dan Sandler Committed by android-build-merger
Browse files

Delay hiding the cast icon for 3 seconds. DO NOT MERGE

am: 51c2619c

* commit '51c2619c':
  Delay hiding the cast icon for 3 seconds. DO NOT MERGE
parents 9ceec2f0 51c2619c
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -106,6 +106,14 @@ public class PhoneStatusBarPolicy {
        }
    };

    private Runnable mRemoveCastIconRunnable = new Runnable() {
        @Override
        public void run() {
            if (DEBUG) Log.v(TAG, "updateCast: hiding icon NOW");
            mService.setIconVisibility(SLOT_CAST, false);
        }
    };

    public PhoneStatusBarPolicy(Context context, CastController cast, HotspotController hotspot) {
        mContext = context;
        mCast = cast;
@@ -304,11 +312,17 @@ public class PhoneStatusBarPolicy {
            }
        }
        if (DEBUG) Log.v(TAG, "updateCast: isCasting: " + isCasting);
        mHandler.removeCallbacks(mRemoveCastIconRunnable);
        if (isCasting) {
            mService.setIcon(SLOT_CAST, R.drawable.stat_sys_cast, 0,
                    mContext.getString(R.string.accessibility_casting));
            mService.setIconVisibility(SLOT_CAST, true);
        } else {
            // don't turn off the screen-record icon for a few seconds, just to make sure the user
            // has seen it
            if (DEBUG) Log.v(TAG, "updateCast: hiding icon in 3 sec...");
            mHandler.postDelayed(mRemoveCastIconRunnable, 3000);
        }
        mService.setIconVisibility(SLOT_CAST, isCasting);
    }

    private final HotspotController.Callback mHotspotCallback = new HotspotController.Callback() {