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

Commit b4aa8b0c authored by Daniel Sandler's avatar Daniel Sandler Committed by android-build-merger
Browse files

Merge "Delay hiding the cast icon for 3 seconds." into mnc-dr-dev

am: cb10c09f

* commit 'cb10c09f':
  Delay hiding the cast icon for 3 seconds.
parents 8c7b3e87 cb10c09f
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -109,6 +109,14 @@ public class PhoneStatusBarPolicy implements Callback {
        }
    };

    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,
            UserInfoController userInfoController, BluetoothController bluetooth) {
        mContext = context;
@@ -328,11 +336,17 @@ public class PhoneStatusBarPolicy implements Callback {
            }
        }
        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 void profileChanged(int userId) {