Loading AndroidManifest.xml +6 −0 Original line number Diff line number Diff line Loading @@ -2390,5 +2390,11 @@ android:name=".cyanogenmod.LtoService"> </service> <receiver android:name=".cyanogenmod.ShortcutCleanupReceiver"> <intent-filter> <action android:name="android.intent.action.PACKAGE_REMOVED" /> <data android:scheme="package"></data> </intent-filter> </receiver> </application> </manifest> src/com/android/settings/cyanogenmod/ShortcutCleanupReceiver.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.cyanogenmod; import com.android.internal.util.cm.LockscreenShortcutsHelper; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.text.TextUtils; public class ShortcutCleanupReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Uri uri = intent.getData(); if (uri == null) { // they sent us a bad intent return; } final String packageName = uri.getSchemeSpecificPart(); if (TextUtils.isEmpty(packageName)) { // they sent us a bad intent return; } cleanupLockscreenShortcuts(context, packageName); } private void cleanupLockscreenShortcuts(Context context, String packageName) { LockscreenShortcutsHelper helper = new LockscreenShortcutsHelper(context, null); helper.removeTargetsForPackage(packageName); } } Loading
AndroidManifest.xml +6 −0 Original line number Diff line number Diff line Loading @@ -2390,5 +2390,11 @@ android:name=".cyanogenmod.LtoService"> </service> <receiver android:name=".cyanogenmod.ShortcutCleanupReceiver"> <intent-filter> <action android:name="android.intent.action.PACKAGE_REMOVED" /> <data android:scheme="package"></data> </intent-filter> </receiver> </application> </manifest>
src/com/android/settings/cyanogenmod/ShortcutCleanupReceiver.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.cyanogenmod; import com.android.internal.util.cm.LockscreenShortcutsHelper; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.text.TextUtils; public class ShortcutCleanupReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Uri uri = intent.getData(); if (uri == null) { // they sent us a bad intent return; } final String packageName = uri.getSchemeSpecificPart(); if (TextUtils.isEmpty(packageName)) { // they sent us a bad intent return; } cleanupLockscreenShortcuts(context, packageName); } private void cleanupLockscreenShortcuts(Context context, String packageName) { LockscreenShortcutsHelper helper = new LockscreenShortcutsHelper(context, null); helper.removeTargetsForPackage(packageName); } }