Skip to content
Snippets Groups Projects
Commit a6f9f2f9 authored by mrulhania's avatar mrulhania Committed by Manjeet Rulhania
Browse files

Get safety center service when sending notification

SafetyCente Service is not available/published
when SensorPrivacyService is initialized.

Fix: 303452988
Test: presubmit
Change-Id: I9e9a6a0fcfd059ed5ba69703659534d8ac4f5848
parent 279533e7
No related branches found
No related tags found
No related merge requests found
......@@ -174,8 +174,6 @@ public final class SensorPrivacyService extends SystemService {
private CallStateHelper mCallStateHelper;
private KeyguardManager mKeyguardManager;
private SafetyCenterManager mSafetyCenterManager;
private int mCurrentUser = USER_NULL;
public SensorPrivacyService(Context context) {
......@@ -191,7 +189,6 @@ public final class SensorPrivacyService extends SystemService {
mTelephonyManager = context.getSystemService(TelephonyManager.class);
mPackageManagerInternal = getLocalService(PackageManagerInternal.class);
mSensorPrivacyServiceImpl = new SensorPrivacyServiceImpl();
mSafetyCenterManager = mContext.getSystemService(SafetyCenterManager.class);
}
@Override
......@@ -656,7 +653,9 @@ public final class SensorPrivacyService extends SystemService {
String contentTitle = getUiContext().getString(messageRes);
Spanned contentText = Html.fromHtml(getUiContext().getString(
R.string.sensor_privacy_start_use_notification_content_text, packageLabel), 0);
String action = mSafetyCenterManager.isSafetyCenterEnabled()
SafetyCenterManager safetyCenterManager =
mContext.getSystemService(SafetyCenterManager.class);
String action = safetyCenterManager.isSafetyCenterEnabled()
? Settings.ACTION_PRIVACY_CONTROLS : Settings.ACTION_PRIVACY_SETTINGS;
PendingIntent contentIntent = PendingIntent.getActivity(mContext, sensor,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment