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

Commit 02049386 authored by Jae Seo's avatar Jae Seo Committed by Android (Google) Code Review
Browse files

Merge "TIF: Change the directory of the state file" into lmp-dev

parents 5f52e8ce 8211dda3
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.Intent;
import android.media.tv.TvContentRating;
import android.media.tv.TvInputManager;
import android.os.Environment;
import android.os.Handler;
import android.os.UserHandle;
import android.text.TextUtils;
@@ -81,9 +82,13 @@ final class PersistentDataStore {

    public PersistentDataStore(Context context, int userId) {
        mContext = context;
        File tvDir = new File("/data/system/tv/" + userId);
        tvDir.mkdirs();
        mAtomicFile = new AtomicFile(new File(tvDir, "tv-input-manager-state.xml"));
        File userDir = Environment.getUserSystemDirectory(userId);
        if (!userDir.exists()) {
            if (!userDir.mkdirs()) {
                throw new IllegalStateException("User dir cannot be created: " + userDir);
            }
        }
        mAtomicFile = new AtomicFile(new File(userDir, "tv-input-manager-state.xml"));
    }

    public boolean isParentalControlsEnabled() {