mirror of https://github.com/M66B/FairEmail.git
				
				
				
			
							parent
							
								
									98e7473893
								
							
						
					
					
						commit
						c39f280eb8
					
				@ -0,0 +1,34 @@
 | 
				
			||||
package me.leolin.shortcutbadger.impl;
 | 
				
			||||
 | 
				
			||||
import android.content.ComponentName;
 | 
				
			||||
import android.content.Context;
 | 
				
			||||
import android.net.Uri;
 | 
				
			||||
import android.os.Bundle;
 | 
				
			||||
 | 
				
			||||
import java.util.Arrays;
 | 
				
			||||
import java.util.List;
 | 
				
			||||
 | 
				
			||||
import me.leolin.shortcutbadger.Badger;
 | 
				
			||||
import me.leolin.shortcutbadger.ShortcutBadgeException;
 | 
				
			||||
 | 
				
			||||
/**
 | 
				
			||||
 * @author Jason Ling
 | 
				
			||||
 */
 | 
				
			||||
public class HonorHomeBadger implements Badger {
 | 
				
			||||
 | 
				
			||||
    @Override
 | 
				
			||||
    public void executeBadge(Context context, ComponentName componentName, int badgeCount) throws ShortcutBadgeException {
 | 
				
			||||
        Bundle localBundle = new Bundle();
 | 
				
			||||
        localBundle.putString("package", context.getPackageName());
 | 
				
			||||
        localBundle.putString("class", componentName.getClassName());
 | 
				
			||||
        localBundle.putInt("badgenumber", badgeCount);
 | 
				
			||||
        context.getContentResolver().call(Uri.parse("content://com.hihonor.android.launcher.settings/badge/"), "change_badge", null, localBundle);
 | 
				
			||||
    }
 | 
				
			||||
 | 
				
			||||
    @Override
 | 
				
			||||
    public List<String> getSupportLaunchers() {
 | 
				
			||||
        return Arrays.asList(
 | 
				
			||||
                "com.hihonor.android.launcher"
 | 
				
			||||
        );
 | 
				
			||||
    }
 | 
				
			||||
}
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue