Loading core/res/res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -6435,4 +6435,8 @@ ul.</string> <string name="permlab_startForegroundServicesFromBackground">Start foreground services from background</string> <!-- Description of start foreground services from background permission [CHAR LIMIT=NONE] --> <string name="permdesc_startForegroundServicesFromBackground">Allows a companion app to start foreground services from background.</string> <!-- Toast message that is shown when the user unmutes the microphone from the keyboard. [CHAR LIMIT=TOAST] --> <string name="mic_access_on_toast">Microphone is available</string> <!-- Toast message that is shown when the user mutes the microphone from the keyboard. [CHAR LIMIT=TOAST] --> <string name="mic_access_off_toast">Microphone is blocked</string> </resources> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -836,6 +836,8 @@ <java-symbol type="string" name="lockscreen_emergency_call" /> <java-symbol type="string" name="lockscreen_return_to_call" /> <java-symbol type="string" name="low_memory" /> <java-symbol type="string" name="mic_access_off_toast" /> <java-symbol type="string" name="mic_access_on_toast" /> <java-symbol type="string" name="midnight" /> <java-symbol type="string" name="mismatchPin" /> <java-symbol type="string" name="mmiComplete" /> Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ import android.view.accessibility.AccessibilityManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.autofill.AutofillManagerInternal; import android.widget.Toast; import com.android.internal.R; import com.android.internal.accessibility.AccessibilityShortcutController; Loading @@ -204,6 +205,7 @@ import com.android.server.ExtconUEventObserver; import com.android.server.GestureLauncherService; import com.android.server.LocalServices; import com.android.server.SystemServiceManager; import com.android.server.UiThread; import com.android.server.input.InputManagerInternal; import com.android.server.inputmethod.InputMethodManagerInternal; import com.android.server.policy.KeyCombinationManager.TwoKeysCombinationRule; Loading Loading @@ -3222,8 +3224,23 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean isEnabled = mSensorPrivacyManager.isSensorPrivacyEnabled( SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE, SensorPrivacyManager.Sensors.MICROPHONE); mSensorPrivacyManager.setSensorPrivacy(SensorPrivacyManager.Sensors.MICROPHONE, !isEnabled); int toastTextResId; if (isEnabled) { toastTextResId = R.string.mic_access_on_toast; } else { toastTextResId = R.string.mic_access_off_toast; } Toast.makeText( mContext, UiThread.get().getLooper(), mContext.getString(toastTextResId), Toast.LENGTH_SHORT) .show(); } } Loading Loading
core/res/res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -6435,4 +6435,8 @@ ul.</string> <string name="permlab_startForegroundServicesFromBackground">Start foreground services from background</string> <!-- Description of start foreground services from background permission [CHAR LIMIT=NONE] --> <string name="permdesc_startForegroundServicesFromBackground">Allows a companion app to start foreground services from background.</string> <!-- Toast message that is shown when the user unmutes the microphone from the keyboard. [CHAR LIMIT=TOAST] --> <string name="mic_access_on_toast">Microphone is available</string> <!-- Toast message that is shown when the user mutes the microphone from the keyboard. [CHAR LIMIT=TOAST] --> <string name="mic_access_off_toast">Microphone is blocked</string> </resources>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -836,6 +836,8 @@ <java-symbol type="string" name="lockscreen_emergency_call" /> <java-symbol type="string" name="lockscreen_return_to_call" /> <java-symbol type="string" name="low_memory" /> <java-symbol type="string" name="mic_access_off_toast" /> <java-symbol type="string" name="mic_access_on_toast" /> <java-symbol type="string" name="midnight" /> <java-symbol type="string" name="mismatchPin" /> <java-symbol type="string" name="mmiComplete" /> Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ import android.view.accessibility.AccessibilityManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.autofill.AutofillManagerInternal; import android.widget.Toast; import com.android.internal.R; import com.android.internal.accessibility.AccessibilityShortcutController; Loading @@ -204,6 +205,7 @@ import com.android.server.ExtconUEventObserver; import com.android.server.GestureLauncherService; import com.android.server.LocalServices; import com.android.server.SystemServiceManager; import com.android.server.UiThread; import com.android.server.input.InputManagerInternal; import com.android.server.inputmethod.InputMethodManagerInternal; import com.android.server.policy.KeyCombinationManager.TwoKeysCombinationRule; Loading Loading @@ -3222,8 +3224,23 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean isEnabled = mSensorPrivacyManager.isSensorPrivacyEnabled( SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE, SensorPrivacyManager.Sensors.MICROPHONE); mSensorPrivacyManager.setSensorPrivacy(SensorPrivacyManager.Sensors.MICROPHONE, !isEnabled); int toastTextResId; if (isEnabled) { toastTextResId = R.string.mic_access_on_toast; } else { toastTextResId = R.string.mic_access_off_toast; } Toast.makeText( mContext, UiThread.get().getLooper(), mContext.getString(toastTextResId), Toast.LENGTH_SHORT) .show(); } } Loading